$text); } function create_menu_link($text,$link) { return array("text"=>$text,"link"=>$link); } function create_menu_sub($text,$sub_menu) { return array("text"=>$text,"sub_menu"=>$sub_menu); } class UINavBar { private $style="navbar-default"; private $fix_top=true; private $brand=null; private $brand_link=null; private $menu=null; // private $active=null; public function __construct($m)//,$a) { $this->menu=$m; // $this->active=$a; } public function set_style($s) { if($s==null||strlen($s)<=0) $this->style=""; else $this->style="navbar-".$s; } /** * @b 标题文本 * @l 标题链接 */ public function set_brand($b,$l) { $this->brand=$b; $this->brand_link=$l; } private function echo_menu($m) { if($m==null)return; foreach($m as $mi) { if(!is_array($mi)&&$mi=="-") { echo ''; continue; } if(array_key_exists("sub_menu",$mi)) //有子菜单 { echo ''; } else { // if($this->active==$mi->GetLink()) // echo '
  • '; // else echo '
  • '; if(array_key_exists("link",$mi)) echo ''.$mi["text"].'
  • '; else echo ''.$mi["text"].''; } } } public function out_html() { echo ''; } };//class UINavBar