本文整理汇总了PHP中AppController::admin_index方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::admin_index方法的具体用法?PHP AppController::admin_index怎么用?PHP AppController::admin_index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::admin_index方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* admin_index function
*
* @param mixed $nodeId
* @access public
* @return void
*/
function admin_index($nodeId = null)
{
$counts = $this->Comment->find('all', array('recursive' => -1, 'fields' => array('lang', 'COUNT(id) as count'), 'order' => array('lang'), 'group' => 'lang'));
$counts = Set::combine($counts, '/Comment/lang', '/0/count');
$language = isset($this->passedArgs['language']) ? $this->passedArgs['language'] : $this->params['lang'];
$this->set(compact('counts', 'language'));
$this->Comment->recursive = 2;
$this->paginate['limit'] = 10;
$this->paginate['order'] = 'Comment.id desc';
unset($this->params['named']['language']);
$this->params['named']['lang'] = $language;
if ($nodeId) {
$this->params['named']['node_id'] = $nodeId;
}
parent::admin_index();
}
示例2: unset
/**
* admin_index method
*
* @return void
* @access public
*/
function admin_index()
{
if (isset($this->params['named']['restrict_to'])) {
$restrictTo = $this->params['named']['restrict_to'];
unset($this->params['named']['restrict_to']);
$limits = $this->Revision->Node->find('first', array('conditions' => array('Node.id' => $restrictTo), 'fields' => array('lft', 'rght', 'Revision.title')));
$this->params['named']['Node.lft >='] = $limits['Node']['lft'];
$this->params['named']['Node.rght <='] = $limits['Node']['rght'];
$this->Session->setFlash('Only "' . $limits['Revision']['title'] . '" and below');
}
return parent::admin_index();
}
示例3: unset
/**
* admin_index function
*
* @access public
* @return void
*/
function admin_index()
{
$this->paginate['limit'] = 10;
$this->paginate['order'] = 'Node.lft';
$this->paginate['recursive'] = 0;
$this->Node->recursive = 0;
if (isset($this->params['named']['restrict_to'])) {
$restrictTo = $this->params['named']['restrict_to'];
unset($this->params['named']['restrict_to']);
$limits = $this->Node->find('first', array('conditions' => array('Node.id' => $restrictTo), 'fields' => array('lft', 'rght', 'Revision.title')));
$this->params['named']['lft >='] = $limits['Node']['lft'];
$this->params['named']['rght <='] = $limits['Node']['rght'];
$this->Session->setFlash('Only "' . $limits['Revision']['title'] . '" and below');
}
if (!empty($this->passedArgs['language'])) {
$language = $this->passedArgs['language'];
} else {
$language = $this->params['lang'];
}
$conditions = array('Revision.status' => 'pending', 'Revision.lang' => $language);
$recursive = -1;
$fields = array('DISTINCT node_id');
$pendingUpdates = $this->Node->Revision->find('all', compact('conditions', 'recursive', 'fields'));
$pendingUpdates = Set::extract($pendingUpdates, '{n}.Revision.node_id');
parent::admin_index();
$userIds = Set::extract($this->data, '{n}.Revision.user_id');
$users = $this->Node->Revision->User->find('list', array('conditions' => array('User.id' => $userIds)));
$this->set(compact('pendingUpdates', 'users'));
}
示例4: admin_index
public function admin_index()
{
$this->pageTitle = __('Error Logs');
parent::admin_index();
}