- md5
- 2dcf6314c688e8eff7d808fd85e278e8
- sha1
- 99b0e02649c8ef99e177f28e4773482a68a5cb31
- sha256
- 9b815c0eccdabc28884d9a270f6284020224924aee1a2c858f8d2f6737ecb4cb
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @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 to edit a template style.
*
* @package Joomla.Administrator
* @subpackage com_templates
* @since 1.6
*/
class TemplatesViewStyle extends JViewLegacy
{
protected $item;
protected $form;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->form = $this->get('Form');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$canDo = TemplatesHelper::getActions();
JToolbarHelper::title(
$isNew ? JText::_('COM_TEMPLATES_MANAGER_ADD_STYLE')
: JText::_('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager'
);
// If not checked out, can save the item.
if ($canDo->get('core.edit'))
{
JToolbarHelper::apply('style.apply');
JToolbarHelper::save('style.save');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create'))
{
JToolbarHelper::save2copy('style.save2copy');
}
if (empty($this->item->id))
{
JToolbarHelper::cancel('style.cancel');
}
else
{
JToolbarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
// Get the help information for the template item.
$lang = JFactory::getLanguage();
$help = $this->get('Help');
if ($lang->hasKey($help->url))
{
$debug = $lang->setDebug(false);
$url = JText::_($help->url);
$lang->setDebug($debug);
}
else
{
$url = null;
}
JToolbarHelper::help($help->key, false, $url);
}
}
The same content is in 4 releases, Joomla 3.0.3 to 3.1.1. See them all, or every version of this file.