|
|
|
@ -8,8 +8,6 @@ require_once __DIR__ . '/../../../plugins/Common.php';
@@ -8,8 +8,6 @@ require_once __DIR__ . '/../../../plugins/Common.php';
|
|
|
|
|
require_once __DIR__ . '/../../../plugins/Html.php'; |
|
|
|
|
|
|
|
|
|
Class ListController extends Controller { |
|
|
|
|
protected $dateIndexCacheKey = 'MainBotDateIndex'; |
|
|
|
|
protected $noOriginalCtimeFilesCacheKey = 'MainBotNoOriginalCtimeFiles'; |
|
|
|
|
|
|
|
|
|
public function actionIndex() { |
|
|
|
|
$cateId = $this->get('id', ''); |
|
|
|
@ -142,7 +140,7 @@ Class ListController extends Controller {
@@ -142,7 +140,7 @@ Class ListController extends Controller {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//图片、视频类型筛选支持 |
|
|
|
|
$allFiles = !empty($scanResults[$cateId]['files']) ? $scanResults[$cateId]['files'] : []; |
|
|
|
|
$allFiles = $scanResults[$cateId]['files']; |
|
|
|
|
$showType = $this->get('show', 'all'); |
|
|
|
|
if ($showType == 'image' && !empty($scanResults[$cateId]['files'])) { |
|
|
|
|
$scanResults[$cateId]['files'] = array_filter($scanResults[$cateId]['files'], function($item) { |
|
|
|
@ -302,14 +300,10 @@ Class ListController extends Controller {
@@ -302,14 +300,10 @@ Class ListController extends Controller {
|
|
|
|
|
|
|
|
|
|
$isAdminIp = Common::isAdminIp($this->getUserIp()); //判断是否拥有管理权限 |
|
|
|
|
|
|
|
|
|
//从缓存文件获取按年份、月份归类的索引数据 |
|
|
|
|
$cacheDataByDate = Common::getCacheFromFile($this->dateIndexCacheKey, 86400*365); |
|
|
|
|
|
|
|
|
|
$viewName = '//site/index'; //共享视图 |
|
|
|
|
$params = compact( |
|
|
|
|
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'breadcrumbs', 'htmlCateReadme', |
|
|
|
|
'mp3File', 'page', 'pageSize', 'cacheDataId', 'copyright', 'showType', 'isAdminIp', 'allFiles', |
|
|
|
|
'cacheDataByDate' |
|
|
|
|
'mp3File', 'page', 'pageSize', 'cacheDataId', 'copyright', 'showType', 'isAdminIp', 'allFiles' |
|
|
|
|
); |
|
|
|
|
return $this->render($viewName, $params, $pageTitle); |
|
|
|
|
} |
|
|
|
@ -351,7 +345,7 @@ Class ListController extends Controller {
@@ -351,7 +345,7 @@ Class ListController extends Controller {
|
|
|
|
|
//缓存key统一生成,方便按规则获取上一级目录的缓存cid |
|
|
|
|
protected function getBreadcrumbs($currentDir, $scanResults, $scanner) { |
|
|
|
|
$webroot = FSC::$app['config']['content_directory']; |
|
|
|
|
$arr = !empty($currentDir['realpath']) ? explode($webroot, $currentDir['realpath']) : []; |
|
|
|
|
$arr = explode($webroot, $currentDir['realpath']); |
|
|
|
|
$breads = array(); |
|
|
|
|
|
|
|
|
|
if (count($arr) < 2) { |
|
|
|
|