protected function getInput()
 {
     if (!NNFrameworkFunctions::extensionInstalled('virtuemart')) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDBO();
     $group = $this->get('group', 'categories');
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'virtuemart_' . $group, $tables)) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
     }
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     if ($group == 'categories') {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
         return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
     }
     $attr = '';
     $attr .= ' size="' . (int) $size . '"';
     $attr .= $multiple ? ' multiple="multiple"' : '';
     return JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
 }
Exemple #2
1
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $group = $this->get('group', 'countries');
     $options = array();
     foreach ($this->{$group} as $key => $val) {
         if (!$val) {
             $options[] = JHtml::_('select.option', '-', '&nbsp;', 'value', 'text', true);
         } else {
             if ($key['0'] == '-') {
                 $options[] = JHtml::_('select.option', '-', $val, 'value', 'text', true);
             } else {
                 $val = nnText::prepareSelectItem($val);
                 $options[] = JHtml::_('select.option', $key, $val);
             }
         }
     }
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
Exemple #3
0
 protected function getInput()
 {
     if (!nnFrameworkFunctions::extensionInstalled('akeebasubs')) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_AKEEBASUBS')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDBO();
     $group = $this->get('group', 'categories');
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'akeebasubs_' . $group, $tables)) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_AKEEBASUBS')) . '</fieldset>';
     }
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     switch ($group) {
         case 'categories':
             return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
         default:
             return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
     }
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     $attribs = 'class="inputbox"';
     $options = array();
     $templates = $this->getTemplates();
     foreach ($templates as $styles) {
         $level = 0;
         foreach ($styles as $style) {
             $style->level = $level;
             $options[] = $style;
             if (count($styles) <= 2) {
                 $level = 0;
                 break;
             }
             $level = 1;
         }
     }
     // fix old '::' separator and change it to '--'
     $value = json_encode($this->value);
     $value = str_replace('::', '--', $value);
     $value = (array) json_decode($value, true);
     return nnHtml::selectlist($options, $this->name, $value, $this->id, $size, $multiple, $attribs);
 }
 protected function getInput()
 {
     if (!NNFrameworkFunctions::extensionInstalled('mijoshop')) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_MIJOSHOP')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $group = $this->def('group', 'categories');
     $this->db = JFactory::getDBO();
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'mijoshop_' . ($group == 'products' ? 'product' : 'category'), $tables)) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_MIJOSHOP')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     require_once JPATH_ROOT . '/components/com_mijoshop/mijoshop/mijoshop.php';
     $this->store_id = (int) MijoShop::get('opencart')->get('config')->get('config_store_id');
     $this->language_id = (int) MijoShop::get('opencart')->get('config')->get('config_language_id');
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     if ($group == 'categories') {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
         return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
     } else {
         $attr = '';
         $attr .= ' size="' . (int) $size . '"';
         $attr .= $multiple ? ' multiple="multiple"' : '';
         return JHtml::_('select.genericlist', $options, $this->name . '[]', trim($attr), 'value', 'text', $this->value, $this->id);
     }
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDBO();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     $show_all = $this->get('show_all');
     $attribs = 'class="inputbox"';
     $groups = $this->getUserGroups();
     $options = array();
     if ($show_all) {
         $option = new stdClass();
         $option->value = -1;
         $option->text = '- ' . JText::_('JALL') . ' -';
         $option->disable = '';
         $options[] = $option;
     }
     foreach ($groups as $group) {
         $option = new stdClass();
         $option->value = $group->value;
         $option->text = $group->text;
         $repeat = $show_all ? $group->level + 1 : $group->level;
         $option->text = str_repeat('- ', $repeat) . $option->text;
         $option->text = nnText::prepareSelectItem($option->text);
         $option->disable = '';
         $options[] = $option;
     }
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple, $attribs);
 }
Exemple #7
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     if (!NNFrameworkFunctions::extensionInstalled('flexicontent')) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</fieldset>';
     }
     $group = $this->def('group', 'categories');
     $this->db = JFactory::getDBO();
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'flexicontent_' . $group, $tables)) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</fieldset>';
     }
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     if ($group == 'categories') {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
         return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
     } else {
         $attr = '';
         $attr .= ' size="' . (int) $size . '"';
         $attr .= $multiple ? ' multiple="multiple"' : '';
         return JHtml::_('select.genericlist', $options, $this->name . '[]', trim($attr), 'value', 'text', $this->value, $this->id);
     }
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     if (!NNFrameworkFunctions::extensionInstalled('virtuemart')) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
     }
     $group = $this->def('group', 'categories');
     $this->db = JFactory::getDBO();
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'virtuemart_' . $group, $tables)) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
     }
     $query = $this->db->getQuery(true);
     $query->select('config')->from('#__virtuemart_configs')->where('virtuemart_config_id = 1');
     $this->db->setQuery($query);
     $config = $this->db->loadResult();
     $lang = substr($config, strpos($config, 'vmlang='));
     $lang = substr($lang, 0, strpos($lang, '|'));
     if (preg_match('#"([^"]*_[^"]*)"#', $lang, $lang)) {
         $this->lang = $lang['1'];
     } else {
         $this->lang = 'en_gb';
     }
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
	protected function getInput()
	{
		if (!nnFrameworkFunctions::extensionInstalled('flexicontent'))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</label></fieldset>';
		}

		$this->params = $this->element->attributes();
		$this->db = JFactory::getDBO();

		$group = $this->get('group', 'categories');

		$tables = $this->db->getTableList();
		if (!in_array($this->db->getPrefix() . 'flexicontent_' . $group, $tables))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</label></fieldset>';
		}

		if (!is_array($this->value))
		{
			$this->value = explode(',', $this->value);
		}

		$options = $this->{'get' . $group}();

		$size = (int) $this->get('size');
		$multiple = $this->get('multiple');

		require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';

		return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
	}
 protected function getInput()
 {
     if (!NNFrameworkFunctions::extensionInstalled('hikashop')) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_HIKASHOP')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDBO();
     $group = $this->get('group', 'categories');
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'hikashop_' . ($group == 'products' ? 'product' : 'category'), $tables)) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_HIKASHOP')) . '</fieldset>';
     }
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     switch ($group) {
         case 'categories':
             return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
         default:
             return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
     }
 }
	protected function getInput()
	{
		$this->params = $this->element->attributes();

		$size = (int) $this->get('size');
		$multiple = $this->get('multiple');
		$client = $this->get('client', 'SITE');

		jimport('joomla.language.helper');
		$langs = JLanguageHelper::createLanguageList($this->value, constant('JPATH_' . strtoupper($client)), true);
		$options = array();
		foreach ($langs as $lang)
		{
			if ($lang['value'])
			{
				$option = new stdClass;
				$option->value = $lang['value'];
				$option->text = $lang['text'] . ' [' . $lang['value'] . ']';
				$options[] = $option;
			}
		}

		require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';

		return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
	}
Exemple #12
0
	protected function getInput()
	{
		$this->params = $this->element->attributes();
		$this->db = JFactory::getDBO();

		$frontend = $this->get('frontend', 1);
		$admin = $this->get('admin', 1);
		$size = (int) $this->get('size');

		if (!$frontend && !$admin)
		{
			return '';
		}

		$components = $this->getComponents($frontend, $admin);

		$options = array();

		foreach ($components as $component)
		{
			$options[] = JHtml::_('select.option', $component->element, $component->name);
		}

		require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';

		return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1);
	}
 protected function getInput()
 {
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple', 1);
     require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
     $options = MenusHelper::getMenuLinks();
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->def('size');
     $attribs = 'class="inputbox"';
     $options = $this->getTags();
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1, $attribs);
 }
Exemple #15
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple', 0);
     JFactory::getLanguage()->load('com_menus', JPATH_ADMINISTRATOR);
     $options = $this->getMenuItems();
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
Exemple #16
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $options = $this->getComponents();
     if (empty($options)) {
         return '';
     }
     $size = (int) $this->get('size');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, 1);
 }
Exemple #17
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->getUsers();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
 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);
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDbo();
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $group = $this->def('group', 'categories');
     $options = $this->{'get' . $group}();
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
Exemple #20
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     foreach ($this->element->children() as $item) {
         $item_value = (string) $item['value'];
         $item_name = JText::_(trim((string) $item));
         $item_disabled = (int) $item['disabled'];
         $options[] = JHtml::_('select.option', $item_value, $item_name, 'value', 'text', $item_disabled);
     }
     $size = (int) $this->get('size');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1);
 }
Exemple #21
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     // assemble items to the array
     $options = array();
     if ($this->get('show_ignore')) {
         if (in_array('-1', $this->value)) {
             $this->value = array('-1');
         }
         $options[] = JHtml::_('select.option', '-1', '- ' . JText::_('NN_IGNORE') . ' -', 'value', 'text', 0);
         $options[] = JHtml::_('select.option', '-', '&nbsp;', 'value', 'text', 1);
     }
     $options += $this->getTags();
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1);
 }
Exemple #22
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     $show_all = $this->get('show_all');
     $options = $this->getUserGroups();
     if ($show_all) {
         $option = new stdClass();
         $option->value = -1;
         $option->text = '- ' . JText::_('JALL') . ' -';
         $option->disable = '';
         array_unshift($options, $option);
     }
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
 protected function getInput()
 {
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple', 1);
     require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
     $options = MenusHelper::getMenuLinks();
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     foreach ($options as $i => $option) {
         $options[$i]->value = 'type.' . $option->menutype;
         $options[$i]->text = $option->title;
         $options[$i]->level = 0;
         $options[$i]->class = 'hidechildren';
         $options[$i]->labelclass = 'nav-header';
         unset($option->title);
     }
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
Exemple #24
0
 public function getSelectList($group = '')
 {
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     $group = $group ?: $this->getGroup();
     $options = $this->getOptions();
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     switch ($group) {
         case 'categories':
             return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
         default:
             return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
     }
 }
Exemple #25
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDbo();
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $group = $this->def('group', 'categories');
     $options = $this->{'get' . $group}();
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     if ($group == 'categories') {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
         return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
     } else {
         $attr = '';
         $attr .= ' size="' . (int) $size . '"';
         $attr .= $multiple ? ' multiple="multiple"' : '';
         return JHtml::_('select.genericlist', $options, $this->name . '[]', trim($attr), 'value', 'text', $this->value, $this->id);
     }
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     if (!NNFrameworkFunctions::extensionInstalled('redshop')) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_REDSHOP')) . '</fieldset>';
     }
     $group = $this->def('group', 'categories');
     $this->db = JFactory::getDBO();
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'redshop_' . ($group == 'products' ? 'product' : 'category'), $tables)) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_REDSHOP')) . '</fieldset>';
     }
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
Exemple #27
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDbo();
     $parameters = nnParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $group = $this->get('group', 'categories');
     $options = $this->{'get' . $group}();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     switch ($group) {
         case 'categories':
             return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
         default:
             return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
     }
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     $attribs = 'class="inputbox"';
     $options = array();
     $templates = $this->getTemplates();
     foreach ($templates as $styles) {
         $level = 0;
         foreach ($styles as $style) {
             $style->level = $level;
             $options[] = $style;
             if (count($styles) <= 2) {
                 $level = 0;
                 break;
             }
             $level = 1;
         }
     }
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple, $attribs);
 }
Exemple #29
0
	protected function getInput()
	{
		if (!NNFrameworkFunctions::extensionInstalled('zoo'))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_ZOO')) . '</label></fieldset>';
		}

		$this->params = $this->element->attributes();
		$this->db = JFactory::getDBO();

		$group = $this->get('group', 'categories');

		$tables = $this->db->getTableList();
		if (!in_array($this->db->getPrefix() . 'zoo_' . ($group == 'applications' ? 'application' : 'category'), $tables))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_ZOO')) . '</label></fieldset>';
		}

		$parameters = NNParameters::getInstance();
		$params = $parameters->getPluginParams('nnframework');
		$this->max_list_count = $params->max_list_count;

		if (!is_array($this->value))
		{
			$this->value = explode(',', $this->value);
		}

		$options = $this->{'get' . $group}();

		$size = (int) $this->get('size');
		$multiple = $this->get('multiple');

		require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';

		return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
	}
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     JHtml::_('behavior.modal', 'a.modal');
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     $showtype = $this->def('showtype');
     $showid = $this->def('showid');
     $showinput = $this->def('showinput');
     $db = JFactory::getDBO();
     // load the list of modules
     $query = $db->getQuery(true);
     $query->select('m.id, m.title, m.position, m.module, m.published')->from('#__modules AS m')->where('m.client_id = 0')->order('m.position, m.title, m.ordering, m.id');
     $db->setQuery($query);
     $modules = $db->loadObjectList();
     // assemble menu items to the array
     $options = array();
     $p = 0;
     foreach ($modules as $item) {
         if ($p !== $item->position) {
             $pos = $item->position;
             if ($pos == '') {
                 $pos = ':: ' . JText::_('JNONE') . ' ::';
             }
             $options[] = JHtml::_('select.option', '-', '[ ' . $pos . ' ]', 'value', 'text', true);
         }
         $p = $item->position;
         $item->title = '&nbsp;&nbsp;' . $item->title;
         if ($showtype) {
             $item->title .= ' [' . $item->module . ']';
         }
         if ($showinput || $showid) {
             $item->title .= ' [' . $item->id . ']';
         }
         $item->title = NNText::prepareSelectItem($item->title, $item->published);
         $options[] = JHtml::_('select.option', $item->id, $item->title);
     }
     if ($showinput) {
         array_unshift($options, JHtml::_('select.option', '-', '&nbsp;', 'value', 'text', true));
         array_unshift($options, JHtml::_('select.option', '-', '- ' . JText::_('Select Item') . ' -'));
         if ($multiple) {
             $onchange = 'if ( this.value ) { if ( ' . $this->id . '.value ) { ' . $this->id . '.value+=\',\'; } ' . $this->id . '.value+=this.value; } this.value=\'\';';
         } else {
             $onchange = 'if ( this.value ) { ' . $this->id . '.value=this.value;' . $this->id . '_text.value=this.options[this.selectedIndex].innerHTML.replace( /^((&|&amp;|&#160;)nbsp;|-)*/gm, \'\' ).trim(); } this.value=\'\';';
         }
         $attribs = 'class="inputbox" onchange="' . $onchange . '"';
         $html = '<table cellpadding="0" cellspacing="0"><tr><td style="padding: 0px;">' . "\n";
         if (!$multiple) {
             $val_name = $this->value;
             if ($this->value) {
                 foreach ($modules as $item) {
                     if ($item->id == $this->value) {
                         $val_name = $item->title;
                         if ($showtype) {
                             $val_name .= ' [' . $item->module . ']';
                         }
                         $val_name .= ' [' . $this->value . ']';
                         break;
                     }
                 }
             }
             $html .= '<input type="text" id="' . $this->id . '_text" value="' . $val_name . '" class="inputbox" size="' . $size . '" disabled="disabled" />';
             $html .= '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="' . $this->value . '" />';
         } else {
             $html .= '<input type="text" name="' . $this->name . '" id="' . $this->id . '" value="' . $this->value . '" class="inputbox" size="' . $size . '" />';
         }
         $html .= '</td><td style="padding: 0px;"padding-left: 5px;>' . "\n";
         $html .= JHtml::_('select.genericlist', $options, '', $attribs, 'value', 'text', '', '');
         $html .= '</td></tr></table>' . "\n";
         return preg_replace('#>\\[\\[\\:(.*?)\\:\\]\\]#si', ' style="\\1">', $html);
     } else {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
         return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple, 'style="max-width:360px"');
     }
 }