/** * Load the item data */ protected function loadData() { $this->id = $this->getParameter('id', 'int', null); if ($this->id == null || !BackendAgendaModel::exists($this->id)) { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } $this->record = BackendAgendaModel::get($this->id); // get recurring options if ($this->record['recurring'] == 'Y') { $this->recurringOptions = BackendAgendaModel::getRecurringOptions($this->record['id']); $this->recurringOptionsDays = explode(",", $this->recurringOptions['days']); } }
/** * Execute the action */ public function execute() { $this->id = $this->getParameter('id', 'int'); // does the item exist if ($this->id !== null && BackendAgendaModel::exists($this->id)) { parent::execute(); $this->record = (array) BackendAgendaModel::get($this->id); BackendAgendaModel::delete($this->id); BackendModel::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id)); $this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . urlencode($this->record['title'])); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }
/** * Execute the action */ public function execute() { $this->id = $this->getParameter('agenda_id', 'int'); if ($this->id !== null && BackendAgendaModel::exists($this->id)) { parent::execute(); $this->getData(); $this->loadForm(); $this->validateForm(); $this->parse(); $this->display(); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }