CoreFiles by mySites.guru
view.html.php82 lines, 1,978 bytes, from Joomla_2.5.7-Stable-Full_Package.zip
Raw History Compare with 2.5.6
md5
b9ef9b49ea2acf267a22ccc989c75335
sha1
9499c108f825931f13676ba1324d83008490dec9
sha256
a2e4ab6de27f37fbee72e5da86f54f399fc60522ce62647660872bc156e7e915
<?php
/**
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * HTML View class for the Languages component
 *
 * @package		Joomla.Administrator
 * @subpackage	com_languages
 * @since		1.5
 */
class LanguagesViewLanguage extends JViewLegacy
{
	public $item;
	public $form;
	public $state;

	/**
	 * Display the view
	 */
	public function display($tpl = null)
	{
		$this->item		= $this->get('Item');
		$this->form		= $this->get('Form');
		$this->state	= $this->get('State');

		// Check for errors.
		if (count($errors = $this->get('Errors'))) {
			JError::raiseError(500, implode("\n", $errors));
			return false;
		}

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

	/**
	 * Add the page title and toolbar.
	 *
	 * @since	1.6
	 */
	protected function addToolbar()
	{
		require_once JPATH_COMPONENT.'/helpers/languages.php';

		JRequest::setVar('hidemainmenu', 1);
		$isNew = empty($this->item->lang_id);
		$canDo	= LanguagesHelper::getActions();

		JToolBarHelper::title(JText::_($isNew ? 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_NEW_TITLE' : 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_EDIT_TITLE'), 'langmanager.png');

		// If a new item, can save.
		if ($isNew && $canDo->get('core.create')) {
			JToolBarHelper::save('language.save');
		}

		//If an existing item, allow to Apply and Save.
		if (!$isNew && $canDo->get('core.edit')) {
			JToolBarHelper::apply('language.apply');
			JToolBarHelper::save('language.save');
		}

		// If an existing item, can save to a copy only if we have create rights.
		if ($canDo->get('core.create')) {
			JToolBarHelper::save2new('language.save2new');
		}

		if ($isNew) {
			JToolBarHelper::cancel('language.cancel');
		}
		else {
			JToolBarHelper::cancel('language.cancel', 'JTOOLBAR_CLOSE');
		}

		JToolBarHelper::divider();
		JToolBarHelper::help('JHELP_EXTENSIONS_LANGUAGE_MANAGER_EDIT');
	}
}

The same content is in 2 releases, Joomla 2.5.7 to 2.5.8. See them all, or every version of this file.