/** * Tests the JHtmlUser::userlist method. * * @return void * * @since 11.4 */ public function testUserlist() { $this->assertThat( JHtmlUser::userlist(), $this->arrayHasKey('2'), 'Line:' . __LINE__ . ' The userlist method should an array with four keys; key 2 is "Super User".' ); }
public function getInput() { if (version_compare(JVERSION, '3.0', 'lt')) { require_once JPATH_LIBRARIES . '/joomla/html/html/user.php'; } $groupList = JHtmlUser::groups(); //generate country filter list $group_options = array(); $group_options[] = JHTML::_('select.option', '*', JText::_('JALL')); foreach ($groupList as $row) { $group_options[] = JHTML::_('select.option', $row->value, JText::_($row->text)); } return JHTML::_('select.genericlist', $group_options, $this->name, 'onchange=', 'value', 'text', $this->value); }
/** * Method to setproductprice layout tmpl */ function setproductprice() { //get variant id $variant_id = $this->input->getInt('variant_id', 0); $prices = array(); $groups = array(); $model = F0FModel::getTmpInstance('ProductPrices', 'J2StoreModel'); if ($variant_id) { $model->setState('variant_id', $variant_id); $prices = $model->getList(); $groups = JHtmlUser::groups(); } $view = $this->getThisView(); $view->setModel($model, true); $view->addTemplatePath(JPATH_ADMINISTRATOR . '/components/com_j2store/views/product/tmpl/'); $view->setLayout('productpricing'); $view->set('variant_id', $variant_id); $view->set('groups', $groups); $view->set('prices', $prices); $view->display(); }
* @copyright Copyright (C) YOOtheme GmbH * @license http://www.gnu.org/licenses/gpl.html GNU/GPL */ // init vars $control_name = $control_name == 'null' ? $name : $control_name . "[{$name}]"; $attr = ''; $attr .= (string) $node->attributes()->class ? 'class="' . $node->attributes()->class . '"' : 'class="inputbox"'; $attr .= (string) $node->attributes()->disabled == 'true' ? ' disabled="disabled"' : ''; $attr .= (string) $node->attributes()->size ? ' size="' . (int) $node->attributes()->size . '"' : ''; $attr .= (bool) $node->attributes()->multiple ? ' multiple="multiple"' : ''; $attr .= (int) $node->attributes()->rows ? ' rows="' . (int) $node->attributes()->rows . '"' : ''; $attr .= (bool) $node->attributes()->multiple ? 'name="' . $control_name . '[]"' : 'name="' . $conrol_name . '"'; // Initialize JavaScript field attributes. $attr .= (string) $node->attributes()->onchange ? ' onchange="' . (string) $node->attributes()->onchange . '"' : ''; //echo $this->app->html->_('usergrouplist', array(), $control_name.'['.$name.']', $attr, 'value', 'text', $value, $control_name.$name); $options = JHtmlUser::groups(true); $exclude = array('Public', '- Guest'); //var_dump($options); if (!$parent->getValue('id')) { $value = (string) $node->attributes()->default; } if (is_string($value)) { $value = explode(',', $value); } printf('<select %s>', $attr); foreach ($options as $option) { $text = JText::_($option->text); //$text = str_replace('- ', '', JText::_($option->text)); if (in_array($text, $exclude)) { continue; }
public static function GroupList($selected = null, $id = '', $attribs = array(), $default_option = null) { $group_options[] = JHTML::_('select.option', '', JText::_('JALL')); if (version_compare(JVERSION, '3.0', 'lt')) { require_once JPATH_LIBRARIES . '/joomla/html/html/user.php'; } $groupList = JHtmlUser::groups(); foreach ($groupList as $row) { $group_options[] = JHTML::_('select.option', $row->value, JText::_($row->text)); } return self::genericlist($group_options, $id, $attribs, $selected, $id); }