当前位置: 首页>>代码示例>>PHP>>正文


PHP AppController::admin_index方法代码示例

本文整理汇总了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();
 }
开发者ID:sdoney,项目名称:cookbook,代码行数:23,代码来源:comments_controller.php

示例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();
 }
开发者ID:sdoney,项目名称:cookbook,代码行数:18,代码来源:revisions_controller.php

示例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'));
 }
开发者ID:sdoney,项目名称:cookbook,代码行数:35,代码来源:nodes_controller.php

示例4: admin_index

 public function admin_index()
 {
     $this->pageTitle = __('Error Logs');
     parent::admin_index();
 }
开发者ID:rikdc,项目名称:Logger,代码行数:5,代码来源:LogsController.php


注:本文中的AppController::admin_index方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。