- md5
- 84dfbf2260e6cb05b7c8a4c9b785b470
- sha1
- 00114a1389911b0146d00184a34ec8df1149f395
- sha256
- 76b7e69b21e005b461bea49e7c6c69f770d070986ce96197faee258e28266f12
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
<?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 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 4 releases, Joomla 3.0.3 to 3.1.1. See them all, or every version of this file.