Browse Source

improve direcorty icon

master
filesite 4 weeks ago
parent
commit
fba2bdf850
  1. 4
      themes/beauty/controller/ListController.php
  2. 18
      themes/beauty/views/list/bydate.php
  3. 14
      themes/beauty/views/site/index.php
  4. 5
      www/img/beauty/lock-fill.svg

4
themes/beauty/controller/ListController.php

@ -436,7 +436,7 @@ Class ListController extends Controller { @@ -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 { @@ -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}",
]
);

18
themes/beauty/views/list/bydate.php

@ -11,6 +11,9 @@ if ($viewData['showType'] == 'image') { @@ -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; @@ -105,9 +108,22 @@ eof;
<small class="badge">{$fileTotal}</small>
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 <<<eof
<li><a href="{$item['path']}">
<img src="/img/beauty/folder.svg" alt="directories" width="17" class="menu-icon">
<img src="/img/beauty/{$dirIcon}" alt="directories" width="17" class="menu-icon">
{$item['directory']}
{$htmlFileTotal}
</a></li>

14
themes/beauty/views/site/index.php

@ -119,10 +119,22 @@ eof; @@ -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 <<<eof
<li class="{$selected}"><a href="{$item['path']}">
<img src="/img/beauty/folder.svg" alt="directories" width="17" class="menu-icon">
<img src="/img/beauty/{$dirIcon}" alt="directories" width="17" class="menu-icon">
{$item['directory']}
{$htmlFileTotal}
</a></li>

5
www/img/beauty/lock-fill.svg

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#777" viewBox="0 0 16 16">
<path d="M7 6a1 1 0 0 1 2 0v1H7z"/>
<path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-2 6v1.076c.54.166 1 .597 1 1.224v2.4c0 .816-.781 1.3-1.5 1.3h-3c-.719 0-1.5-.484-1.5-1.3V8.3c0-.627.46-1.058 1-1.224V6a2 2 0 1 1 4 0"/>
</svg>

After

Width:  |  Height:  |  Size: 399 B

Loading…
Cancel
Save