@copyright Copyright (C) 2021. All Rights Reserved. @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____ (_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _) .-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )( \____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__) /------------------------------------------------------------------------------------------------------*/ // No direct access to this file defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; /** * Downloads Admin Controller */ class ExtensiondistributorControllerDownloads extends AdminController { /** * The prefix to use with controller messages. * * @var string * @since 1.6 */ protected $text_prefix = 'COM_EXTENSIONDISTRIBUTOR_DOWNLOADS'; /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return JModelLegacy The model. * * @since 1.6 */ public function getModel($name = 'Download', $prefix = 'ExtensiondistributorModel', $config = array('ignore_request' => true)) { return parent::getModel($name, $prefix, $config); } public function deleteLogs() { JSession::checkToken() or jexit('Wrong token'); $app = Jfactory::getApplication(); $cid = $app->input->get('cid',null,'array'); $return = 'index.php?option=com_extensiondistributor&view=downloads'; // Preset the redirect if (!is_null($return) && JUri::isInternal($return)) { // Redirect to the return value. $this->setRedirect( JRoute::_( $return, false ) ); } $model = $this->getModel('download'); $model->publish($cid,-2); $model->delete($cid); return true; } }