Exemple #1
0
 /**
  * Load the item data
  */
 protected function loadData()
 {
     $this->id = $this->getParameter('id', 'int', null);
     if ($this->id == null || !BackendMailengineModel::existsGroup($this->id)) {
         $this->redirect(BackendModel::createURLForAction('groups') . '&error=non-existing');
     }
     $this->record = BackendMailengineModel::getGroup($this->id);
 }
Exemple #2
0
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendMailengineModel::existsGroup($this->id)) {
         parent::execute();
         $this->record = (array) BackendMailengineModel::getGroup($this->id);
         BackendMailengineModel::deleteGroup($this->id);
         BackendMailengineModel::deleteUserFromGroup($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');
     }
 }