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


Public Member Functions | |
| HTML_QuickForm_hierselect ($elementName=null, $elementLabel=null, $attributes=null, $separator=null) | |
| setOptions ($options) | |
| setMainOptions ($array) | |
| setSecOptions ($array) | |
| _setOptions () | |
| setValue ($value) | |
| _createElements () | |
| toHtml () | |
| accept (&$renderer, $required=false, $error=null) | |
| onQuickFormEvent ($event, $arg, &$caller) | |
| _convertArrayToJavascript ($array, $assoc=true) | |
| _convertScalarToJavascript ($val) | |
| _escapeString ($str) | |
Data Fields | |
| $_options = array() | |
| $_nbElements = 0 | |
| $_js = '' | |
Class to dynamically create two or more HTML Select elements The first select changes the content of the second select and so on. This element is considered as a group. Selects will be named groupName[0], groupName[1], groupName[2]...
Definition at line 38 of file hierselect.php.
| _convertArrayToJavascript | ( | $ | array, |
| $ | assoc = true |
||
| ) |
Converts PHP array to its Javascript analog
private
| array | PHP array to convert |
| bool | Generate Javascript object literal (default, works like PHP's associative array) or array literal |
Definition at line 508 of file hierselect.php.


| _convertScalarToJavascript | ( | $ | val | ) |
Converts PHP's scalar value to its Javascript analog
private
| mixed | PHP value to convert |
Definition at line 538 of file hierselect.php.


| _createElements | ( | ) |
Creates all the elements for the group
private
Reimplemented from HTML_QuickForm_group.
Definition at line 271 of file hierselect.php.


| _escapeString | ( | $ | str | ) |
Quotes the string so that it can be used in Javascript string constants
private
| string |
Definition at line 564 of file hierselect.php.

| _setOptions | ( | ) |
Sets the options for each select element
private
Definition at line 224 of file hierselect.php.

| accept | ( | &$ | renderer, |
| $ | required = false, |
||
| $ | error = null |
||
| ) |
Accepts a renderer
| object | An HTML_QuickForm_Renderer object |
| bool | Whether a group is required |
| string | An error message associated with a group public |
Reimplemented from HTML_QuickForm_group.
Definition at line 464 of file hierselect.php.

| HTML_QuickForm_hierselect | ( | $ | elementName = null, |
| $ | elementLabel = null, |
||
| $ | attributes = null, |
||
| $ | separator = null |
||
| ) |
Class constructor
| string | $elementName | (optional)Input field name attribute |
| string | $elementLabel | (optional)Input field label in form |
| mixed | $attributes | (optional)Either a typical HTML attribute string or an associative array. Date format is passed along the attributes. |
| mixed | $separator | (optional)Use a string for one separator, use an array to alternate the separators. public |
Definition at line 117 of file hierselect.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_group.
Definition at line 472 of file hierselect.php.

| setMainOptions | ( | $ | array | ) |
Sets the options for the first select element. Deprecated. setOptions() should be used.
| array | $array | Options for the first select element |
public
Definition at line 172 of file hierselect.php.

| setOptions | ( | $ | options | ) |
Initialize the array structure containing the options for each select element. Call the functions that actually do the magic.
| array | $options | Array of options defining each element |
public
Definition at line 140 of file hierselect.php.

| setSecOptions | ( | $ | array | ) |
Sets the options for the second select element. Deprecated. setOptions() should be used. The main _options array is initialized and the _setOptions function is called.
| array | $array | Options for the second select element |
public
Definition at line 195 of file hierselect.php.

| setValue | ( | $ | value | ) |
Sets values for group's elements
| array | $value | An array of 2 or more values, for the first, the second, the third etc. select |
public
Reimplemented from HTML_QuickForm_group.
Definition at line 252 of file hierselect.php.
| toHtml | ( | ) |
Returns Html for the group
Reimplemented from HTML_QuickForm_group.
Definition at line 281 of file hierselect.php.

| $_js = '' |
Definition at line 100 of file hierselect.php.
| $_nbElements = 0 |
Definition at line 92 of file hierselect.php.
| $_options = array() |
Definition at line 84 of file hierselect.php.