/** * Load module admin sub menu */ public function subAction() { $module = $this->params('name'); $class = $this->params('class', 'dropdown-menu'); $navigation = Menu::subOperation($module, array('ulClass' => $class)); return $navigation; }
/** * Get back-office top menu * * @param array|string $options * * @return string */ public function top($options = array()) { $module = $this->module ?: Pi::service('module')->currrent(); $mode = $_SESSION['PI_BACKOFFICE']['mode']; if (is_string($options)) { $options = array('ulClass' => $options); } if (!isset($options['ulClass'])) { $options['ulClass'] = 'nav nav-tabs'; } $navigation = ''; // Managed components if (AdminMode::MODE_ADMIN == $mode && 'system' == $module) { $currentModule = $_SESSION['PI_BACKOFFICE']['module']; $navigation = Menu::subComponent($currentModule, $options); // Module operations } elseif (AdminMode::MODE_ACCESS == $mode) { if (!isset($options['sub'])) { $options['sub'] = array('ulClass' => 'nav nav-pills', 'maxDepth' => 0); } list($parent, $leaf) = Menu::subOperation($module, $options); $navigation = $parent . $leaf; } return $navigation; }