Source for file templates.php
Documentation is available at templates.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
* Templates component helper.
* @package Joomla.Administrator
* @subpackage com_templates
* @param string $vName The name of the active view.
JText::_('COM_TEMPLATES_SUBMENU_STYLES'),
'index.php?option=com_templates&view=styles',
JText::_('COM_TEMPLATES_SUBMENU_TEMPLATES'),
'index.php?option=com_templates&view=templates',
* Gets a list of the actions that can be performed.
foreach ($actions as $action)
$result->set($action->name, $user->authorise($action->name, 'com_templates'));
* Get a list of filter options for the application clients.
* @return array An array of JHtmlOption elements.
// Build the filter options.
$options[] =
JHtml::_('select.option', '0', JText::_('JSITE'));
$options[] =
JHtml::_('select.option', '1', JText::_('JADMINISTRATOR'));
* Get a list of filter options for the templates with styles.
* @param mixed $clientId The CMS client id (0:site | 1:administrator) or '*' for all.
* @return array An array of JHtmlOption elements.
// Build the filter options.
$query =
$db->getQuery(true);
$query->where('client_id=' . (int)
$clientId);
$query->select('element as value, name as text, extension_id as e_id')
->where('type = ' .
$db->quote('template'))
$options =
$db->loadObjectList();
* @param string $templateBaseDir TODO
* @param string $templateDir TODO
* @return boolean|JObject
// Check of the xml file exists
$filePath =
JPath::clean($templateBaseDir .
'/templates/' .
$templateDir .
'/templateDetails.xml');
if ($xml['type'] !=
'template')
foreach ($xml as $key =>
$value)
$data->set($key, $value);
* @param integer $clientId TODO
* @param string $templateDir TODO
public static function getPositions($clientId, $templateDir)
$filePath =
JPath::clean($templateBaseDir .
'/templates/' .
$templateDir .
'/templateDetails.xml');
// Read the file to see if it's a valid component XML file
// Check for a valid XML root tag.
// Extensions use 'extension' as the root tag. Languages use 'metafile' instead
if ($xml->getName() !=
'extension' &&
$xml->getName() !=
'metafile')
$positions = (array)
$xml->positions;
if (isset
($positions['position']))
$positions =
$positions['position'];
Documentation generated on Tue, 19 Nov 2013 15:15:36 +0100 by phpDocumentor 1.4.3