Beispiel #1
0
 /**
  * Load module component top menu
  */
 public function componentAction()
 {
     $module = $this->params('name');
     $navigation = Menu::subComponent($module);
     return $navigation;
 }
Beispiel #2
0
 /**
  * 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;
 }