From 7e75bb2b591b9b4d600a55f29a50bcc10dfe423a Mon Sep 17 00:00:00 2001 From: dimti Date: Mon, 11 May 2020 06:15:22 +0300 Subject: [PATCH] + support icon base64 & icon base64 minimized --- assets/css/_wms_extend_menu.css | 55 ++++++++++++++++++++++----- classes/Extend.php | 6 ++- partials/menu/main/_system_sidebar_menu.phtml | 9 ++++- 3 files changed, 57 insertions(+), 13 deletions(-) diff --git a/assets/css/_wms_extend_menu.css b/assets/css/_wms_extend_menu.css index eee654c..2a58bf0 100644 --- a/assets/css/_wms_extend_menu.css +++ b/assets/css/_wms_extend_menu.css @@ -2,28 +2,63 @@ .layout-cell.layout-sidenav-container.wms-menu { display: none; } + .sidenav-tree-root .sidenav-tree .back-link.wms-menu-back-link { display: block !important; } + .layout-cell.layout-sidenav-container ~ .layout-cell.sidenav-tree { border: none; } } + +.sidenav-tree ul.top-level > li > ul li a i, .sidenav-tree ul.top-level > li > ul li a img { + position: absolute; + left: 16px; + top: 16px; + font-size: 32px; +} +.sidenav-tree ul.top-level > li > ul li a img.minimized { + display: none; + max-width: 16px; +} + .sidenav-tree.minimized { - width: 50px; } + width: 50px; +} + .sidenav-tree.minimized li .header { - display: none; } + display: none; +} + .sidenav-tree.minimized li .description { - display: none; } + display: none; +} + .sidenav-tree.minimized ul.top-level > li > div.group h3 { font-size: 0.8rem; text-align: center; - padding: 5px 0; } + padding: 5px 0; +} + .sidenav-tree.minimized ul.top-level > li[data-status=collapsed] > div.group h3:before { - display: none; } + display: none; +} + .sidenav-tree.minimized ul.top-level > li > div.group h3:before { - display: none; } -.sidenav-tree.minimized ul.top-level > li > ul li a i { - top: 9px; - left: 13px; - font-size: 18px; } + display: none; +} + +.sidenav-tree.minimized ul.top-level > li > ul li a i, .sidenav-tree.minimized ul.top-level > li > ul li a img { + top: 10px; + left: 15px; + font-size: 16px; +} + +.sidenav-tree.minimized ul.top-level > li > ul li a img:not(.minimized) { + display: none; +} + +.sidenav-tree.minimized ul.top-level > li > ul li a img.minimized { + display: block; +} diff --git a/classes/Extend.php b/classes/Extend.php index aedea63..a67b9a4 100644 --- a/classes/Extend.php +++ b/classes/Extend.php @@ -54,6 +54,8 @@ class Extend 'group' => $group, 'url' => isset($page['url']) ? $page['url'] : '#', 'icon' => isset($page['icon']) ? $page['icon'] : 'icon-leaf', + 'icon_base64' => isset($page['icon_base64']) ? $page['icon_base64'] : '', + 'icon_base64_minimized' => isset($page['icon_base64_minimized']) ? $page['icon_base64_minimized'] : '', 'permissions' => isset($page['permissions']) ? $page['permissions'] : ['wms.*'], ]; } @@ -98,6 +100,8 @@ class Extend 'group' => $subGroup, 'url' => $subUrl, 'icon' => isset($subPage['icon']) ? $subPage['icon'] : 'icon-leaf', + 'icon_base64' => isset($subPage['icon_base64']) ? $subPage['icon_base64'] : '', + 'icon_base64_minimized' => isset($subPage['icon_base64_minimized']) ? $subPage['icon_base64_minimized'] : '', 'permissions' => $subPermission, ]; $subCount++; @@ -215,4 +219,4 @@ class Extend return $order1 == $order2 ? 0 : ($order1 < $order2 ? -1 : 1); }); } -} \ No newline at end of file +} diff --git a/partials/menu/main/_system_sidebar_menu.phtml b/partials/menu/main/_system_sidebar_menu.phtml index d140252..5fa7038 100644 --- a/partials/menu/main/_system_sidebar_menu.phtml +++ b/partials/menu/main/_system_sidebar_menu.phtml @@ -39,7 +39,12 @@ : null; ?>" data-keywords="keywords)) ?>"> - + icon_base64):?> + <?= e(trans($item->label)) ?> + <?= e(trans($item->label)) ?> + + + label)) ?> description)) ?> @@ -49,4 +54,4 @@ - \ No newline at end of file +