本文整理汇总了PHP中AppController::setStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::setStatus方法的具体用法?PHP AppController::setStatus怎么用?PHP AppController::setStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::setStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function admin_index()
{
/* Active/Inactive/Delete functionality */
if (isset($this->request->data["SiteType"]["setStatus"])) {
//pr($this->request->data);die;
if (!empty($this->request->data['SiteType']['status'])) {
$status = $this->request->data['SiteType']['status'];
} else {
$this->Session->setFlash("Please select the action.", 'default', array('class' => 'alert alert-danger'));
$this->redirect(array('action' => 'admin_index'));
}
$CheckedList = $this->request->data['checkboxes'];
$model = 'SiteType';
$controller = $this->params['controller'];
$action = $this->params['action'];
parent::setStatus($status, $CheckedList, $model, $controller, $action);
}
/* Active/Inactive/Delete functionality */
$value = "";
$value1 = "";
$show = "";
$criteria = "";
if (!empty($this->params)) {
if (!empty($this->params->query['keyword'])) {
$criteria .= " SiteType.name LIKE '%" . trim($this->params->query['keyword']) . "%' ";
}
}
$this->Paginator->settings = array('conditions' => array($criteria), 'limit' => Configure::read('Settings.paginationLimit'), 'order' => array('SiteType.id' => 'DESC'));
$this->set('getData', $this->Paginator->paginate('SiteType'));
$this->set('keyword', $value);
$this->set('show', $show);
$this->set('navadmins', 'class = "active"');
$this->set('breadcrumb', 'SiteTypes/Listing');
$this->set('models', Inflector::singularize($this->name));
}
示例2: array
function admin_index()
{
//check for auth session
$userSession = $this->Session->read('Auth.User');
/* search functionality */
$value = "";
$value1 = "";
$show = "";
$conditions = array('Staff.admin_id !=' => 0);
if (!empty($this->params)) {
if (!empty($this->params->query['keyword'])) {
$keyword = $this->params->query['keyword'];
$value = $keyword;
$conditions = array('OR' => array('Staff.firstname LIKE' => "%{$keyword}%", 'Staff.lastname LIKE' => "%{$keyword}%", 'Staff.username LIKE' => "%{$keyword}%", 'Staff.email LIKE' => "%{$keyword}%"), 'Staff.admin_id !=' => 0);
}
}
//read pagination limit
$limit = Configure::read('Settings.paginationLimit');
//search and paginate
$this->paginate = array('limit' => $limit, 'fields' => array(), 'conditions' => $conditions, 'order' => array('Staff.id' => 'desc'));
$getData = $this->paginate('Staff');
/* Active/Inactive/Delete functionality */
if (isset($this->request->data["Staff"]["setStatus"])) {
// echo 'here';die;
if (!empty($this->request->data['Staff']['status'])) {
$status = $this->request->data['Staff']['status'];
} else {
$this->Session->setFlash("Please select the action.", 'default', array('class' => 'alert alert-danger'));
$this->redirect(array('action' => 'admin_index'));
}
if (!empty($this->request->data['checkboxes'])) {
$CheckedList = $this->request->data['checkboxes'];
$model = 'Staff';
$controller = $this->params['controller'];
$action = $this->params['action'];
parent::setStatus($status, $CheckedList, $model, $controller, $action);
}
}
//set layout
$this->layout = $this->request->is('ajax') ? 'ajax' : 'admin';
//set model
$this->set('models', Inflector::singularize($this->name));
//set breadcrumb
$this->set('breadcrumb', 'Users/All list');
//set pagination limit
$this->set('limit', $limit);
//set variables for search
$this->set('keyword', $value);
$this->set('show', $show);
$this->set('navadmins', 'class = "active"');
$this->set(compact('getData'));
//pr($result);die;
}