From fba2bdf85018eeca48378332da53dba9b29155c2 Mon Sep 17 00:00:00 2001 From: filesite Date: Fri, 20 Dec 2024 12:21:20 +0800 Subject: [PATCH] improve direcorty icon --- themes/beauty/controller/ListController.php | 4 ++-- themes/beauty/views/list/bydate.php | 18 +++++++++++++++++- themes/beauty/views/site/index.php | 14 +++++++++++++- www/img/beauty/lock-fill.svg | 5 +++++ 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 www/img/beauty/lock-fill.svg diff --git a/themes/beauty/controller/ListController.php b/themes/beauty/controller/ListController.php index d0569e3..e8ee5f1 100644 --- a/themes/beauty/controller/ListController.php +++ b/themes/beauty/controller/ListController.php @@ -436,7 +436,7 @@ Class ListController extends Controller { $breadcrumbs = [ [ 'id' => $para_year, - 'name' => $intYear, + 'name' => "{$intYear}年", 'url' => "/list/bydate?year={$para_year}", ] ]; @@ -444,7 +444,7 @@ Class ListController extends Controller { array_push($breadcrumbs, [ 'id' => $para_month, - 'name' => $intMonth, + 'name' => "{$intMonth}月", 'url' => "/list/bydate?year={$para_year}&month={$para_month}", ] ); diff --git a/themes/beauty/views/list/bydate.php b/themes/beauty/views/list/bydate.php index de30664..db78000 100644 --- a/themes/beauty/views/list/bydate.php +++ b/themes/beauty/views/list/bydate.php @@ -11,6 +11,9 @@ if ($viewData['showType'] == 'image') { $supportedExts = $audioExts; } +//需密码授权的目录显示lock图标 +$authConfig = !empty(FSC::$app['config']['password_auth']) ? FSC::$app['config']['password_auth'] : array(); + $dir_ext_status = !empty($_COOKIE['dir_ext_status']) ? $_COOKIE['dir_ext_status'] : 'opened'; $menu_ext_status = !empty($_COOKIE['menu_ext_status']) ? $_COOKIE['menu_ext_status'] : FSC::$app['config']['defaultMenuStatusInPC']; @@ -105,9 +108,22 @@ eof; {$fileTotal} eof; } + + //目录图标支持加密目录 + $dirIcon = "folder.svg"; + if (!empty($authConfig['enable']) && $authConfig['enable'] !== 'false' + && ( + ( empty($authConfig['default']) && !empty($authConfig['allow'][$item['directory']]) ) + || + !empty($authConfig['default']) //如果所有目录都需要密码 + ) + ) { + $dirIcon = "lock-fill.svg"; + } + echo << - directories + directories {$item['directory']} {$htmlFileTotal} diff --git a/themes/beauty/views/site/index.php b/themes/beauty/views/site/index.php index a2df086..80d3f7b 100644 --- a/themes/beauty/views/site/index.php +++ b/themes/beauty/views/site/index.php @@ -119,10 +119,22 @@ eof; eof; } + //目录图标支持加密目录 + $dirIcon = "folder.svg"; + if (!empty($authConfig['enable']) && $authConfig['enable'] !== 'false' + && ( + ( empty($authConfig['default']) && !empty($authConfig['allow'][$item['directory']]) ) + || + !empty($authConfig['default']) //如果所有目录都需要密码 + ) + ) { + $dirIcon = "lock-fill.svg"; + } + $selected = $item['id'] == $selectedId || (!empty($breadcrumbs) && $item['id'] == $breadcrumbs[0]['id']) ? 'active' : ''; echo << - directories + directories {$item['directory']} {$htmlFileTotal} diff --git a/www/img/beauty/lock-fill.svg b/www/img/beauty/lock-fill.svg new file mode 100644 index 0000000..d90b44d --- /dev/null +++ b/www/img/beauty/lock-fill.svg @@ -0,0 +1,5 @@ + + + + +