/** * 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(); }
/** * 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(); }
/** * 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')); }
public function admin_index() { $this->pageTitle = __('Error Logs'); parent::admin_index(); }