Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
The listing element is a simple customizable "select" without the input type=select. More...
Public Member Functions | |
__construct ($elementName=null, $elementLabel=null, $attributes=null, $options=array()) | |
Constructor. More... | |
MoodleQuickForm_listing ($elementName=null, $elementLabel=null, $attributes=null, $options=array()) | |
Old syntax of class constructor. More... | |
toHtml () | |
Returns HTML for listing form element. More... | |
Protected Attributes | |
string | $hideall |
language string for Hide. | |
array | $items = array() |
items to display. | |
string | $showall |
language string for Show All. | |
The listing element is a simple customizable "select" without the input type=select.
One main div contains the "large" html of an item. A show/hide div shows a hidden div containing the list of all items. This list is composed by the "small" html of each item.
How to use it: The options parameter is an array containing:
WARNINGS: The form lets you display HTML. So it is subject to CROSS-SCRIPTING if you send it uncleaned HTML. Don't forget to escape your HTML as soon as one string comes from an input/external source.
How to customize it: You can change the css in core.css. For example if you remove float:left; from .formlistingrow, then the item list is not display as tabs but as rows.
MoodleQuickForm_listing::__construct | ( | $elementName = null , |
|
$elementLabel = null , |
|||
$attributes = null , |
|||
$options = array() |
|||
) |
Constructor.
string | $elementName | (optional) name of the listing. |
string | $elementLabel | (optional) listing label. |
array | $attributes | (optional) Either a typical HTML attribute string or an associative array. |
array | $options | set of options to initalize listing. |
MoodleQuickForm_listing::MoodleQuickForm_listing | ( | $elementName = null , |
|
$elementLabel = null , |
|||
$attributes = null , |
|||
$options = array() |
|||
) |
MoodleQuickForm_listing::toHtml | ( | ) |
Returns HTML for listing form element.
string | the HTML. |