/** * Execute the action. * * @return void */ public function execute() { // get parameters $this->id = $this->getParameter('id', 'int'); $this->profileId = $this->getParameter('profile_id', 'int'); // does the item exists if ($this->id !== null && BackendProfilesModel::existsProfileGroup($this->id)) { // does profile exists if ($this->profileId !== null && BackendProfilesModel::exists($this->profileId)) { // call parent, this will probably add some general CSS/JS or other required files parent::execute(); // get data $this->getData(); // load the form $this->loadForm(); // validate the form $this->validateForm(); // parse $this->parse(); // display the page $this->display(); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }
/** * Execute the action. */ public function execute() { // get parameters $this->id = $this->getParameter('id', 'int'); // does the item exist if ($this->id !== null && BackendProfilesModel::existsProfileGroup($this->id)) { // call parent, this will probably add some general CSS/JS or other required files parent::execute(); // get profile group $profileGroup = BackendProfilesModel::getProfileGroup($this->id); // delete profile group BackendProfilesModel::deleteProfileGroup($this->id); // trigger event BackendModel::triggerEvent($this->getModule(), 'after_profile_delete_from_group', array('id' => $this->id)); // profile group was deleted, so redirect $this->redirect(BackendModel::createURLForAction('edit') . '&id=' . $profileGroup['profile_id'] . '&report=membership-deleted#tabGroups'); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }