/** * Publish one or more entries * * @return void */ public function publishTask() { // Check for request forgeries Request::checkToken(); // 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 a category object $event = new Category($this->database); // Loop through the IDs and publish the category foreach ($ids as $id) { $event->publish($id); } // Redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_EVENTS_CAL_LANG_CATEGORY_PUBLISHED')); }