- md5
- 904f28910850e9166dfe608df5eb3573
- sha1
- 2503f4f99828f41880a5179338d1ca7cffa1145f
- sha256
- dd764a8e1653c686bd40226b8a5d902435377f0102451ed9806d68dfbb344693
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
<?php
/**
* @version $Id: view.html.php 20196 2011-01-09 02:40:25Z ian $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
/**
* View to edit a template style.
*
* @package Joomla.Administrator
* @subpackage com_templates
* @since 1.6
*/
class TemplatesViewStyle extends JView
{
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()
{
JRequest::setVar('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','JTOOLBAR_APPLY');
JToolBarHelper::save('style.save','JTOOLBAR_SAVE');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('style.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('style.cancel','JTOOLBAR_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 7 releases, Joomla 1.6.0 to 1.6.6. See them all, or every version of this file.