<?php
class AdminModel{
	private $_model;
	public function __construct(){
		$this->_model = ZibanmaModel::get_instance();
	}
	
	/**
	 * 后台管理导航菜单
	 */
	public function zibanma_admin_menu(){
		return array(
			'系统设置' => array(
				'/' => '网站首页',
				$this->_model->_common->get_rewriter_url('admin-setting') => '系统设置',
				$this->_model->_common->get_rewriter_url('admin-password') => '修改密码',
				$this->_model->_common->get_rewriter_url('admin-navigation_manage') => '导航管理',
				$this->_model->_common->get_rewriter_url('admin-focus_manage') => '焦点管理',
				$this->_model->_common->get_rewriter_url('admin-logout') => '退出系统'
			),
			'新闻系统' => array(
				$this->_model->_common->get_rewriter_url('admin-news_category_manage') => '分类管理',
				$this->_model->_common->get_rewriter_url('admin-news_category_add') => '添加分类',
				$this->_model->_common->get_rewriter_url('admin-news_article_manage') => '文章管理',
				$this->_model->_common->get_rewriter_url('admin-news_article_add') => '添加文章',
			),
			'图片系统' => array(
				$this->_model->_common->get_rewriter_url('admin-pic_category_manage') => '分类管理',
				$this->_model->_common->get_rewriter_url('admin-pic_category_add') => '添加分类',
				$this->_model->_common->get_rewriter_url('admin-pic_album_manage') => '相册管理',
				$this->_model->_common->get_rewriter_url('admin-pic_album_add') => '添加相册',
				$this->_model->_common->get_rewriter_url('admin-pic_graph_manage') => '图片管理',
				$this->_model->_common->get_rewriter_url('admin-pic_graph_add') => '添加图片',
			),
			'友情链接' => array(
				$this->_model->_common->get_rewriter_url_arr(array('admin','link_manage')) => '链接管理',
				$this->_model->_common->get_rewriter_url_arr(array('admin','link_add')) => '添加链接',
			),
		);
	}
	
	/**
	 * 修改管理员密码
	 */
	public function zibanma_admin_password_modification($user, $password){
		return $this->_model->_db->execute("update ".ZIBANMA_DB_PREFIX."member_user set password='{$password}' where user='{$user}' and status=1 and manage=1; ");
	}
	
}
?>