CoreFiles by mySites.guru
OverridesController.php81 lines, 1,812 bytes, from Joomla_4.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha9
md5
29a729927b150c4e8523a03281b61314
sha1
c65582503a22540325b3ffedd164ea20de067bba
sha256
1b5d83e6db5cc304b63dd4cbd37be8fef72d32458d610153cb34531181b35e04
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_languages
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
namespace Joomla\Component\Languages\Administrator\Controller;

defined('_JEXEC') or die;

use Joomla\CMS\MVC\Controller\AdminController;

/**
 * Languages Overrides Controller.
 *
 * @since  2.5
 */
class OverridesController extends AdminController
{
	/**
	 * The prefix to use with controller messages.
	 *
	 * @var		string
	 * @since	2.5
	 */
	protected $text_prefix = 'COM_LANGUAGES_VIEW_OVERRIDES';

	/**
	 * Method for deleting one or more overrides.
	 *
	 * @return  void
	 *
	 * @since		2.5
	 */
	public function delete()
	{
		// Check for request forgeries.
		\JSession::checkToken() or die(\JText::_('JINVALID_TOKEN'));

		// Get items to dlete from the request.
		$cid = $this->input->get('cid', array(), 'array');

		if (!is_array($cid) || count($cid) < 1)
		{
			$this->setMessage(\JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), 'warning');
		}
		else
		{
			// Get the model.
			$model = $this->getModel('overrides');

			// Remove the items.
			if ($model->delete($cid))
			{
				$this->setMessage(\JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
			}
			else
			{
				$this->setMessage($model->getError(), 'error');
			}
		}

		$this->setRedirect(\JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
	}

	/**
	 * Method to purge the overrider table.
	 *
	 * @return  void
	 *
	 * @since   3.4.2
	 */
	public function purge()
	{
		$model = $this->getModel('overrides');
		$model->purge();
		$this->setRedirect(\JRoute::_('index.php?option=com_languages&view=overrides', false));
	}
}

No other release has this exact content. See every version of this file.