|
| | __construct ( $elementname=null, $elementlabel=null, ?choicelist $options=null, $attributes=null) |
| | Constructor.
|
| |
|
| export_for_template (renderer_base $output) |
| |
| | exportValue (&$submitvalues, $assoc=false) |
| | We check the options and return only the values that could have been selected.
|
| |
| | getElementTemplateType () |
| | Slightly different container template when frozen.
|
| |
| | getHelpButton () |
| | get html for help button
|
| |
| | load (&$choice, $value=null, $unused2=null, $unused3=null, $unused4=null) |
| | Loads options from a choicelist.
|
| |
| | set_dialog_width (string $width) |
| | Set the dropdown width.
|
| |
| | setHiddenLabel ($hiddenLabel) |
| | Sets label to be hidden.
|
| |
| | toHtml () |
| | Returns HTML for select form element.
|
| |
|
|
string[] const | WIDTH = status::WIDTH |
| | Dropdown dialog width.
|
| |
|
|
string string | $_helpbutton = '' |
| | html for help button, if empty then no help.
|
| |
|
bool bool | $_hiddenLabel = false |
| | if true label will be hidden.
|
| |
|
choicelist choicelist | $choice = null |
| | the user choices.
|
| |
|
string string | $dropdownwidth = status::WIDTH['small'] |
| | the dropdown width (from core\output\local\dropdown\status\WIDTH).
|
| |
◆ __construct()
| MoodleQuickForm_choicedropdown::__construct |
( |
| $elementname = null, |
|
|
| $elementlabel = null, |
|
|
?choicelist | $options = null, |
|
|
| $attributes = null ) |
Constructor.
- Parameters
-
| string | $elementname | Select name attribute |
| mixed | $elementlabel | Label(s) for the select |
| choicelist | $options | Data to be used to populate options |
| mixed | $attributes | Either a typical HTML attribute string or an associative array |
◆ exportValue()
| MoodleQuickForm_choicedropdown::exportValue |
( |
& | $submitvalues, |
|
|
| $assoc = false ) |
We check the options and return only the values that could have been selected.
We also return a scalar value if select is not "multiple"
- Parameters
-
| string | $submitvalues | submitted values |
| bool | $assoc | if true the returned value is associated array |
- Return values
-
◆ getElementTemplateType()
| MoodleQuickForm_choicedropdown::getElementTemplateType |
( |
| ) |
|
Slightly different container template when frozen.
Don't want to use a label tag with a for attribute in that case for the element label but instead use a div. Templates are defined in renderer constructor.
- Return values
-
◆ getHelpButton()
| MoodleQuickForm_choicedropdown::getHelpButton |
( |
| ) |
|
get html for help button
- Return values
-
| string | html for help button |
◆ load()
| MoodleQuickForm_choicedropdown::load |
( |
& | $choice, |
|
|
| $value = null, |
|
|
| $unused2 = null, |
|
|
| $unused3 = null, |
|
|
| $unused4 = null ) |
Loads options from a choicelist.
- Parameters
-
| choicelist | $choice | Options source currently supports assoc array or DB_result |
| string | null | $value | optional value (in case it is not defined in the choicelist) |
| string | null | $unused2 | unused |
| string | null | $unused3 | unused |
| string | null | $unused4 | unused |
- Return values
-
◆ set_dialog_width()
| MoodleQuickForm_choicedropdown::set_dialog_width |
( |
string | $width | ) |
|
Set the dropdown width.
- Parameters
-
◆ setHiddenLabel()
| MoodleQuickForm_choicedropdown::setHiddenLabel |
( |
| $hiddenLabel | ) |
|
Sets label to be hidden.
- Parameters
-
| bool | $hiddenLabel | sets if label should be hidden |
◆ toHtml()
| MoodleQuickForm_choicedropdown::toHtml |
( |
| ) |
|
Returns HTML for select form element.
This method is only needed when forms renderer is forces via $GLOBALS['_HTML_QuickForm_default_renderer']. Otherwise the renderer will use mustache templates.
- Return values
-
The documentation for this class was generated from the following file:
- lib/form/choicedropdown.php