Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 /**
  * 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 . '" />';
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
?>
</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'));
?>
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
-1
 /**
  * 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')));
 }