Source for file view.html.php
Documentation is available at view.html.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
* View to edit a template style.
* @package Joomla.Administrator
* @subpackage com_templates
* For loading extension state
* For loading template details
* For loading the source form
* For loading source file contents
* List of available overrides
* Name of the present file
* Type of the file - image, source, font
* For loading image information
* Template id for showing preview button
* For loading font information
* For checking if the template is hathor
* A nested array containing lst of files and folders
* An array containing a list of compressed files
* Execute and display a template script.
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
* @return mixed A string if successful, otherwise a Error object.
public function display($tpl =
null)
$this->file =
$app->input->get('file');
$ext =
end($explodeArray);
$imageTypes =
explode(',', $params->get('image_formats'));
$sourceTypes =
explode(',', $params->get('source_formats'));
$fontTypes =
explode(',', $params->get('font_formats'));
$archiveTypes =
explode(',', $params->get('compressed_formats'));
$this->form->setFieldAttribute('source', 'syntax', $ext);
$this->id =
$this->state->get('extension.id');
if (count($errors =
$this->get('Errors')))
$app->enqueueMessage(implode("\n", $errors));
* Add the page title and toolbar.
if ($canDo->get('core.edit') &&
$canDo->get('core.create') &&
$canDo->get('core.admin'))
// Get the toolbar object instance
$bar =
JToolBar::getInstance('toolbar');
$ext =
end($explodeArray);
// Add a Apply and save button
if ($this->type ==
'file')
// Add a Crop and Resize button
elseif ($this->type ==
'image')
JToolbarHelper::custom('template.cropImage', 'move', 'move', 'COM_TEMPLATES_BUTTON_CROP', false, false);
elseif ($this->type ==
'archive')
JToolbarHelper::custom('template.extractArchive', 'arrow-down', 'arrow-down', 'COM_TEMPLATES_BUTTON_EXTRACT_ARCHIVE', false, false);
// Add a copy template button
// Add a Template preview button
if ($this->preview->client_id ==
0)
$bar->appendButton('Link', 'picture', 'COM_TEMPLATES_BUTTON_PREVIEW', JUri::root() .
'index.php?tp=1&templateStyle=' .
$this->preview->id);
// Add Manage folders button
JToolbarHelper::modal('folderModal', 'icon-folder icon white', 'COM_TEMPLATES_BUTTON_FOLDERS');
// Add a Rename file Button
if ($showButton &&
$this->type !=
'home')
// Add a Delete file Button
if ($showButton &&
$this->type !=
'home')
if ($this->type ==
'home')
* Method for creating the collapsible tree.
* @param array $array The value of the present node for recursion
* Method for listing the folder tree in modals.
* @param array $array The value of the present node for recursion
Documentation generated on Tue, 19 Nov 2013 15:17:26 +0100 by phpDocumentor 1.4.3