Пример #1
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     $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);
 }
Пример #2
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple', 0);
     NNFrameworkFunctions::loadLanguage('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);
 }
Пример #3
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);
 }
Пример #4
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);
 }
Пример #5
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 __DIR__ . '/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);
     }
 }
Пример #6
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 = array_merge($options, $this->getTags());
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return NNHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1);
 }