<!-- end user info --> </div> <!-- NAVIGATION : This navigation is also responsive To make this navigation dynamic please make sure to link the node (the reference to the nav > ul) after page load. Or the navigation will not initialize. --> <nav class="primary-nav"> <!-- NOTE: Notice the gaps after each icon usage <i></i>.. Please note that these links work a bit different than traditional hre="" links. See documentation for details. --> <?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)) {
/** * Models are reused a lot, so their context must be * url-specific but without the pagination parts of the url */ public function context() { if (empty($this->__config['context'])) { $this->__config['context'] = strtolower(get_class($this)); } $path = \Dsc\Pagination::checkRoute(\Base::instance()->hive()['PATH']); $context = $path . '.' . $this->__config['context']; return $context; }