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.

80 lines
3.7 KiB

5 years ago
  1. <?php
  2. $mainMenuCode = 'main';
  3. $sideMainMenuItems = BackendMenu::listSideMenuItems();
  4. if (!isset($context)) {
  5. $context = BackendMenu::getContext();
  6. }
  7. ?>
  8. <?php if ($sideMainMenuItems): ?>
  9. <div class="layout-cell layout-sidenav-container wms-menu">
  10. <div class="layout-relative">
  11. <nav
  12. id="layout-sidenav"
  13. class="layout-sidenav bg-p"
  14. data-active-class="active"
  15. data-control="sidenav">
  16. <ul class="nav">
  17. <?php foreach ($sideMainMenuItems as $sideItemCode => $item): ?>
  18. <li
  19. class="<?= $context->mainMenuCode == $sideItemCode ? 'active' : null ?>"
  20. <?= Html::attributes($item->attributes) ?>
  21. >
  22. <a href="<?= $item->url ?>">
  23. <span class="nav-icon">
  24. <?php if ($item->iconSvg): ?>
  25. <img class="svg-icon" src="<?= Url::asset($item->iconSvg) ?>">
  26. <?php endif ?>
  27. <i class="<?= $item->iconSvg ? 'svg-replace' : null ?> <?= $item->icon ?>"></i>
  28. </span>
  29. <span class="nav-label">
  30. <?= e(trans($item->label)) ?>
  31. </span>
  32. </a>
  33. <span
  34. class="counter <?= $item->counter === null ? 'empty' : null ?>"
  35. data-menu-id="<?= e($mainMenuCode.'/'.$sideItemCode) ?>"
  36. <?php if ($item->counterLabel): ?>title="<?= e(trans($item->counterLabel)) ?>"<?php endif ?>
  37. >
  38. <?= e($item->counter) ?>
  39. </span>
  40. </li>
  41. <?php endforeach ?>
  42. </ul>
  43. </nav>
  44. </div>
  45. </div>
  46. <?php endif ?>
  47. <div class="layout-cell sidenav-tree bg-p" data-control="sidenav-tree" data-search-input="#settings-search-input">
  48. <a class="back-link" href="<?= Backend::url('wms/menu' . (empty($context->sideMenuCode) ? '' : "/{$context->mainMenuCode}")) ?>">
  49. <i class="icon-angle-left"></i><?= e(trans($context->mainMenuCode == $mainMenuCode || empty($context->sideMenuCode)
  50. ? 'wms.menu::plugin.name'
  51. : "wms.site::lang.{$context->mainMenuCode}.title"
  52. )) ?>
  53. </a>
  54. <div class="layout">
  55. <a class="back-link wms-menu-back-link" href="<?= Backend::url('wms/menu' . (empty($context->sideMenuCode) ? '' : "/{$context->mainMenuCode}")) ?>">
  56. <i class="icon-angle-left"></i><?= e(trans($context->mainMenuCode == $mainMenuCode || empty($context->sideMenuCode)
  57. ? 'wms.menu::plugin.name'
  58. : "wms.site::lang.{$context->mainMenuCode}.title"
  59. )) ?>
  60. </a>
  61. <div class="layout-row min-size">
  62. <?= $this->makePartial(__DIR__ . '/../main/_system_sidebar_menu_toolbar.phtml'); ?>
  63. </div>
  64. <div class="layout-row">
  65. <div class="layout-cell">
  66. <div class="layout-relative">
  67. <div class="layout-absolute">
  68. <div class="control-scrollbar" data-control="scrollbar">
  69. <?= $this->makePartial(__DIR__ . '/_sidenav_sidebar_menu.phtml', [
  70. 'context' => $context,
  71. ]) ?>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>