예제 #1
0
파일: theme.php 프로젝트: bxbroze/justlight
 /** {@inheritdoc} */
 public function primaryMenu()
 {
     global $controller;
     $menus = $this->themeOption('menu');
     if ($this->tree && $menus) {
         $individual = $controller->getSignificantIndividual();
         $surname = $controller->getSignificantSurname();
         foreach ($menus as $menu) {
             $label = $menu['label'];
             $sort = $menu['sort'];
             $function = $menu['function'];
             if ($sort > 0) {
                 if ($function === 'menuCompact') {
                     $menubar[] = $this->menuCompact($individual, $surname);
                 } elseif ($function === 'menuMedia') {
                     $menubar[] = $this->menuMedia();
                 } elseif ($function === 'menuChart') {
                     $menubar[] = $this->menuChart($individual);
                 } elseif ($function === 'menuLists') {
                     $menubar[] = $this->menuLists($surname);
                 } elseif ($function === 'menuModule') {
                     $menubar[] = $this->menuModule($label);
                 } else {
                     $menubar[] = $this->{$function}();
                 }
             }
         }
         return array_filter($menubar);
     } else {
         return parent::primaryMenu();
     }
 }