Initial
This commit is contained in:
		
							
								
								
									
										52
									
								
								partials/menu/main/_system_sidebar_menu.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								partials/menu/main/_system_sidebar_menu.phtml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,52 @@
 | 
			
		||||
<?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 ?>">
 | 
			
		||||
                                <i class="<?= $item->icon ?>"></i>
 | 
			
		||||
                                <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; ?>
 | 
			
		||||
		Reference in New Issue
	
	Block a user