Browse Source

+ support icon base64 & icon base64 minimized

master
dimti 5 years ago
parent
commit
7e75bb2b59
  1. 55
      assets/css/_wms_extend_menu.css
  2. 4
      classes/Extend.php
  3. 7
      partials/menu/main/_system_sidebar_menu.phtml

55
assets/css/_wms_extend_menu.css

@ -2,28 +2,63 @@
.layout-cell.layout-sidenav-container.wms-menu { .layout-cell.layout-sidenav-container.wms-menu {
display: none; display: none;
} }
.sidenav-tree-root .sidenav-tree .back-link.wms-menu-back-link { .sidenav-tree-root .sidenav-tree .back-link.wms-menu-back-link {
display: block !important; display: block !important;
} }
.layout-cell.layout-sidenav-container ~ .layout-cell.sidenav-tree { .layout-cell.layout-sidenav-container ~ .layout-cell.sidenav-tree {
border: none; 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 { .sidenav-tree.minimized {
width: 50px; }
width: 50px;
}
.sidenav-tree.minimized li .header { .sidenav-tree.minimized li .header {
display: none; }
display: none;
}
.sidenav-tree.minimized li .description { .sidenav-tree.minimized li .description {
display: none; }
display: none;
}
.sidenav-tree.minimized ul.top-level > li > div.group h3 { .sidenav-tree.minimized ul.top-level > li > div.group h3 {
font-size: 0.8rem; font-size: 0.8rem;
text-align: center; text-align: center;
padding: 5px 0; }
padding: 5px 0;
}
.sidenav-tree.minimized ul.top-level > li[data-status=collapsed] > div.group h3:before { .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 { .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;
}

4
classes/Extend.php

@ -54,6 +54,8 @@ class Extend
'group' => $group, 'group' => $group,
'url' => isset($page['url']) ? $page['url'] : '#', 'url' => isset($page['url']) ? $page['url'] : '#',
'icon' => isset($page['icon']) ? $page['icon'] : 'icon-leaf', '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.*'], 'permissions' => isset($page['permissions']) ? $page['permissions'] : ['wms.*'],
]; ];
} }
@ -98,6 +100,8 @@ class Extend
'group' => $subGroup, 'group' => $subGroup,
'url' => $subUrl, 'url' => $subUrl,
'icon' => isset($subPage['icon']) ? $subPage['icon'] : 'icon-leaf', '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, 'permissions' => $subPermission,
]; ];
$subCount++; $subCount++;

7
partials/menu/main/_system_sidebar_menu.phtml

@ -39,7 +39,12 @@
: null; : null;
?>" data-keywords="<?= e(trans($item->keywords)) ?>"> ?>" data-keywords="<?= e(trans($item->keywords)) ?>">
<a href="<?= $item->url ?>"> <a href="<?= $item->url ?>">
<i class="<?= $item->icon ?>"></i>
<?php if ($item->icon_base64):?>
<img src="<?=$item->icon_base64?>" alt="<?= e(trans($item->label)) ?>" title="<?= e(trans($item->label)) ?>">
<img src="<?=$item->icon_base64_minimized ? : $item->icon_base64?>" class="minimized" alt="<?= e(trans($item->label)) ?>" title="<?= e(trans($item->label)) ?>">
<?php else: ?>
<i class="<?= $item->icon ?>"></i>
<?php endif;?>
<span class="header"><?= e(trans($item->label)) ?></span> <span class="header"><?= e(trans($item->label)) ?></span>
<span class="description"><?= e(trans($item->description)) ?></span> <span class="description"><?= e(trans($item->description)) ?></span>
</a> </a>

Loading…
Cancel
Save