Esempio n. 1
0
 public function switch_flags($v = false)
 {
     if (sizeof($this->links) > 0) {
         foreach ($this->links as $link) {
             $flag = trim($link['flag']);
             if ($flag != '') {
                 if (!$v || $flag == $v) {
                     if (CMS::navigation()->is_flag($flag)) {
                         $link->select();
                     } else {
                         $link->deselect();
                     }
                 }
             }
             if ($link->sublinks) {
                 $link->sublinks->switch_flags($v);
             }
         }
     }
 }
Esempio n. 2
0
 /**
  * @return string
  */
 static function embedded_admin_menu($style = '')
 {
     $menu = CMS::navigation()->admin();
     if (!$menu || $menu->count() == 0) {
         return '';
     }
     ob_start();
     if (IO_FS::exists(CMS::app_path('views/embedded-admin-menu.phtml'))) {
         include CMS::app_path('views/embedded-admin-menu.phtml');
     } else {
         include CMS::views_path('embedded-admin-menu.phtml');
     }
     $contents = ob_get_contents();
     ob_end_clean();
     return $contents;
 }
Esempio n. 3
0
File: CMS.php Progetto: techart/tao
 /**
  * @param string|false $uri
  */
 static function process_navigation($uri = false)
 {
     if (!empty(self::$navigation)) {
         return self::$navigation;
     }
     if (!$uri) {
         $uri = WS::env()->request->path;
     }
     Core::load(self::$nav_module);
     self::$navigation = Core::make(self::$nav_module);
     self::$navigation->process($uri);
     if (method_exists(self::$navigation, 'layout')) {
         self::$navigation->layout(CMS::layout_view());
     }
 }