public static function getParentMenu($publish=null, $parent=null, $type=null) 
	{		
		$criteria=new CDbCriteria;
		if($publish != null)
			$criteria->compare('t.publish',$publish);
		if($parent != null)
			$criteria->compare('t.parent_id',$parent);
		
		$model = self::model()->findAll($criteria);

		if($type == null) {
			$items = array();
			if($model != null) {
				foreach($model as $key => $val) {
					$items[$val->id] = $val->title->message;
				}
				return $items;
			} else {
				return false;
			}
		} else
			return $model;
	}
public static function getParentMenu($publish=null, $parent=null, $type=null) 
	{		
		$criteria=new CDbCriteria;
		if($publish != null)
			$criteria->compare('t.publish',$publish);
		if($parent != null)
			$criteria->compare('t.parent_id',$parent);
		
		$model = self::model()->findAll($criteria);

		if($type == null) {
			$items = array();
			if($model != null) {
				foreach($model as $key => $val) {
					$items[$val->id] = $val->title->message;
				}
				return $items;
			} else {
				return false;
			}
		} else
			return $model;
	}
public static function getParentMenu ( $ publish = null , $ parent = null , $ type = null ) { $ criteria = new CDbCriteria ; if ( $ publish != null ) $ criteria -> compare ( 't.publish' , $ publish ) ; if ( $ parent != null ) $ criteria -> compare ( 't.parent_id' , $ parent ) ; $ model = self :: model ( ) -> findAll ( $ criteria ) ; if ( $ type == null ) { $ items = array ( ) ; if ( $ model != null ) { foreach ( $ model as $ key => $ val ) { $ items [ $ val -> id ] = $ val -> title -> message ; } return $ items ; } else { return false ; } } else return $ model ; }
getParentMenu
0 = unpublish
1 = publish
getParentMenu 0 = unpublish 1 = publish