- md5
- c05825cc1d6bc16a3c7129f7b981fe38
- sha1
- 786fa1bf711f13a4f07ee90e134de27cac57ae7d
- sha256
- d1c9c5f3af48a8b2a1333d5b9bd0fcac11efc25c5e6eedd44cf6b002b2076b0b
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
<?php
/**
* @copyright Copyright (C) 2005 - 2014 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 11 releases, Joomla 2.5.18 to 2.5.28. See them all, or every version of this file.