Browse Source

add small title for menus

master
filesite 2 days ago
parent
commit
0b95cfeae7
  1. 4
      themes/beauty/controller/ListController.php
  2. 8
      themes/beauty/views/site/index.php
  3. 6
      www/css/beauty.css

4
themes/beauty/controller/ListController.php

@ -140,7 +140,7 @@ Class ListController extends Controller { @@ -140,7 +140,7 @@ Class ListController extends Controller {
}
//图片、视频类型筛选支持
$allFiles = $scanResults[$cateId]['files'];
$allFiles = !empty($scanResults[$cateId]['files']) ? $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) {
@ -345,7 +345,7 @@ Class ListController extends Controller { @@ -345,7 +345,7 @@ Class ListController extends Controller {
//缓存key统一生成,方便按规则获取上一级目录的缓存cid
protected function getBreadcrumbs($currentDir, $scanResults, $scanner) {
$webroot = FSC::$app['config']['content_directory'];
$arr = explode($webroot, $currentDir['realpath']);
$arr = !empty($currentDir['realpath']) ? explode($webroot, $currentDir['realpath']) : [];
$breads = array();
if (count($arr) < 2) {

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

@ -34,7 +34,6 @@ $main_view_cls = $menu_ext_status == 'opened' ? '' : 'full'; @@ -34,7 +34,6 @@ $main_view_cls = $menu_ext_status == 'opened' ? '' : 'full';
</div>
<a class="navbar-brand" href="/">
<!--img class="verMiddle" src="/content/machete_icon.png" alt="logo图片"-->
<span class="verMiddle"><?php echo $pageTitle; ?></span>
</a>
</div>
@ -57,14 +56,19 @@ $main_view_cls = $menu_ext_status == 'opened' ? '' : 'full'; @@ -57,14 +56,19 @@ $main_view_cls = $menu_ext_status == 'opened' ? '' : 'full';
</form>
*/ ?>
<!--侧边栏-->
<ul class="nav navbar-fixed-left <?=$menu_expand_icon_cls?>">
<li class="menu-title">目录</li>
<?php
$breadcrumbs = !empty($viewData['breadcrumbs']) ? $viewData['breadcrumbs'] : [];
if (!empty($viewData['menus'])) { //只显示第一级目录
foreach ($viewData['menus'] as $index => $item) {
$selected = $item['id'] == $selectedId || (!empty($breadcrumbs) && $item['id'] == $breadcrumbs[0]['id']) ? 'active' : '';
echo <<<eof
<li class="{$selected}"><a href="{$item['path']}">{$item['directory']}</a></li>
<li class="{$selected}"><a href="{$item['path']}">
<img src="/img/beauty/folder.svg" alt="directories" width="17" class="menu-icon">
{$item['directory']}
</a></li>
eof;
}
}

6
www/css/beauty.css

@ -65,6 +65,7 @@ a:link{text-decoration:none} @@ -65,6 +65,7 @@ a:link{text-decoration:none}
padding-bottom:3em;
padding-top:10px;
}
.navbar-fixed-left li a{padding-left:5px;padding-right:5px}
.navbar-fixed-left .active a{background-color:#e7e7e7;color:#555}
.lampshow .navbar-fixed-left{background-color:#222}
.lampshow .navbar-fixed-left a{color:#DDD}
@ -87,8 +88,9 @@ a:link{text-decoration:none} @@ -87,8 +88,9 @@ a:link{text-decoration:none}
.im_item .btn-set-snap{display:none;position:absolute;top:5px;right:5px;opacity:0.8}
.im_item:hover .btn-set-snap{display:inline-block}
.navbar-fixed-left .expand-icon{position:fixed;top:58px;left:130px;cursor:pointer;padding:5px}
.navbar-fixed-left .menu-title{font-size:12px;color:#999;padding-left:5px}
.navbar-fixed-left .menu-icon{vertical-align:text-top}
.navbar-fixed-left .expand-icon{position:fixed;top:54px;left:130px;cursor:pointer;padding:5px}
.navbar-fixed-left.closed{width:28px;overflow:hidden}
.navbar-fixed-left.closed li{display:none}
.navbar-fixed-left.closed li.expand-icon{display:block;left:5px}

Loading…
Cancel
Save