/** * Edit an entry * * @return void */ public function editTask($rows = null) { Request::setVar('hidemainmenu', 1); require_once dirname(dirname(__DIR__)) . DS . 'tables' . DS . 'contributor' . DS . 'role.php'; require_once dirname(dirname(__DIR__)) . DS . 'tables' . DS . 'contributor' . DS . 'roletype.php'; $authorid = 0; if (!is_array($rows)) { // Incoming $authorid = Request::getVar('id', array(0)); if (is_array($authorid)) { $authorid = !empty($authorid) ? $authorid[0] : 0; } // Load category $obj = new Contributor($this->database); $rows = $obj->getRecordsForAuthor($authorid); } $this->view->rows = $rows; $this->view->authorid = $authorid; $model = new Role($this->database); $this->view->roles = $model->getRecords(array('sort' => 'title')); // Set any errors foreach ($this->getErrors() as $error) { \Notify::error($error); } // Output the HTML $this->view->setLayout('edit')->display(); }