本文整理汇总了PHP中TemplatesHelper::getTemplateOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatesHelper::getTemplateOptions方法的具体用法?PHP TemplatesHelper::getTemplateOptions怎么用?PHP TemplatesHelper::getTemplateOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplatesHelper
的用法示例。
在下文中一共展示了TemplatesHelper::getTemplateOptions方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 1.6
*/
public function getOptions()
{
$app = JFactory::getApplication();
$clientId = $app->getUserStateFromRequest('com_templates.styles.filter.client_id', 'filter_client_id', null);
$options = TemplatesHelper::getTemplateOptions($clientId);
return array_merge(parent::getOptions(), $options);
}
示例2: getOptions
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 1.6
*/
public function getOptions()
{
// Get the client_id filter from the user state.
$clientId = JFactory::getApplication()->getUserStateFromRequest('com_templates.styles.client_id', 'client_id', '0', 'string');
// Get the templates for the selected client_id.
$options = TemplatesHelper::getTemplateOptions($clientId);
// Merge into the parent options.
return array_merge(parent::getOptions(), $options);
}
示例3: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$subtemplates = $this->def('subtemplates', 1);
$show_system = $this->def('show_system', 1);
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
$rows = TemplatesHelper::getTemplateOptions('0');
$options = $this->createList($rows, JPATH_ROOT . '/templates', $subtemplates, $show_system);
$attr = '';
$attr .= $this->def('size') ? ' size="' . (int) $this->def('size') . '"' : '';
$attr .= $this->def('multiple') ? ' multiple="multiple"' : '';
return JHtml::_('select.genericlist', $options, $this->name . '[]', trim($attr), 'value', 'text', $this->value, $this->id);
}
示例4: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$size = (int) $this->def('size');
$multiple = $this->def('multiple');
$subtemplates = $this->def('subtemplates', 1);
$show_system = $this->def('show_system', 1);
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
$rows = TemplatesHelper::getTemplateOptions('0');
$options = $this->createList($rows, JPATH_ROOT . '/templates', $subtemplates, $show_system);
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
示例5: getInput
/**
* Method to get the output of this element
*
* @param null
* @return string
*/
protected function getInput()
{
$name = $this->name;
$fieldName = $this->fieldname;
$value = $this->value;
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
$options = TemplatesHelper::getTemplateOptions(0);
if (!empty($options) && is_array($options)) {
array_unshift($options, array('value' => '', 'text' => ''));
return JHTML::_('select.genericlist', $options, $fieldName, null, 'value', 'text', MagebridgeModelConfig::load($fieldName));
}
return '<input type="text" name="' . $name . '" value="' . $value . '" />';
}
示例6: getInput
function getInput($name, $id, $value, $params, $children, $j15 = 0)
{
$this->params = $params;
$size = (int) $this->def('size');
$multiple = $this->def('multiple');
$subtemplates = $this->def('subtemplates', 1);
$show_system = $this->def('show_system', 1);
if ($j15) {
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/template.php';
$rows = TemplatesHelper::parseXMLTemplateFiles(JPATH_ROOT . '/templates');
$options = $this->createList15($rows, JPATH_ROOT . '/templates', $subtemplates, $show_system);
} else {
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
$rows = TemplatesHelper::getTemplateOptions('0');
$options = $this->createList($rows, JPATH_ROOT . '/templates', $subtemplates, $show_system);
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHTML::selectlist($options, $name, $value, $id, $size, $multiple, 0, $j15);
}
示例7:
?>
</button>
</div>
<div class="filter-select">
<label class="selectlabel" for="filter_template"><?php
echo JText::_('COM_TEMPLATES_FILTER_TEMPLATE');
?>
</label>
<select name="filter_template" class="inputbox" id="filter_template">
<option value="0"><?php
echo JText::_('COM_TEMPLATES_FILTER_TEMPLATE');
?>
</option>
<?php
echo JHtml::_('select.options', TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.template'));
?>
</select>
<label class="selectlabel" for="filter_client_id"><?php
echo JText::_('JGLOBAL_FILTER_CLIENT');
?>
</label>
<select name="filter_client_id" class="inputbox" id="filter_client_id">
<option value="*"><?php
echo JText::_('JGLOBAL_FILTER_CLIENT');
?>
</option>
<?php
echo JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'));
?>
示例8: getTemplateOptions
protected function getTemplateOptions()
{
// Get the template-options
if (MageBridgeHelper::isJoomla15()) {
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/template.php';
$options = TemplatesHelper::parseXMLTemplateFiles(JPATH_SITE . '/templates');
} else {
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
$options = TemplatesHelper::getTemplateOptions(0);
}
// Construct an empty option
$option = new stdClass();
if (MageBridgeHelper::isJoomla15()) {
$option->directory = null;
$option->name = null;
} else {
$option->value = null;
$option->text = null;
}
array_unshift($options, $option);
// Return the options
return $options;
}
示例9: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_templates');
JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'eye thememanager');
if ($canDo->get('core.edit.state')) {
JToolbarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME');
JToolbarHelper::divider();
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('style.edit');
}
if ($canDo->get('core.create')) {
JToolbarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
JToolbarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'styles.delete');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_templates');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
JHtmlSidebar::setAction('index.php?option=com_templates&view=styles');
JHtmlSidebar::addFilter(JText::_('COM_TEMPLATES_FILTER_TEMPLATE'), 'filter_template', JHtml::_('select.options', TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.template')));
JHtmlSidebar::addFilter(JText::_('JGLOBAL_FILTER_CLIENT'), 'filter_client_id', JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')));
}