/** * Load the item data */ protected function loadData() { $this->id = $this->getParameter('id', 'int', null); if ($this->id == null || !BackendAddressesModel::existsGroup($this->id)) { $this->redirect(BackendModel::createURLForAction('groups') . '&error=non-existing'); } $this->record = BackendAddressesModel::getGroup($this->id); }
/** * Execute the action */ public function execute() { $this->id = $this->getParameter('id', 'int'); // does the item exist if ($this->id !== null && BackendAddressesModel::existsGroup($this->id)) { parent::execute(); $this->record = (array) BackendAddressesModel::getGroup($this->id); BackendAddressesModel::deleteGroup($this->id); BackendAddressesModel::deleteAddressesFromGroup($this->id); BackendModel::triggerEvent($this->getModule(), 'after_delete_group', array('id' => $this->id)); $this->redirect(BackendModel::createURLForAction('groups') . '&report=deleted&var=' . urlencode($this->record['title'])); } else { $this->redirect(BackendModel::createURLForAction('groups') . '&error=non-existing'); } }
/** * Execute the action */ public function execute() { parent::execute(); $this->groupId = \SpoonFilter::getGetValue('group', null, null, 'int'); if ($this->groupId == 0) { $this->groupId = null; } else { // get category $this->group = BackendAddressesModel::getGroup($this->groupId); // reset if (empty($this->group)) { // reset GET to trick Spoon $_GET['group'] = null; // reset $this->groupId = null; } } $this->loadDataGrid(); $this->loadFilterForm(); $this->parse(); $this->display(); }