API16:JHtmlAccess/actions
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Returns a UL list of user groups with check boxes
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
static actions($name, $selected, $component, $section= 'global')
| Parameter Name | Default Value | Description |
|---|---|---|
| $name | $name The name of the checkbox controls array | |
| $selected | $selected An array of the checked boxes | |
| $component | ||
| $section | 'global' |
Returns
string
Defined in
libraries/joomla/html/html/access.php
Importing
jimport( 'joomla.html.html.access' );
Source Body
public static function actions($name, $selected, $component, $section = 'global') { static $count; $count++; $actions = JAccess::getActions($component, $section); $html = array(); $html[] = '<ul class="checklist access-actions">'; for ($i=0, $n=count($actions); $i < $n; $i++) { $item = &$actions[$i]; // Setup the variable attributes. $eid = $count.'action_'.$item->id; $checked = in_array($item->id, $selected) ? ' checked="checked"' : ''; // Build the HTML for the item. $html[] = ' <li>'; $html[] = ' <input type="checkbox" name="'.$name.'[]" value="'.$item->id.'" id="'.$eid.'"'; $html[] = ' '.$checked.' />'; $html[] = ' <label for="'.$eid.'">'; $html[] = ' '.JText::_($item->title); $html[] = ' </label>'; $html[] = ' </li>'; } $html[] = '</ul>'; return implode("\n", $html); }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
