CoreFiles by mySites.guru
view.html.php109 lines, 2,101 bytes, from Joomla_2.5.17-Stable-Full_Package.zip
Raw History Compare with 2.5.16
md5
ffdf3a40af69e646575c55f06fc56a6e
sha1
f78c9f7521024273a69cc70b73f7c01bf2b1c48b
sha256
b05a12399cf48fd01af46347de9e4feed40d3dc75525647fdaabf2ab13c73653
<?php
/**
 * @package		Joomla.Administrator
 * @subpackage	com_languages
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * View for language overrides list
 *
 * @package			Joomla.Administrator
 * @subpackage	com_languages
 * @since				2.5
 */
class LanguagesViewOverrides extends JViewLegacy
{
	/**
	 * The items to list
	 *
	 * @var		array
	 * @since	2.5
	 */
	protected $items;

	/**
	 * The pagination object
	 *
	 * @var		object
	 * @since	2.5
	 */
	protected $pagination;

	/**
	 * The model state
	 *
	 * @var		object
	 * @since	2.5
	 */
	protected $state;

	/**
	 * Displays the view
	 *
	 * @param		string	$tpl	The name of the template file to parse
	 *
	 * @return	void
	 *
	 * @since		2.5
	 */
	function display($tpl = null)
	{
		// Get data from the model
		$this->state			= $this->get('State');
		$this->items			= $this->get('Overrides');
		$this->languages	= $this->get('Languages');
		$this->pagination	= $this->get('Pagination');

		// Check for errors
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode("\n", $errors));

			return;
		}

		$this->addToolbar();
		parent::display($tpl);
	}

	/**
	 * Adds the page title and toolbar
	 *
	 * @return	void
	 *
	 * @since		2.5
	 */
	protected function addToolbar()
	{
		// Get the results for each action
		$canDo = LanguagesHelper::getActions();

		JToolBarHelper::title(JText::_('COM_LANGUAGES_VIEW_OVERRIDES_TITLE'), 'langmanager');

		if ($canDo->get('core.create'))
		{
			JToolbarHelper::addNew('override.add');
		}

		if ($canDo->get('core.edit') && $this->pagination->total)
		{
			JToolbarHelper::editList('override.edit');
		}

		if ($canDo->get('core.delete') && $this->pagination->total)
		{
			JToolbarHelper::deleteList('', 'overrides.delete');
		}

		if ($canDo->get('core.admin'))
		{
			JToolBarHelper::preferences('com_languages');
		}
		JToolBarHelper::divider();
		JToolBarHelper::help('JHELP_EXTENSIONS_LANGUAGE_MANAGER_OVERRIDES');
	}
}

The same content is in 8 releases, Joomla 2.5.9 to 2.5.17. See them all, or every version of this file.