<?php 
/*
　* @$Id
　* @
　* @Ver: 1.0
　* @Create: 2009-04-01 8:10
　* @Modify: 
　* @Author: CPWEB http://www.zilaiye.org
　* @Copyright (C) 2008 www.zilaiye.org. All Rights Reserved.
　* @License CPWEB is free software and use is subject to license terms
　*/
class MenuAction extends GlobalAction{
	public function menu(){
		$action=$_REQUEST['action'];
		switch ($action){
			case 'Systemconfig':$url=__APP__.'/Settings';break;
			case 'Content':$url=__APP__.'/Pages';$this->operations('model');$this->operations('module');break;
			case 'Member':$url=__APP__.'/Member';break;
			case 'Other':$url=__APP__.'/Link';break;
			default:$url=__APP__.'/Index/main';				
		}
		$this->assign('url',$url);
		$this->assign('action',$action);
		$this->display("Public:menu");
	}
	public function topmenu(){
		$this->assign('http',C('SITEURL'));
		$this->display("Public:topmenu");
	}
	public function operations($model_address){
		$Operations = D('OperaView');
		$map['opens'] = 1;
		$map['type_values'] = $model_address;
		$operations = $Operations->where($map)->order("displayorder")->findAll();
		$this->assign($model_address.'_list',$operations);
	}
} 
?>