/** * Remove one or more entries for an event * * @return void */ public function removeTask() { // Incoming $ids = Request::getVar('id', array()); if (!is_array($ids)) { $ids = array(); } // Make sure we have an ID if (empty($ids)) { App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false)); return; } // Instantiate an event object $event = new Event($this->database); // Instantiate a page object $ep = new Page($this->database); // Instantiate a respondent object $er = new Respondent(array()); // Loop through the IDs and unpublish the event foreach ($ids as $id) { // Instantiate an event tags object $rt = new Tags($id); // Delete tags on this event $rt->removeAll(); // Delete the event $event->delete($id); // Delete any associated pages $ep->deletePages($id); // Delete any associated respondents $er->deleteRespondents($id); } // Redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_EVENTS_CAL_LANG_REMOVED')); }