Moodle  2.2.1
http://www.collinsharper.com
HTML_QuickForm_hierselect Class Reference
Inheritance diagram for HTML_QuickForm_hierselect:
Collaboration diagram for HTML_QuickForm_hierselect:

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 = ''

Detailed Description

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]...

Author:
Herim Vasquez <vasquezh@iro.umontreal.ca>
Bertrand Mansion <bmansion@mamasam.com>
Version:
1.0
Since:
PHP4.04pl1 public

Definition at line 38 of file hierselect.php.


Member Function Documentation

_convertArrayToJavascript ( array,
assoc = true 
)

Converts PHP array to its Javascript analog

private

Parameters:
arrayPHP array to convert
boolGenerate Javascript object literal (default, works like PHP's associative array) or array literal
Returns:
string Javascript representation of the value

Definition at line 508 of file hierselect.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Converts PHP's scalar value to its Javascript analog

private

Parameters:
mixedPHP value to convert
Returns:
string Javascript representation of the value

Definition at line 538 of file hierselect.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Creates all the elements for the group

private

Returns:
void

Reimplemented from HTML_QuickForm_group.

Definition at line 271 of file hierselect.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_escapeString ( str)

Quotes the string so that it can be used in Javascript string constants

private

Parameters:
string
Returns:
string

Definition at line 564 of file hierselect.php.

Here is the caller graph for this function:

Sets the options for each select element

private

Returns:
void

Definition at line 224 of file hierselect.php.

Here is the caller graph for this function:

accept ( &$  renderer,
required = false,
error = null 
)

Accepts a renderer

Parameters:
objectAn HTML_QuickForm_Renderer object
boolWhether a group is required
stringAn error message associated with a group public
Returns:
void

Reimplemented from HTML_QuickForm_group.

Definition at line 464 of file hierselect.php.

Here is the caller graph for this function:

HTML_QuickForm_hierselect ( elementName = null,
elementLabel = null,
attributes = null,
separator = null 
)

Class constructor

Parameters:
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
Returns:
void

Definition at line 117 of file hierselect.php.

Here is the call graph for this function:

onQuickFormEvent ( event,
arg,
&$  caller 
)

Called by HTML_QuickForm whenever form event is made on this element

Parameters:
string$eventName of event
mixed$argevent arguments
object$callercalling object
Since:
1.0 public
Returns:
void

Reimplemented from HTML_QuickForm_group.

Definition at line 472 of file hierselect.php.

Here is the call graph for this function:

setMainOptions ( array)

Sets the options for the first select element. Deprecated. setOptions() should be used.

Parameters:
array$arrayOptions for the first select element

public

Deprecated:
Deprecated since release 3.2.2
Returns:
void

Definition at line 172 of file hierselect.php.

Here is the call graph for this function:

setOptions ( options)

Initialize the array structure containing the options for each select element. Call the functions that actually do the magic.

Parameters:
array$optionsArray of options defining each element

public

Returns:
void

Definition at line 140 of file hierselect.php.

Here is the call graph for this function:

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.

Parameters:
array$arrayOptions for the second select element

public

Deprecated:
Deprecated since release 3.2.2
Returns:
void

Definition at line 195 of file hierselect.php.

Here is the call graph for this function:

setValue ( value)

Sets values for group's elements

Parameters:
array$valueAn array of 2 or more values, for the first, the second, the third etc. select

public

Returns:
void

Reimplemented from HTML_QuickForm_group.

Definition at line 252 of file hierselect.php.

toHtml ( )

Returns Html for the group

Since:
1.0 public
Returns:
string

Reimplemented from HTML_QuickForm_group.

Definition at line 281 of file hierselect.php.

Here is the call graph for this function:


Field Documentation

$_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.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations