|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| MoodleQuickForm_selectgroups ($elementName=null, $elementLabel=null, $optgrps=null, $attributes=null, $showchoose=false) | |
| setSelected ($values) | |
| getSelected () | |
| setName ($name) | |
| getName () | |
| getPrivateName () | |
| setValue ($value) | |
| getValue () | |
| setSize ($size) | |
| getSize () | |
| setMultiple ($multiple) | |
| getMultiple () | |
| loadArrayOptGroups ($arr, $values=null) | |
| addOptGroup ($text, $value, $attributes=null) | |
| loadArrayOptions ($optgroup, $arr, $values=null) | |
| addOption ($optgroup, $text, $value, $attributes=null) | |
| toHtml () | |
| getFrozenHtml () | |
| exportValue (&$submitValues, $assoc=false) | |
| onQuickFormEvent ($event, $arg, &$caller) | |
| setHiddenLabel ($hiddenLabel) | |
| setHelpButton ($helpbuttonargs, $function='helpbutton') | |
| getHelpButton () | |
| getElementTemplateType () | |
Data Fields | |
| $showchoose = false | |
| $_optGroups = array() | |
| $_values = null | |
| $_helpbutton = '' | |
| $_hiddenLabel = false | |
Class to dynamically create an HTML SELECT with all options grouped in optgroups
Definition at line 31 of file selectgroups.php.
| addOptGroup | ( | $ | text, |
| $ | value, | ||
| $ | attributes = null |
||
| ) |
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 |
Definition at line 310 of file selectgroups.php.


| addOption | ( | $ | optgroup, |
| $ | text, | ||
| $ | value, | ||
| $ | attributes = null |
||
| ) |
Adds a new OPTION to an optgroup
| 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 |
Definition at line 359 of file selectgroups.php.


| 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"
Reimplemented from HTML_QuickForm_element.
Definition at line 488 of file selectgroups.php.

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.
Definition at line 578 of file selectgroups.php.
| getFrozenHtml | ( | ) |
Returns the value of field without HTML tags
Reimplemented from HTML_QuickForm_element.
Definition at line 445 of file selectgroups.php.


| getHelpButton | ( | ) |
get html for help button
public
Definition at line 567 of file selectgroups.php.
| getMultiple | ( | ) |
Returns the select mutiple attribute
Definition at line 270 of file selectgroups.php.


| getName | ( | ) |
Returns the element name
Reimplemented from HTML_QuickForm_element.
Definition at line 154 of file selectgroups.php.


| getPrivateName | ( | ) |
Returns the element name (possibly with brackets appended)
Definition at line 169 of file selectgroups.php.


| getSelected | ( | ) |
Returns an array of the selected values
Definition at line 123 of file selectgroups.php.
| getSize | ( | ) |
Returns the select field size
Definition at line 235 of file selectgroups.php.

| getValue | ( | ) |
Returns an array of the selected values
Reimplemented from HTML_QuickForm_element.
Definition at line 204 of file selectgroups.php.

| loadArrayOptGroups | ( | $ | arr, |
| $ | values = null |
||
| ) |
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 |
Definition at line 285 of file selectgroups.php.


| loadArrayOptions | ( | $ | optgroup, |
| $ | arr, | ||
| $ | values = null |
||
| ) |
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 |
Definition at line 333 of file selectgroups.php.


| MoodleQuickForm_selectgroups | ( | $ | elementName = null, |
| $ | elementLabel = null, |
||
| $ | optgrps = null, |
||
| $ | attributes = null, |
||
| $ | showchoose = false |
||
| ) |
Class constructor
| string | Select name attribute |
| mixed | Label(s) for the select |
| mixed | Data to be used to populate options |
| mixed | An array whose keys are labels for optgroups and whose values are arrays similar to those passed to the select element with keys that are values for options and values are strings for display. |
| mixed | Either a typical HTML attribute string or an associative array |
| bool | add standard moodle "Choose..." option as first item |
Definition at line 78 of file selectgroups.php.


| onQuickFormEvent | ( | $ | event, |
| $ | arg, | ||
| &$ | caller | ||
| ) |
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 |
Reimplemented from HTML_QuickForm_element.
Definition at line 528 of file selectgroups.php.

| setHelpButton | ( | $ | helpbuttonargs, |
| $ | function = 'helpbutton' |
||
| ) |
set html for help button
public
| array | $help | array of arguments to make a help button |
| string | $function | function name to call to get html |
Definition at line 558 of file selectgroups.php.

| setHiddenLabel | ( | $ | hiddenLabel | ) |
Definition at line 548 of file selectgroups.php.
| setMultiple | ( | $ | multiple | ) |
Sets the select mutiple attribute
| bool | $multiple | Whether the select supports multi-selections |
Definition at line 251 of file selectgroups.php.

| setName | ( | $ | name | ) |
Sets the input field name
| string | $name | Input field name attribute |
Reimplemented from HTML_QuickForm_element.
Definition at line 139 of file selectgroups.php.


| setSelected | ( | $ | values | ) |
Sets the default values of the select box
| mixed | $values | Array or comma delimited string of selected values |
Definition at line 101 of file selectgroups.php.


| setSize | ( | $ | size | ) |
Sets the select field size, only applies to 'multiple' selects
| int | $size | Size of select field |
Definition at line 220 of file selectgroups.php.

| setValue | ( | $ | value | ) |
Sets the value of the form element
| mixed | $values | Array or comma delimited string of selected values |
Reimplemented from HTML_QuickForm_element.
Definition at line 189 of file selectgroups.php.


| toHtml | ( | ) |
Returns the SELECT in HTML
Reimplemented from HTML_Common.
Definition at line 386 of file selectgroups.php.

| $_helpbutton = '' |
Definition at line 61 of file selectgroups.php.
| $_hiddenLabel = false |
Definition at line 62 of file selectgroups.php.
| $_optGroups = array() |
Definition at line 45 of file selectgroups.php.
| $_values = null |
Definition at line 54 of file selectgroups.php.
| $showchoose = false |
add choose option
Definition at line 36 of file selectgroups.php.