/** * pubstatesControl. * * @param string $selected The key that is selected * @param string $name The name for the field * @param string $label Param * @param string $desc Param * @param array $attribs Additional HTML attributes for the <select> tag * @param string $idTag Param * * @return string HTML */ public static function pubstatesControl($selected = null, $name = 'type', $label = null, $desc = null, $attribs = array(), $idTag = null) { if (!$idTag) { $idTag = EHtml::generateIdTag(); } $control = self::pubstates($selected, $name, $attribs, $idTag); return EHtml::genericControl(JText::_($label), JText::_($desc), $name, $control); }
/** * customGenericList. * * @param string $name The name for the field * @param array $attribs Additional HTML attributes for the <select> tag* * @param string $selected The key that is selected * @param string $idTag The name for the field * * @return string HTML */ public static function userGroupList($name, $attribs, $selected, $idTag = null) { if (!$idTag) { $idTag = EHtml::generateIdTag(); } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('a.id, a.title'); $query->from('#__usergroups AS a'); $query->group('a.id, a.title'); $query->order('a.id ASC'); $query->order($query->qn('title') . ' ASC'); // Get the options. $db->setQuery($query); $items = $db->loadObjectList(); $options = array(); $options[] = JHTML::_('select.option', null, '-' . JText::_('JSELECT') . '-'); if (count($items)) { foreach ($items as $item) { $options[] = JHTML::_('select.option', $item->id, $item->title); } } return self::customGenericList($options, $name, $attribs, $selected, $idTag); }