コード例 #1
0
ファイル: Test.php プロジェクト: Comsa-Veurne/modules
 /**
  * Load the item data
  */
 protected function loadData()
 {
     $this->id = $this->getParameter('id', 'int', null);
     if ($this->id == null || !BackendMailengineModel::exists($this->id)) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }
コード例 #2
0
ファイル: Delete.php プロジェクト: Comsa-Veurne/modules
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendMailengineModel::exists($this->id)) {
         parent::execute();
         $this->record = (array) BackendMailengineModel::get($this->id);
         BackendMailengineModel::delete($this->id);
         BackendSearchModel::removeIndex($this->getModule(), $this->id);
         BackendModel::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id));
         $this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . urlencode($this->record['subject']));
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }