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

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. if ($sideMenuItems = BackendMenu::listSideMenuItems()):
  3. $collapsedGroups = explode('|',
  4. isset($_COOKIE['sidenav_treegroupStatus'])
  5. ? $_COOKIE['sidenav_treegroupStatus']
  6. : null
  7. );
  8. $categories = [];
  9. foreach ($sideMenuItems as $sideItemCode => $item) {
  10. $categories[$item->attributes['group']][$sideItemCode] = $item;
  11. }
  12. ?>
  13. <ul class="top-level">
  14. <?php foreach ($categories as $category => $items):
  15. $collapsed = in_array($category, $collapsedGroups); ?>
  16. <li data-group-code="<?= e($category) ?>" <?= $collapsed ? 'data-status="collapsed"' : null ?>>
  17. <div class="group">
  18. <h3><?= e(trans($category)); ?></h3>
  19. </div>
  20. <ul>
  21. <?php foreach ($items as $item):
  22. $last_path = array_last(explode('/', request()->path())); ?>
  23. <li class="<?=
  24. ((BackendMenu::isSideMenuItemActive($item) && empty($item->scontents))
  25. || (
  26. isset($item->scontents)
  27. && $item->scontents == $last_path
  28. ))
  29. ? 'active'
  30. : null;
  31. ?>" data-keywords="<?= e(trans($item->attributes['keywords'])) ?>">
  32. <a href="<?= $item->url ?>">
  33. <?php if ($item->attributes['icon_base64']):?>
  34. <img src="<?=$item->attributes['icon_base64']?>" alt="<?= e(trans($item->label)) ?>" title="<?= e(trans($item->label)) ?>">
  35. <img src="<?=$item->attributes['icon_base64_minimized'] ? : $item->attributes['icon_base64']?>" class="minimized" alt="<?= e(trans($item->label)) ?>" title="<?= e(trans($item->label)) ?>">
  36. <?php elseif (isset($item->icon)): ?>
  37. <i class="<?= $item->icon ?>"></i>
  38. <?php endif;?>
  39. <span class="header"><?= e(trans($item->label)) ?></span>
  40. <span class="description"><?= e(trans($item->attributes['description'])) ?></span>
  41. </a>
  42. </li>
  43. <?php endforeach ?>
  44. </ul>
  45. </li>
  46. <?php endforeach ?>
  47. </ul>
  48. <?php endif; ?>