/** * Execute the action */ public function execute() { parent::execute(); $this->templates = BackendContentBlocksModel::getTemplates(); $this->loadForm(); $this->validateForm(); $this->parse(); $this->display(); }
/** * Execute the action * * @return void */ public function execute() { // call parent, this will probably add some general CSS/JS or other required files parent::execute(); // fetch available templates $this->templates = BackendContentBlocksModel::getTemplates(); // load the form $this->loadForm(); // validate the form $this->validateForm(); // parse $this->parse(); // display the page $this->display(); }
/** * Get the data * If a revision-id was specified in the URL we load the revision and not the most recent data. */ private function getData() { $this->record = BackendContentBlocksModel::get($this->id); // specific revision? $revisionToLoad = $this->getParameter('revision', 'int'); // if this is a valid revision if ($revisionToLoad !== null) { // overwrite the current record $this->record = BackendContentBlocksModel::getRevision($this->id, $revisionToLoad); // show warning $this->tpl->assign('usingRevision', true); } // get the templates // @todo why is $this->templates loaded twice? $this->templates = BackendContentBlocksModel::getTemplates(); // check if selected template is still available if ($this->record['template'] && !in_array($this->record['template'], $this->templates)) { $this->record['template'] = ''; } }