JHtmlAccess/assetgrouplist
From Joomla! Documentation
Contents |
Description
Displays a Select list of the available asset groups
Syntax
static JHtmlAccess::assetgrouplist($name, $selected, $attribs=null, $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $name | $name The name of the select element | |
| $selected | $selected The selected asset group id | |
| $attribs | null | $attribs Optional attributes for the select field |
| $config | array() | $config An array of options for the control |
Returns
mixed An HTML string or null if an error occurs
Defined in
libraries/joomla/html/html/access.php
Importing
jimport( 'joomla.html.html.access' );
Source Body
public static function assetgrouplist($name, $selected, $attribs = null, $config = array())
{
static $count;
$options = JHtmlAccess::assetgroups();
if (isset($config['title'])) {
array_unshift($options, JHtml::_('select.option', '', $config['title']));
}
return JHtml::_(
'select.genericlist',
$options,
$name,
array(
'id' => isset($config['id']) ? $config['id'] : 'assetgroups_'.++$count,
'list.attr' => (is_null($attribs) ? 'class="inputbox" size="3"' : $attribs),
'list.select' => (int) $selected,
'list.translate' => true
)
);
}