<?php
class navbarModel extends model{
	public $base=NULL;
	public function __construct(&$base){
		parent::__construct($base);
		$this->base=$base;
		$this->table="navbar";	
	}
	public function navlist($gid,$pid=0){
		$data=$this->select(array("where"=>array("group_id"=>$gid,"pid"=>$pid,"siteid"=>SITEID),"order"=>"orderindex asc"));
		if(!empty($data)){
			foreach($data as $k=>$v){
				$v['child']=$this->select(array("where"=>array("group_id"=>$gid,"pid"=>$v['id'],"siteid"=>SITEID),"order"=>"orderindex asc"));
				$data[$k]=$v;
			}
		}
		
		return $data;
	}
	/*导航条分组*/
	public function getGroup(){
		return array(
			1=>$this->base->lang['navbar_admintop'],
			2=>$this->base->lang['navbar_adminleft'],
			3=>$this->base->lang['navbar_top'],
			4=>$this->base->lang['navbar_middle'],
			5=>$this->base->lang['navbar_bottom'],
			6=>$this->base->lang['navbar_member'],
			7=>$this->base->lang['navbar_member_admin']
		);
	}
}
?>