⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flinkcontroller.php

📁 a short sketch about linux syntex lines.
💻 PHP
字号:
<?php
class FlinkController extends Easy_Controller_Action{
	public function init(){
		$this->_Flink = new FlinkModel();
	}
	public function indexAction(){
		$this->_View->rows = $this->_Flink->getAll();
		$this->_View->printpage = $this->_Flink->printpage;
		exit($this->_View->render('plugins/flink_index'));
	}
	public function FlinkAction(){
	}
	public function addAction(){
		if ($this->_Request->isPost()){
			if ($this->_Flink->add($this->_Request->getPost())===false){
				$this->_View->message = $this->_Flink->error;
			}else{
				$this->_View->message = _('添加成功!');
			}
			exit($this->_View->render('message'));
		}
	}
	public function modifyAction(){
		if ($this->_Request->isPost()){
			if ($this->_Flink->modify($this->_Request->getPost())===false){
				$this->_View->message = $this->_Flink->error;
			}else{
				$this->_View->message = _('修改成功!');
			}
			exit($this->_View->render('message'));
		}
		$this->_View->modify = $this->_Flink->getRow($this->_Request->getParam('id'));
		exit($this->_View->render('plugins/flink_modify'));
	}
	public function lockedAction(){
		$this->_Flink->locked($this->_Request->getParam('id'));
		$this->_View->redirect('flink/index');
		exit;
	}
	public function postAction(){
		$action = $this->_Request->getPost('action');
		$id = $this->_Request->getPost('id');
		switch($action){
			case 1:
				$this->_Flink->locked(array('state'=>1), $id);
				$this->_View->message = _('审核成功!');
			break;
			case 2:
				$this->_Flink->delete($id);
				$this->_View->message = _('删除成功!');
			break;
			case 3:
				$this->_Flink->locked(array('state'=>2), $id);
				$this->_View->message = _('禁用成功!');
			break;
		}
		
		exit($this->_View->render('message'));
	}
	public function deleteAction(){
		$id = (int)$this->_Request->getParam('id');
		if ($id){
			$this->_Flink->delete($id);
			$this->_View->message = _('删除成功!');
		}else{
			$this->_View->message = _('删除失败!');
		}
		exit($this->_View->render('message'));
	}
}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -