|
|
|
@ -76,7 +76,7 @@ Class SiteController extends Controller {
@@ -76,7 +76,7 @@ Class SiteController extends Controller {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取tag分类 |
|
|
|
|
protected function getTags($dirTree) { |
|
|
|
|
protected function getTags($dirTree, $noFiles = false) { |
|
|
|
|
$tags = array(); |
|
|
|
|
|
|
|
|
|
$tagDir = null; |
|
|
|
@ -91,7 +91,7 @@ Class SiteController extends Controller {
@@ -91,7 +91,7 @@ Class SiteController extends Controller {
|
|
|
|
|
if (!empty($tagDir) && !empty($tagDir['files'])) { |
|
|
|
|
foreach($tagDir['files'] as $id => $item) { |
|
|
|
|
if (empty($item['realpath'])) { //如果是txt描述文件 |
|
|
|
|
$tag = $this->getTagItem($item); |
|
|
|
|
$tag = $this->getTagItem($item, $noFiles); |
|
|
|
|
$tags[$tag['id']] = $tag; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -100,7 +100,7 @@ Class SiteController extends Controller {
@@ -100,7 +100,7 @@ Class SiteController extends Controller {
|
|
|
|
|
return $tags; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function getTagItem($tagFile) { |
|
|
|
|
protected function getTagItem($tagFile, $noFiles = false) { |
|
|
|
|
$tag = array(); |
|
|
|
|
|
|
|
|
|
foreach($tagFile as $name => $item) { |
|
|
|
@ -108,7 +108,9 @@ Class SiteController extends Controller {
@@ -108,7 +108,9 @@ Class SiteController extends Controller {
|
|
|
|
|
$tag['id'] = $item; |
|
|
|
|
}else { |
|
|
|
|
$tag['name'] = $name; |
|
|
|
|
$tag['files'] = explode("\n", $item); |
|
|
|
|
if ($noFiles == false) { |
|
|
|
|
$tag['files'] = explode("\n", $item); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|