Ejemplo n.º 1
0
 /**
  * List entries
  *
  * @return  void
  */
 public function displayTask()
 {
     // Incoming
     $filters = array('search' => Request::getState($this->_option . '.' . $this->_controller . '.search', 'search', ''), 'sort' => Request::getState($this->_option . '.' . $this->_controller . '.sort', 'filter_order', 'ordering'), 'sort_Dir' => Request::getState($this->_option . '.' . $this->_controller . '.sortdir', 'filter_order_Dir', 'ASC'));
     // Instantiate an object
     $entries = License::all();
     if ($filters['search']) {
         $entries->whereLike('title', strtolower((string) $filters['search']));
     }
     // Get records
     $rows = $entries->ordered('filter_order', 'filter_order_Dir')->paginated('limitstart', 'limit')->rows();
     // Output the HTML
     $this->view->set('rows', $rows)->set('filters', $filters)->display();
 }
Ejemplo n.º 2
0
 /**
  * Show final review form for setting license and agreeing to terms of submission
  *
  * @return  void
  */
 public function step_review()
 {
     if ($this->view->getName() != 'steps') {
         $this->setView('steps', 'review');
     }
     if (!isset($this->view->database)) {
         $this->view->config = $this->config;
         $this->view->database = $this->database;
         $this->view->title = $this->_title;
         $this->view->step = $this->step;
         $this->view->steps = $this->steps;
         $this->view->progress = $this->progress;
     }
     // Incoming
     $id = Request::getInt('id', 0);
     // Ensure we have an ID to work with
     if (!$id) {
         App::abort(404, Lang::txt('COM_CONTRIBUTE_NO_ID'));
     }
     // Load resource info
     $row = Resource::oneOrFail($id);
     $usersgroups = array();
     if (!User::isGuest()) {
         $xgroups = \Hubzero\User\Helper::getGroups(User::get('id'), 'all');
         // Get the groups the user has access to
         $usersgroups = $this->_getUsersGroups($xgroups);
     }
     // Output HTML
     $licenses = License::all()->whereEquals('name', 'custom' . $id)->orWhere('name', 'NOT LIKE', 'custom%')->ordered()->rows();
     $this->view->set('row', $row)->set('id', $id)->set('licenses', $licenses)->set('usersgroups', $usersgroups)->set('next_step', $this->step + 1)->set('task', 'submit')->set('resource', $row)->set('progress', $this->progress)->setErrors($this->getErrors())->display();
 }