<?php $pieces = explode('?', \Dsc\Pagination::checkRoute(str_replace($BASE, '', $URI))); $current = $pieces[0]; $list = (new \Admin\Models\Nav\Primary())->setState('filter.root', false)->setState('filter.tree', \Admin\Models\Settings::fetch()->get('admin_menu_id'))->setState('order_clause', array('tree' => 1, 'lft' => 1))->getItems(); // push the default to the beginning of the list array_unshift($list, new \Admin\Models\Nav\Primary(array('route' => './admin', 'title' => 'Dashboard', 'icon' => 'fa-home', 'depth' => 2))); ?> <ul> <?php foreach ($list as $key => $item) { if (!($hasAccess = \Dsc\System::instance()->get('acl')->isAllowed($identity->role, $item->route, '*'))) { continue; } $class = !empty($item->class) ? $item->class : 'menu-item'; $selected = $current == $item->route || !empty($item->base) && strpos($current, $item->base . '/') !== false || \Dsc\String::inStrings(\Dsc\ArrayHelper::getColumn($item->getDescendants(), 'route'), $current); if ($selected || $current == str_replace('./', '/', $item->route)) { $class .= " active open"; } if ($item->hasDescendants()) { $class .= " dropdown"; } if (empty($item->route)) { $item->route = 'javascript:void(0);'; } elseif ($item->route[0] == '/') { $item->route = '.' . $item->route; } echo '<li data-depth="' . $item->getDepth() . '" class="' . $class . '">'; // is this a module? // or just a regular link? echo '<a href="' . $item->route . '" style="">';
<i class="fa fa-dashboard"></i> Dashboard </a> </li> <?php if ($items) { foreach ($items as $item) { ?> <li <?php if (!empty($item->id)) { echo 'id="' . $item->id . '"'; } ?> class="<?php if ($current == $item->route || !empty($item->base) && strpos($current, $item->base) !== false || \Dsc\String::inStrings(\Dsc\ArrayHelper::getColumn($item->children, 'route'), $current)) { echo 'active'; } ?> <?php echo !empty($item->children) ? 'dropdown' : null; ?> "> <a href="<?php echo !empty($item->children) ? 'javascript:;' : '.' . $item->route; ?> "> <?php if (!empty($item->icon)) { ?> <i class="<?php