/** * Change license status * Redirects to license listing * * @return void */ public function changestatusTask() { // Check for request forgeries Request::checkToken(); // Incoming $ids = Request::getVar('id', array(0), '', 'array'); // Initialize $row = new \Components\Publications\Tables\License($this->database); foreach ($ids as $id) { $id = intval($id); if (!$id) { continue; } // Load row $row->loadLicense($id); $row->active = $row->active == 1 ? 0 : 1; // Save if (!$row->store()) { App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), $row->getError(), 'error'); return; } } // Redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_PUBLICATIONS_SUCCESS_LICENSE_PUBLISHED')); }