Exemplo n.º 1
0
 public function execute()
 {
     # Plaintext if called directly
     if ($_GET['mo'] . '_' . $_GET['me'] === __CLASS__) {
         $_GET['ajax'] = 1;
     }
     # The navigation called should have pid == 0
     $name = Common::getPostString('navigation', 'PageMenu');
     # Select all subnavigations from $name
     $id = GWF_Navigations::getIdByName($name);
     if (false === ($selects = GDO::table('GWF_Navigations')->selectAll('navis_id', 'navis_pid=' . $id))) {
         //$this->module->error();
         $selects = array();
     }
     $navis = array();
     foreach ($selects as $n) {
         if (false === ($navi = $this->getNavigation($n['navis_id']))) {
             # Should not happen
             $this->module->error(sprintf('Navigation: could not add navigation with id %s', $n['navis_id']));
             $navi = array();
         }
         $navis[] = $navi;
     }
     $tVars = array('navis' => $navis);
     return $this->templateShow($this->_tpl, $tVars);
 }
Exemplo n.º 2
0
 /**
  * Get all Navigationentries by it's nid name
  * @param string $name
  * @return GWF_Navigation
  */
 public static function getByName($name)
 {
     $nid = GWF_Navigations::getIdByName($name);
     return self::getNavigation($nid);
 }