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

Public Member Functions

 HTML_QuickForm_group ($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName=true)
 setName ($name)
 getName ()
 setValue ($value)
 getValue ()
 setElements ($elements)
getElements ()
 getGroupType ()
 toHtml ()
 getElementName ($index)
 getFrozenHtml ()
 onQuickFormEvent ($event, $arg, &$caller)
 accept (&$renderer, $required=false, $error=null)
 exportValue (&$submitValues, $assoc=false)
 _createElements ()
 _createElementsIfNotExist ()
 freeze ()
 unfreeze ()
 setPersistantFreeze ($persistant=false)

Data Fields

 $_name = ''
 $_elements = array()
 $_separator = null
 $_required = array()
 $_appendName = true

Detailed Description

HTML class for a form element group

Author:
Adam Daniel <adaniel1@eesus.jnj.com>
Bertrand Mansion <bmansion@mamasam.com>
Version:
1.0
Since:
PHP4.04pl1 public

Definition at line 33 of file group.php.


Member Function Documentation

Creates the group's elements.

This should be overriden by child classes that need to create their elements. The method will be called automatically when needed, calling it from the constructor is discouraged as the constructor is usually called _twice_ on element creation, first time with _no_ parameters.

private

Reimplemented in HTML_QuickForm_date, HTML_QuickForm_hierselect, MoodleQuickForm_duration, MoodleQuickForm_tags, MoodleQuickForm_date_time_selector, and MoodleQuickForm_date_selector.

Definition at line 517 of file group.php.

Here is the caller graph for this function:

A wrapper around _createElements()

This method calls _createElements() if the group's _elements array is empty. It also performs some updates, e.g. freezes the created elements if the group is already frozen.

private

Definition at line 534 of file group.php.

Here is the call graph for this function:

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

Reimplemented in HTML_QuickForm_date, HTML_QuickForm_hierselect, MoodleQuickForm_tags, MoodleQuickForm_date_time_selector, and MoodleQuickForm_date_selector.

Definition at line 425 of file group.php.

Here is the call graph for this function:

Here is the caller graph for this function:

exportValue ( &$  submitValues,
assoc = false 
)

As usual, to get the group's value we access its elements and call their exportValue() methods

Reimplemented from HTML_QuickForm_element.

Reimplemented in MoodleQuickForm_date_time_selector, MoodleQuickForm_tags, and MoodleQuickForm_date_selector.

Definition at line 461 of file group.php.

Here is the call graph for this function:

freeze ( )

Freeze the element so that only its value is returned

public

Returns:
void

Reimplemented from HTML_QuickForm_element.

Definition at line 547 of file group.php.

Here is the caller graph for this function:

getElementName ( index)

Returns the element name inside the group such as found in the html form

Parameters:
mixed$indexElement name or element index in the group
Since:
3.0 public
Returns:
mixed string with element name, false if not found

Definition at line 310 of file group.php.

Here is the call graph for this function:

& getElements ( )

Gets the grouped elements

Since:
2.4 public
Returns:
array

Definition at line 249 of file group.php.

Here is the call graph for this function:

Returns the value of field without HTML tags

Since:
1.3 public
Returns:
string

Reimplemented from HTML_QuickForm_element.

Definition at line 353 of file group.php.

Here is the call graph for this function:

Gets the group type based on its elements Will return 'mixed' if elements contained in the group are of different types.

public

Returns:
string group elements type

Definition at line 266 of file group.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getName ( )

Returns the group name

Since:
1.0 public
Returns:
string

Reimplemented from HTML_QuickForm_element.

Definition at line 136 of file group.php.

Here is the caller graph for this function:

getValue ( )

Returns the value of the group

Since:
1.0 public
Returns:
mixed

Reimplemented from HTML_QuickForm_element.

Definition at line 186 of file group.php.

Here is the caller graph for this function:

HTML_QuickForm_group ( elementName = null,
elementLabel = null,
elements = null,
separator = null,
appendName = true 
)

Class constructor

Parameters:
string$elementName(optional)Group name
array$elementLabel(optional)Group label
array$elements(optional)Group elements
mixed$separator(optional)Use a string for one separator, use an array to alternate the separators.
bool$appendName(optional)whether to change elements' names to the form $groupName[$elementName] or leave them as is.
Since:
1.0 public
Returns:
void

Definition at line 95 of file group.php.

Here is the call graph for this function:

Here is the caller 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_element.

Reimplemented in HTML_QuickForm_date, HTML_QuickForm_hierselect, MoodleQuickForm_tags, MoodleQuickForm_date_time_selector, and MoodleQuickForm_date_selector.

Definition at line 384 of file group.php.

Here is the call graph for this function:

setElements ( elements)

Sets the grouped elements

Parameters:
array$elementsArray of elements
Since:
1.1 public
Returns:
void

Reimplemented in MoodleQuickForm_group.

Definition at line 231 of file group.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setName ( name)

Sets the group name

Parameters:
string$nameGroup name
Since:
1.0 public
Returns:
void

Reimplemented from HTML_QuickForm_element.

Definition at line 121 of file group.php.

setPersistantFreeze ( persistant = false)

Sets wether an element value should be kept in an hidden field when the element is frozen or not

Parameters:
bool$persistantTrue if persistant value
Since:
2.0 public
Returns:
void

Reimplemented from HTML_QuickForm_element.

Definition at line 569 of file group.php.

setValue ( value)

Sets values for group's elements

Parameters:
mixedValues for group's elements
Since:
1.0 public
Returns:
void

Reimplemented from HTML_QuickForm_element.

Reimplemented in HTML_QuickForm_date, and HTML_QuickForm_hierselect.

Definition at line 152 of file group.php.

Here is the call graph for this function:

Here is the caller graph for this function:

toHtml ( )

Returns Html for the group

Since:
1.0 public
Returns:
string

Reimplemented from HTML_Common.

Reimplemented in HTML_QuickForm_date, HTML_QuickForm_hierselect, MoodleQuickForm_tags, MoodleQuickForm_date_time_selector, MoodleQuickForm_date_selector, and MoodleQuickForm_duration.

Definition at line 290 of file group.php.

Here is the call graph for this function:

Here is the caller graph for this function:

unfreeze ( )

Unfreezes the element so that it becomes editable

public

Returns:
void
Since:
3.2.4

Reimplemented from HTML_QuickForm_element.

Definition at line 558 of file group.php.


Field Documentation

$_appendName = true

Definition at line 75 of file group.php.

$_elements = array()

Definition at line 51 of file group.php.

$_name = ''

Definition at line 43 of file group.php.

$_required = array()

Definition at line 67 of file group.php.

$_separator = null

Definition at line 59 of file group.php.


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