Example #1
0
 /**
  * Lists publications
  *
  * @return     void
  */
 public function displayTask()
 {
     // Incoming
     $this->view->filters = array();
     $this->view->filters['limit'] = Request::getState($this->_option . '.publications.limit', 'limit', Config::get('list_limit'), 'int');
     $this->view->filters['start'] = Request::getState($this->_option . '.publications.limitstart', 'limitstart', 0, 'int');
     $this->view->filters['search'] = urldecode(trim(Request::getState($this->_option . '.publications.search', 'search', '')));
     $this->view->filters['sortby'] = trim(Request::getState($this->_option . '.publications.sortby', 'filter_order', 'created'));
     $this->view->filters['sortdir'] = trim(Request::getState($this->_option . '.publications.sortdir', 'filter_order_Dir', 'DESC'));
     $this->view->filters['status'] = trim(Request::getState($this->_option . '.publications.status', 'status', 'all'));
     $this->view->filters['dev'] = 1;
     $this->view->filters['category'] = trim(Request::getState($this->_option . '.publications.category', 'category', ''));
     // Instantiate a publication object
     $this->view->model = new Models\Publication($this->database);
     // Get record count
     $this->view->total = $this->view->model->entries('count', $this->view->filters, true);
     // Get publications
     $this->view->rows = $this->view->model->entries('list', $this->view->filters, true);
     $this->view->config = $this->config;
     // Get <select> of types
     // Get types
     $rt = new Tables\Category($this->database);
     $this->view->categories = $rt->getContribCategories();
     // Set any errors
     if ($this->getError()) {
         $this->view->setError($this->getError());
     }
     // Output the HTML
     $this->view->display();
 }