/** * Execute the action */ public function execute() { parent::execute(); $action = SpoonFilter::getGetValue('action', array('delete'), 'delete'); // no id's provided if (!isset($_GET['id'])) { $this->redirect(BackendModel::createURLForAction('landing_pages') . '&error=no-items-selected'); } else { // delete items if ($action == 'delete') { BackendAnalyticsModel::deleteLandingPage((array) $_GET['id']); } } // redirect $this->redirect(BackendModel::createURLForAction('landing_pages') . '&report=' . $action); }
/** * Execute the action */ public function execute() { $this->id = $this->getParameter('id', 'int'); // does the item exist if ($this->id !== null && BackendAnalyticsModel::existsLandingPage($this->id)) { parent::execute(); $this->record = (array) BackendAnalyticsModel::getLandingPage($this->id); // delete item BackendAnalyticsModel::deleteLandingPage($this->id); // trigger event BackendModel::triggerEvent($this->getModule(), 'after_delete_landing_page', array('id' => $this->id)); // item was deleted, so redirect $this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . urlencode($this->record['page_path'])); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }
/** * Execute the action * * @return void */ public function execute() { // call parent, this will probably add some general CSS/JS or other required files parent::execute(); // action to execute $action = SpoonFilter::getGetValue('action', array('delete'), 'delete'); // no id's provided if (!isset($_GET['id'])) { $this->redirect(BackendModel::createURLForAction('landing_pages') . '&error=no-items-selected'); } else { // redefine id's $ids = (array) $_GET['id']; // delete items if ($action == 'delete') { BackendAnalyticsModel::deleteLandingPage($ids); } } // redirect $this->redirect(BackendModel::createURLForAction('landing_pages') . '&report=' . $action); }