本文整理汇总了PHP中TemplatesHelper::parseXMLTemplateFile方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatesHelper::parseXMLTemplateFile方法的具体用法?PHP TemplatesHelper::parseXMLTemplateFile怎么用?PHP TemplatesHelper::parseXMLTemplateFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplatesHelper
的用法示例。
在下文中一共展示了TemplatesHelper::parseXMLTemplateFile方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItem
function getItem()
{
global $mainframe;
jimport('joomla.filesystem.path');
if (!$this->template) {
return JError::raiseWarning(500, 'Template not specified');
}
$tBaseDir = JPath::clean(JPATH_RSGALLERY2_SITE . '/templates');
if (!is_dir($tBaseDir . '/' . $this->template)) {
return JError::raiseWarning(500, 'Template not found');
}
$lang =& JFactory::getLanguage();
$lang->load('tpl_' . $this->template, JPATH_RSGALLERY2_SITE);
$ini = JPATH_RSGALLERY2_SITE . '/templates/' . $this->template . '/params.ini';
$xml = JPATH_RSGALLERY2_SITE . '/templates/' . $this->template . '/templateDetails.xml';
$row = TemplatesHelper::parseXMLTemplateFile($tBaseDir, $this->template);
jimport('joomla.filesystem.file');
// Read the ini file
if (JFile::exists($ini)) {
$content = JFile::read($ini);
} else {
$content = null;
}
$params = new JParameter($content, $xml, 'template');
// Set FTP credentials, if given
jimport('joomla.client.helper');
$ftp =& JClientHelper::setCredentialsFromRequest('ftp');
$item = new stdClass();
$item->params = $params;
$item->row = $row;
$item->type = $this->_type;
$item->template = $this->template;
return $item;
}
示例2: getItems
/**
* Override parent getItems to add extra XML metadata.
*
* @return array
*
* @since 1.6
*/
public function getItems()
{
$items = parent::getItems();
foreach ($items as &$item) {
$client = JApplicationHelper::getClientInfo($item->client_id);
$item->xmldata = TemplatesHelper::parseXMLTemplateFile($client->path, $item->element);
}
return $items;
}
示例3: parseXMLTemplateFiles
function parseXMLTemplateFiles($templateBaseDir)
{
// Read the template folder to find templates
jimport('joomla.filesystem.folder');
$templateDirs = JFolder::folders($templateBaseDir);
$rows = array();
// Check that the directory contains an xml file
foreach ($templateDirs as $templateDir) {
if (!($data = TemplatesHelper::parseXMLTemplateFile($templateBaseDir, $templateDir))) {
continue;
} else {
$rows[] = $data;
}
}
return $rows;
}
示例4: defined
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div class="pull-left">
<?php
echo JHtml::_('templates.thumb', $this->template->element, $this->template->client_id);
?>
</div>
<h2><?php
echo ucfirst($this->template->element);
?>
</h2>
<?php
$client = JApplicationHelper::getClientInfo($this->template->client_id);
?>
<p><?php
$this->template->xmldata = TemplatesHelper::parseXMLTemplateFile($client->path, $this->template->element);
?>
</p>
<p><?php
echo JText::_($this->template->xmldata->description);
?>
</p>
示例5: editTemplate
public static function editTemplate()
{
jimport('joomla.filesystem.path');
// Initialize some variables
$db =& JFactory::getDBO();
$cid = JRequest::getVar('cid', array(), 'method', 'array');
$cid = array(JFilterInput::clean(@$cid[0], 'cmd'));
$template = $cid[0];
$option = JRequest::getCmd('option');
$client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
if (!$cid[0]) {
return JError::raiseWarning(500, JText::_('Template not specified'));
}
$tBaseDir = JPath::clean($client->path . DS . 'templates');
if (!is_dir($tBaseDir . DS . $template)) {
return JError::raiseWarning(500, JText::_('Template not found'));
}
$lang =& JFactory::getLanguage();
$lang->load('tpl_' . $template, JPATH_ADMINISTRATOR);
$ini = $client->path . DS . 'templates' . DS . $template . DS . 'params.ini';
$xml = $client->path . DS . 'templates' . DS . $template . DS . 'templateDetails.xml';
$row = TemplatesHelper::parseXMLTemplateFile($tBaseDir, $template);
jimport('joomla.filesystem.file');
// Read the ini file
if (JFile::exists($ini)) {
$content = JFile::read($ini);
} else {
$content = null;
}
$params = new JParameter($content, $xml, 'template');
$default = TemplatesHelper::isTemplateDefault($row->directory, $client->id);
if (TemplatesHelper::isTemplateDefault($row->directory, $client->id)) {
$row->default = 1;
} else {
$row->default = 0;
}
// Set FTP credentials, if given
jimport('joomla.client.helper');
$ftp =& JClientHelper::setCredentialsFromRequest('ftp');
require_once JPATH_COMPONENT . DS . 'admin.templates.html.php';
TemplatesView::editTemplate($row, array(), $params, $option, $client, $ftp, $template);
}
示例6: ucfirst
</legend>
<div class="input-wrap">
<?php
echo Html::templates('thumb', $this->template->element, $this->template->client_id);
?>
<h2><?php
echo ucfirst($this->template->element);
?>
</h2>
<?php
//$client = JApplicationHelper::getClientInfo($this->template->client_id);
?>
<p><?php
$this->template->xmldata = TemplatesHelper::parseXMLTemplateFile($this->template->protected ? PATH_CORE : PATH_APP, $this->template->element);
?>
</p>
<p><?php
echo Lang::txt($this->template->xmldata->description);
?>
</p>
</div>
</fieldset>
<fieldset class="adminform" id="template-manager-files">
<legend><?php
echo Lang::txt('COM_TEMPLATES_TEMPLATE_MASTER_FILES');
?>
</legend>
<ul class="item-list layout">