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. 6
      classes/Extend.php
  3. 9
      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 {
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;
}

6
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);
});
}
}
}

9
partials/menu/main/_system_sidebar_menu.phtml

@ -39,7 +39,12 @@
: null;
?>" data-keywords="<?= e(trans($item->keywords)) ?>">
<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="description"><?= e(trans($item->description)) ?></span>
</a>
@ -49,4 +54,4 @@
</li>
<?php endforeach ?>
</ul>
<?php endif; ?>
<?php endif; ?>
Loading…
Cancel
Save