You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 lines
2.5 KiB

<?php
if ($sideMenuItems = BackendMenu::listSideMenuItems()):
$collapsedGroups = explode('|',
isset($_COOKIE['sidenav_treegroupStatus'])
? $_COOKIE['sidenav_treegroupStatus']
: null
);
$categories = [];
foreach ($sideMenuItems as $sideItemCode => $item) {
$categories[$item->attributes['group']][$sideItemCode] = $item;
}
?>
<ul class="top-level">
<?php foreach ($categories as $category => $items):
$collapsed = in_array($category, $collapsedGroups); ?>
<li data-group-code="<?= e($category) ?>" <?= $collapsed ? 'data-status="collapsed"' : null ?>>
<div class="group">
<h3><?= e(trans($category)); ?></h3>
</div>
<ul>
<?php foreach ($items as $item):
$last_path = array_last(explode('/', request()->path())); ?>
<li class="<?=
((BackendMenu::isSideMenuItemActive($item) && empty($item->scontents))
|| (
isset($item->scontents)
&& $item->scontents == $last_path
))
? 'active'
: null;
?>" data-keywords="<?= e(trans($item->attributes['keywords'])) ?>">
<a href="<?= $item->url ?>">
<?php if ($item->attributes['icon_base64']):?>
<img src="<?=$item->attributes['icon_base64']?>" alt="<?= e(trans($item->label)) ?>" title="<?= e(trans($item->label)) ?>">
<img src="<?=$item->attributes['icon_base64_minimized'] ? : $item->attributes['icon_base64']?>" class="minimized" alt="<?= e(trans($item->label)) ?>" title="<?= e(trans($item->label)) ?>">
<?php elseif (isset($item->icon)): ?>
<i class="<?= $item->icon ?>"></i>
<?php endif;?>
<span class="header"><?= e(trans($item->label)) ?></span>
<span class="description"><?= e(trans($item->attributes['description'])) ?></span>
</a>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif; ?>