Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Public Member Functions | |
__construct ($elementName=null, $elementLabel=null, $options=null, $attributes=null) | |
Constructor. More... | |
addOptGroup ($text, $value, $attributes=null) | |
Adds a new OPTION to the SELECT. More... | |
addOption ($optgroup, $text, $value, $attributes=null) | |
Adds a new OPTION to an optgroup. More... | |
export_for_template (renderer_base $output) | |
Function to export the renderer data in a format that is suitable for a mustache template. More... | |
exportValue (&$submitValues, $assoc=false) | |
We check the options and return only the values that could have been selected. More... | |
getElementTemplateType () | |
Slightly different container template when frozen. More... | |
getFrozenHtml () | |
Returns the value of field without HTML tags. More... | |
getHelpButton () | |
get html for help button More... | |
getMultiple () | |
Returns the select mutiple attribute. More... | |
getName () | |
Returns the element name. More... | |
getPrivateName () | |
Returns the element name (possibly with brackets appended) More... | |
getSelected () | |
Returns an array of the selected values. More... | |
getSize () | |
Returns the select field size. More... | |
getValue () | |
Returns an array of the selected values. More... | |
loadArrayOptGroups ($arr, $values=null) | |
Loads the options from an associative array. More... | |
loadArrayOptions ($optgroup, $arr, $values=null) | |
Loads the options from an associative array. More... | |
MoodleQuickForm_questioncategory ($elementName=null, $elementLabel=null, $options=null, $attributes=null) | |
Old syntax of class constructor. More... | |
MoodleQuickForm_selectgroups ($elementName=null, $elementLabel=null, $optgrps=null, $attributes=null, $showchoose=false) | |
Old syntax of class constructor. More... | |
onQuickFormEvent ($event, $arg, &$caller) | |
Called by HTML_QuickForm whenever form event is made on this element. More... | |
setHiddenLabel ($hiddenLabel) | |
Sets label to be hidden. More... | |
setMultiple ($multiple) | |
Sets the select mutiple attribute. More... | |
setName ($name) | |
Sets the input field name. More... | |
setSelected ($values) | |
Sets the default values of the select box. More... | |
setSize ($size) | |
Sets the select field size, only applies to 'multiple' selects. More... | |
setValue ($value) | |
Sets the value of the form element. More... | |
toHtml () | |
Returns the SELECT in HTML. More... | |
Public Attributes | |
string | $_helpbutton ='' |
html for help button, if empty then no help | |
bool | $_hiddenLabel =false |
if true label will be hidden | |
array | $_optGroups = array() |
Contains the select optgroups. | |
array | $_options = array('top'=>false, 'currentcat'=>0, 'nochildrenof' => -1) |
default options for question categories | |
string | $_values = null |
Default values of the SELECT. | |
bool | $showchoose = false |
add choose option | |
MoodleQuickForm_questioncategory::__construct | ( | $elementName = null , |
|
$elementLabel = null , |
|||
$options = null , |
|||
$attributes = null |
|||
) |
Constructor.
string | $elementName | Select name attribute |
mixed | $elementLabel | Label(s) for the select |
array | $options | additional options. Recognised options are courseid, published and only_editable, corresponding to the arguments of question_category_options from moodlelib.php. |
mixed | $attributes | Either a typical HTML attribute string or an associative array |
|
inherited |
Adds a new OPTION to the SELECT.
string | $text | Display text for the OPTION |
string | $value | Value for the OPTION |
mixed | $attributes | Either a typical HTML attribute string or an associative array |
|
inherited |
Adds a new OPTION to an optgroup.
string | $optgroup | name of the option group |
string | $text | Display text for the OPTION |
string | $value | Value for the OPTION |
mixed | $attributes | Either a typical HTML attribute string or an associative array |
|
inherited |
Function to export the renderer data in a format that is suitable for a mustache template.
This means:
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
stdClass|array |
Implements templatable.
|
inherited |
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"
array | $submitValues | submitted values |
bool | $assoc | if true the retured value is associated array |
mixed |
|
inherited |
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.
string |
|
inherited |
Returns the value of field without HTML tags.
string |
|
inherited |
get html for help button
string | html for help button |
|
inherited |
Returns the select mutiple attribute.
bool | true if multiple select, false otherwise |
|
inherited |
Returns the element name.
string |
|
inherited |
Returns the element name (possibly with brackets appended)
string |
|
inherited |
Returns an array of the selected values.
array | of selected values |
|
inherited |
Returns the select field size.
int |
|
inherited |
Returns an array of the selected values.
array | of selected values |
|
inherited |
Loads the options from an associative array.
array | $arr | Associative array of options |
mixed | $values | (optional) Array or comma delimited string of selected values |
PEAR_Error|bool | on error or true |
PEAR_Error |
|
inherited |
Loads the options from an associative array.
string | $optgroup | name of the options group |
array | $arr | Associative array of options |
mixed | $values | (optional) Array or comma delimited string of selected values |
PEAR_Error|bool | on error or true |
PEAR_Error |
MoodleQuickForm_questioncategory::MoodleQuickForm_questioncategory | ( | $elementName = null , |
|
$elementLabel = null , |
|||
$options = null , |
|||
$attributes = null |
|||
) |
|
inherited |
|
inherited |
Called by HTML_QuickForm whenever form event is made on this element.
string | $event | Name of event |
mixed | $arg | event arguments |
object | $caller | calling object |
bool |
|
inherited |
Sets label to be hidden.
bool | $hiddenLabel | sets if label should be hidden |
|
inherited |
Sets the select mutiple attribute.
bool | $multiple | Whether the select supports multi-selections |
|
inherited |
Sets the input field name.
string | $name | Input field name attribute |
|
inherited |
Sets the default values of the select box.
mixed | $values | Array or comma delimited string of selected values |
|
inherited |
Sets the select field size, only applies to 'multiple' selects.
int | $size | Size of select field |
|
inherited |
Sets the value of the form element.
mixed | $value | Array or comma delimited string of selected values |
|
inherited |
Returns the SELECT in HTML.
string |