- md5
- 0c2d1104dcb3695b2a337a80c2885454
- sha1
- eec3b6d882f1c8647859b58fd2a4b9dbeec786ff
- sha256
- ef725d2b26d6562c6a88269b61d1c2ccf588bf28a951b41b9695a90ff9a0990e
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @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;
/**
* View to edit a template style.
*
* @package Joomla.Administrator
* @subpackage com_templates
* @since 1.6
*/
class TemplatesViewTemplate extends JViewLegacy
{
protected $files;
protected $state;
protected $template;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->files = $this->get('Files');
$this->state = $this->get('State');
$this->template = $this->get('Template');
// 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);
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$user = JFactory::getUser();
$canDo = TemplatesHelper::getActions();
JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'thememanager');
JToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
// Add a copy button
if ($user->authorise('core.create', 'com_templates'))
{
$title = JText::_('JLIB_HTML_BATCH_COPY');
$dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">
<i class=\"icon-copy\" title=\"$title\"></i>
$title</button>";
$bar->appendButton('Custom', $dhtml, 'upload');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
}
}
The same content is in 3 releases, Joomla 3.0.0 to 3.0.2. See them all, or every version of this file.