active_page=$ap; $this->sidebar_width=$sw; } public function add($code,$text,$link) { $this->bar_list[$code]=array("link"=>$link,"text"=>$text); } public function set_active($code) { $this->active_page=$code; } public function to_json() { return json_encode($bar_list,JSON_UNESCAPED_UNICODE); } private function echo_item($code,$text,$link) { echo ''.$text.''; } public function start() { if($this->bar_list==null)return; echo '
'; echo '
'; foreach($this->bar_list as $code=>$obj) { $link=$obj["link"]; $text=$obj["text"]; $this->echo_item($code,$text,$link); } echo '
'; } public function end() { echo '
'; } };//class UISideBar ?>