58 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			PHTML
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			PHTML
		
	
	
	
	
	
| <?php
 | |
|     if ($sideMenuItems = BackendMenu::listSideMenuItems()):
 | |
|         $collapsedGroups = explode('|',
 | |
|             isset($_COOKIE['sidenav_treegroupStatus'])
 | |
|                 ? $_COOKIE['sidenav_treegroupStatus']
 | |
|                 : null
 | |
|         );
 | |
|         $categories = [];
 | |
|         foreach ($sideMenuItems as $sideItemCode => $item) {
 | |
|             if(!property_exists($item, 'group')) {
 | |
|                 $item->group = 'default';
 | |
|             }
 | |
|             if(!property_exists($item, 'keywords')) {
 | |
|                 $item->keywords = '';
 | |
|             }
 | |
|             if(!property_exists($item, 'description')) {
 | |
|                 $item->description = '';
 | |
|             }
 | |
|             $categories[$item->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->keywords)) ?>">
 | |
|                             <a href="<?= $item->url ?>">
 | |
|                                 <?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>
 | |
|                         </li>
 | |
|                     <?php endforeach ?>
 | |
|                 </ul>
 | |
|             </li>
 | |
|         <?php endforeach ?>
 | |
|     </ul>
 | |
| <?php endif; ?>
 |