/** * Edit a type * * @return void */ public function editTask($row = null) { $this->view->setLayout('curation'); if ($row) { $this->view->row = $row; } else { // Incoming (expecting an array) $id = Request::getVar('id', array(0)); if (is_array($id)) { $id = $id[0]; } else { $id = 0; } // Load the object $this->view->row = new \Components\Publications\Tables\MasterType($this->database); $this->view->row->load($id); $this->view->curation = new \Components\Publications\Models\Curation($this->view->row->curation); // Get blocks model $blocksModel = new \Components\Publications\Models\Blocks($this->database); // Get available blocks $this->view->blocks = $blocksModel->getBlocks('*', " WHERE status=1", " ORDER BY ordering, id"); } // Set any errors if ($this->getError()) { $this->view->setError($this->getError()); } $this->view->config = $this->config; // Get all active categories $objC = new \Components\Publications\Tables\Category($this->database); $this->view->cats = $objC->getCategories(); // Push some styles to the template Document::addStyleSheet('components' . DS . $this->_option . DS . 'assets' . DS . 'css' . DS . 'publications.css'); Document::addScript('components' . DS . $this->_option . DS . 'assets' . DS . 'js' . DS . 'curation.js'); // Output the HTML $this->view->display(); }
/** * Edit a type * * @param object $row * @return void */ public function editTask($row = null) { Request::setVar('hidemainmenu', 1); $database = App::get('db'); if (!is_object($row)) { // Incoming (expecting an array) $id = Request::getVar('id', array(0)); $id = is_array($id) ? $id[0] : $id; // Load the object $row = new \Components\Publications\Tables\MasterType($database); $row->load($id); } $this->view->row = $row; $this->view->curation = new \Components\Publications\Models\Curation($this->view->row->curation); // Get blocks model $blocksModel = new \Components\Publications\Models\Blocks($database); // Get available blocks $this->view->blocks = $blocksModel->getBlocks('*', " WHERE status=1", " ORDER BY ordering, id"); // Set any errors if ($this->getError()) { $this->view->setError($this->getError()); } $this->view->config = $this->config; // Get all active categories $objC = new \Components\Publications\Tables\Category($database); $this->view->cats = $objC->getCategories(); // Output the HTML $this->view->setLayout('curation')->display(); }