|
|
@ -38,13 +38,6 @@ Class SiteController extends Controller { |
|
|
|
$htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); |
|
|
|
$htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//排序 |
|
|
|
|
|
|
|
$sortedTree = $this->sortMenusAndDirTree($menus_sorted, $menus, $dirTree); |
|
|
|
|
|
|
|
if (!empty($sortedTree)) { |
|
|
|
|
|
|
|
$menus = $sortedTree['menus']; |
|
|
|
|
|
|
|
$dirTree = $sortedTree['dirTree']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//默认显示的目录 |
|
|
|
//默认显示的目录 |
|
|
|
$cateId = $this->get('id', $menus[0]['id']); |
|
|
|
$cateId = $this->get('id', $menus[0]['id']); |
|
|
|
$subcate = $scanResults[$cateId]; |
|
|
|
$subcate = $scanResults[$cateId]; |
|
|
@ -61,6 +54,11 @@ Class SiteController extends Controller { |
|
|
|
//获取tags分类 |
|
|
|
//获取tags分类 |
|
|
|
$tags = $this->getTags($dirTree); |
|
|
|
$tags = $this->getTags($dirTree); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//排序 |
|
|
|
|
|
|
|
if (!empty($menus_sorted) && !empty($tags)) { |
|
|
|
|
|
|
|
$tags = $this->sortTags($menus_sorted, $tags); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name']; |
|
|
|
$pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name']; |
|
|
|
if (!empty($subcate)) { |
|
|
|
if (!empty($subcate)) { |
|
|
@ -117,4 +115,19 @@ Class SiteController extends Controller { |
|
|
|
return $tag; |
|
|
|
return $tag; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function sortTags($menus_sorted, $tags) { |
|
|
|
|
|
|
|
$sorted_tags = array(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach($menus_sorted as $tag) { |
|
|
|
|
|
|
|
foreach($tags as $id => $item) { |
|
|
|
|
|
|
|
if ($item['name'] == $tag) { |
|
|
|
|
|
|
|
$sorted_tags[$id] = $item; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $sorted_tags; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|