diff --git a/phptools.php b/phptools.php index c28658f..d5bd913 100644 --- a/phptools.php +++ b/phptools.php @@ -10,3 +10,4 @@ require_once "ui_tab.php"; require_once 'ui_sidebar.php'; + require_once "ui_navbar.php"; diff --git a/tools.php b/tools.php index 75211da..160f14f 100644 --- a/tools.php +++ b/tools.php @@ -8,9 +8,18 @@ - - - + + + + + + + + + + + +
'; } diff --git a/ui_navbar.php b/ui_navbar.php new file mode 100644 index 0000000..71a223a --- /dev/null +++ b/ui_navbar.php @@ -0,0 +1,154 @@ +sub_menu=$s; + } + + public function __construct2($t,$l) + { + $this->Set($t,$l); + } + + public function __construct3($t,$l,$s) + { + $this->Set($t,$l); + $this->sub_menu=$s; + } + + public function Set($t,$l) + { + $this->text=$t; + $this->link=$l; + } + + public function SetSubMenu($sm) + { + $this->sub_menu=$sm; + } + + public function GetText() + { + return $this->text; + } + + public function GetLink() + { + return $this->link; + } + + public function GetSubMenu() + { + return $this->sub_menu; + } + };//class MenuItem + + 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) + { + $sub_menu=$mi->GetSubMenu(); + + if($sub_menu!=null) //子菜单 + { + echo '