<?php
/**
 * 紫斑马软件
 * @author afan
 * @link http://www.zibanma.com
 */
if(ZIBANMA_SYS_LINK != 'zibanma_com'){
	die('access deny');
}
class LinkControl{
	private $_base;
	
	public function __construct(){
		$this->_base = ZibanmaBase::get_instance();
	}
	
	/**
	 * 管理登录
	 */
	public function zibanma_index(){
		$link = new LinkModel();
		$assign = array(
			'navigation' => $this->_base->_session->navigation,
			'site_config' => $this->_base->_session->site_config,
			'common' =>$this->_base->_common,
			'link_pic_list' => $link->zibanma_get_list('pic'),
			'link_pic_text' => $link->zibanma_get_list('text'),
		);
		$this->_base->_view->make('link.index', $assign);
	}
	
	/**
	 * 添加链接
	 */
	public function zibanma_add(){
		$post = $this->_base->_request->post();
		$post['index'] = 1;
		$post['status'] = 0;
		$link = new LinkModel();
		if($link->zibanma_add($post)){
			echo $this->_base->_common->show_message_url('操作成功，请等待审核', $this->_base->_common->get_rewriter_url_arr(array('link', 'index')));
		}else{
			echo $this->_base->_common->show_message_url('操作失败', $this->_base->_common->get_rewriter_url_arr(array('link', 'index')));
		}
	}
}
?>