protected function getInput()
 {
     JHtml::_('jquery.framework');
     RLFunctions::script('regularlabs/script.min.js');
     RLFunctions::script('regularlabs/toggler.min.js');
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     $attr = $this->get('onchange') ? ' onchange="' . $this->get('onchange') . '"' : '';
     $categories = $this->getOptions();
     $options = parent::getOptions();
     if ($this->get('show_none', 1)) {
         $options[] = JHtml::_('select.option', '', '- ' . JText::_('JNONE') . ' -', 'value', 'text');
     }
     if ($this->get('show_new', 1)) {
         $options[] = JHtml::_('select.option', '-1', '- ' . JText::_('RL_NEW_CATEGORY') . ' -', 'value', 'text', false);
     }
     $options = array_merge($options, $categories);
     if (!$this->get('show_new', 1)) {
         return JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
     }
     RLFunctions::script('regularlabs/simplecategories.min.js');
     $html = array();
     $html[] = '<div class="rl_simplecategory">';
     $html[] = '<input type="hidden" class="rl_simplecategory_value" id="' . $this->id . '" name="' . $this->name . '" value="' . $this->value . '" checked="checked">';
     $html[] = '<div class="rl_simplecategory_select">';
     $html[] = RLHtml::selectlistsimple($options, $this->getName($this->fieldname . '_select'), $this->value, $this->getId('', $this->fieldname . '_select'), $size, false);
     $html[] = '</div>';
     $html[] = '<div id="' . rand(1000000, 9999999) . '___' . $this->fieldname . '_select.-1" class="rl_toggler rl_toggler_nofx" style="display:none;">';
     $html[] = '<div class="rl_simplecategory_new">';
     $html[] = '<input type="text" id="' . $this->id . '_new" value="" placeholder="' . JText::_('RL_NEW_CATEGORY_ENTER') . '">';
     $html[] = '</div>';
     $html[] = '</div>';
     $html[] = '</div>';
     return implode('', $html);
 }
示例#2
0
 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 = RLText::prepareSelectItem($val);
                 $options[] = JHtml::_('select.option', $key, $val);
             }
         }
     }
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     require_once dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
示例#3
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 RLHtml::selectlist($options, $this->name, $value, $this->id, $size, $multiple);
 }
示例#4
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple', 0);
     RLFunctions::loadLanguage('com_menus', JPATH_ADMINISTRATOR);
     $options = $this->getMenuItems();
     require_once dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $options = $this->getComponents();
     if (empty($options)) {
         return '';
     }
     $size = (int) $this->get('size');
     require_once dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, 1);
 }
示例#6
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 dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
 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 dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1);
 }
 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 RLHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
         default:
             return RLHtml::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');
     $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 dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
示例#10
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::_('RL_IGNORE') . ' -', 'value', 'text', 0);
         $options[] = JHtml::_('select.option', '-', '&nbsp;', 'value', 'text', 1);
     }
     $options = array_merge($options, $this->getTags());
     require_once dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1);
 }
示例#11
0
 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']) {
             continue;
         }
         $option = new stdClass();
         $option->value = $lang['value'];
         $option->text = $lang['text'] . ' [' . $lang['value'] . ']';
         $options[] = $option;
     }
     require_once dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
示例#12
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $group = $this->get('group', 'os');
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $agents = array();
     switch ($group) {
         /* OS */
         case 'os':
             $agents[] = array('Windows (' . JText::_('JALL') . ')', 'Windows');
             $agents[] = array('Windows 10', 'Windows nt 10.0');
             $agents[] = array('Windows 8', 'Windows nt 6.2');
             $agents[] = array('Windows 7', 'Windows nt 6.1');
             $agents[] = array('Windows Vista', 'Windows nt 6.0');
             $agents[] = array('Windows Server 2003', 'Windows nt 5.2');
             $agents[] = array('Windows XP', 'Windows nt 5.1');
             $agents[] = array('Windows 2000 sp1', 'Windows nt 5.01');
             $agents[] = array('Windows 2000', 'Windows nt 5.0');
             $agents[] = array('Windows NT 4.0', 'Windows nt 4.0');
             $agents[] = array('Windows Me', 'Win 9x 4.9');
             $agents[] = array('Windows 98', 'Windows 98');
             $agents[] = array('Windows 95', 'Windows 95');
             $agents[] = array('Windows CE', 'Windows ce');
             $agents[] = array('Mac OS (' . JText::_('JALL') . ')', '#(Mac OS|Mac_PowerPC|Macintosh)#');
             $agents[] = array('Mac OSX (' . JText::_('JALL') . ')', 'Mac OS X');
             $agents[] = array('Mac OSX Mountain Lion', 'Mac OS X 10.8');
             $agents[] = array('Mac OSX Lion', 'Mac OS X 10.7');
             $agents[] = array('Mac OSX Snow Leopard', 'Mac OS X 10.6');
             $agents[] = array('Mac OSX Leopard', 'Mac OS X 10.5');
             $agents[] = array('Mac OSX Tiger', 'Mac OS X 10.4');
             $agents[] = array('Mac OSX Panther', 'Mac OS X 10.3');
             $agents[] = array('Mac OSX Jaguar', 'Mac OS X 10.2');
             $agents[] = array('Mac OSX Puma', 'Mac OS X 10.1');
             $agents[] = array('Mac OSX Cheetah', 'Mac OS X 10.0');
             $agents[] = array('Mac OS (classic)', '#(Mac_PowerPC|Macintosh)#');
             $agents[] = array('Linux', '#(Linux|X11)#');
             $agents[] = array('Open BSD', 'OpenBSD');
             $agents[] = array('Sun OS', 'SunOS');
             $agents[] = array('QNX', 'QNX');
             $agents[] = array('BeOS', 'BeOS');
             $agents[] = array('OS/2', 'OS/2');
             break;
             /* Browsers */
         /* Browsers */
         case 'browsers':
             $agents[] = array('Chrome (' . JText::_('JALL') . ')', 'Chrome');
             $agents[] = array('Chrome 41-50', '#Chrome/(4[1-9]|50)\\.#');
             $agents[] = array('Chrome 31-40', '#Chrome/(3[1-9]|40)\\.#');
             $agents[] = array('Chrome 21-30', '#Chrome/(2[1-9]|30)\\.#');
             $agents[] = array('Chrome 11-20', '#Chrome/(1[1-9]|20)\\.#');
             $agents[] = array('Chrome 1-10', '#Chrome/([1-9]|10)\\.#');
             $agents[] = array('Firefox (' . JText::_('JALL') . ')', 'Firefox');
             $agents[] = array('Firefox 41-50', '#Firefox/(4[1-9]|50)\\.#');
             $agents[] = array('Firefox 31-40', '#Firefox/(3[1-9]|40)\\.#');
             $agents[] = array('Firefox 21-30', '#Firefox/(2[1-9]|30)\\.#');
             $agents[] = array('Firefox 11-20', '#Firefox/(1[1-9]|20)\\.#');
             $agents[] = array('Firefox 1-10', '#Firefox/([1-9]|10)\\.#');
             $agents[] = array('Edge (' . JText::_('JALL') . ')', 'Edge');
             $agents[] = array('Edge 12', 'Edge/12');
             $agents[] = array('Internet Explorer (' . JText::_('JALL') . ')', 'MSIE');
             $agents[] = array('Internet Explorer Edge', 'MSIE Edge');
             // missing MSIE is added to agent string in assingnments/agents.php
             $agents[] = array('Internet Explorer 11', 'MSIE 11');
             // missing MSIE is added to agent string in assingnments/agents.php
             $agents[] = array('Internet Explorer 10.6', 'MSIE 10.6');
             $agents[] = array('Internet Explorer 10.0', 'MSIE 10.0');
             $agents[] = array('Internet Explorer 10', 'MSIE 10.');
             $agents[] = array('Internet Explorer 9', 'MSIE 9.');
             $agents[] = array('Internet Explorer 8', 'MSIE 8.');
             $agents[] = array('Internet Explorer 7', 'MSIE 7.');
             $agents[] = array('Internet Explorer 1-6', '#MSIE [1-6]\\.#');
             $agents[] = array('Opera (' . JText::_('JALL') . ')', 'Opera');
             $agents[] = array('Opera 31-40', '#Opera/(3[1-9]|40)\\.#');
             $agents[] = array('Opera 21-30', '#Opera/(2[1-9]|30)\\.#');
             $agents[] = array('Opera 11-20', '#Opera/(1[1-9]|20)\\.#');
             $agents[] = array('Opera 1-10', '#Opera/([1-9]|10)\\.#');
             $agents[] = array('Safari (' . JText::_('JALL') . ')', 'Safari');
             //$agents[] = array('Safari 10', '#Version/10\..*Safari/#');
             $agents[] = array('Safari 9', '#Version/9\\..*Safari/#');
             $agents[] = array('Safari 8', '#Version/8\\..*Safari/#');
             $agents[] = array('Safari 7', '#Version/7\\..*Safari/#');
             $agents[] = array('Safari 6', '#Version/6\\..*Safari/#');
             $agents[] = array('Safari 5', '#Version/5\\..*Safari/#');
             $agents[] = array('Safari 4', '#Version/4\\..*Safari/#');
             $agents[] = array('Safari 1-3', '#Version/[1-3]\\..*Safari/#');
             break;
             /* Mobile browsers */
         /* Mobile browsers */
         case 'mobile':
             $agents[] = array(JText::_('JALL'), 'mobile');
             $agents[] = array('Android', 'Android');
             $agents[] = array('Android Chrome', '#Android.*Chrome#');
             $agents[] = array('Blackberry', 'Blackberry');
             $agents[] = array('IE Mobile', 'IEMobile');
             $agents[] = array('iPad', 'iPad');
             $agents[] = array('iPhone', 'iPhone');
             $agents[] = array('iPod Touch', 'iPod');
             $agents[] = array('NetFront', 'NetFront');
             $agents[] = array('Nokia', 'NokiaBrowser');
             $agents[] = array('Opera Mini', 'Opera Mini');
             $agents[] = array('Opera Mobile', 'Opera Mobi');
             $agents[] = array('UC Browser', 'UC Browser');
             break;
     }
     $options = array();
     foreach ($agents as $agent) {
         $option = JHtml::_('select.option', $agent['1'], $agent['0']);
         $options[] = $option;
     }
     $size = (int) $this->get('size');
     require_once dirname(__DIR__) . '/helpers/html.php';
     return RLHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, 1);
 }