CoreFiles by mySites.guru
view.html.php78 lines, 1,694 bytes, from Joomla_3.0.3-Stable-Full_Package.zip
Raw History Compare with 3.0.2
md5
43669def6eb78ad36be39206fee43d48
sha1
1f2fe782b3839e8fc16e96fa8d93246cce4f8958
sha256
17a899fd6ffa5bbc6abde412947ea20d5cc24594cc0ed940b8311e4104f28788
<?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 TemplatesViewSource extends JViewLegacy
{
	protected $form;

	protected $ftp;

	protected $source;

	protected $state;

	protected $template;

	/**
	 * Display the view
	 */
	public function display($tpl = null)
	{
		$this->form		= $this->get('Form');
		$this->ftp		= JClientHelper::setCredentialsFromRequest('ftp');
		$this->source	= $this->get('Source');
		$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);

		$user		= JFactory::getUser();
		$canDo		= TemplatesHelper::getActions();

		JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_EDIT_FILE'), 'thememanager');

		// Can save the item.
		if ($canDo->get('core.edit'))
		{
			JToolbarHelper::apply('source.apply');
			JToolbarHelper::save('source.save');
		}

		JToolbarHelper::cancel('source.cancel');
		JToolbarHelper::divider();
		JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT_SOURCE');
	}
}

The same content is in 4 releases, Joomla 3.0.3 to 3.1.1. See them all, or every version of this file.