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

Public Member Functions

 HTML_QuickForm_element ($elementName=null, $elementLabel=null, $attributes=null)
 apiVersion ()
 getType ()
 setName ($name)
 getName ()
 setValue ($value)
 getValue ()
 freeze ()
 unfreeze ()
 getFrozenHtml ()
 _getPersistantData ()
 isFrozen ()
 setPersistantFreeze ($persistant=false)
 setLabel ($label)
 getLabel ()
 _findValue (&$values)
 onQuickFormEvent ($event, $arg, &$caller)
 accept (&$renderer, $required=false, $error=null)
 _generateId ()
 exportValue (&$submitValues, $assoc=false)
 _prepareValue ($value, $assoc)

Data Fields

 $_label = ''
 $_type = ''
 $_flagFrozen = false
 $_persistantFreeze = false

Detailed Description

Base class for form elements

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

Definition at line 34 of file element.php.


Member Function Documentation

_findValue ( &$  values)

Tries to find the element value from the values array

Since:
2.7 private
Returns:
mixed

Definition at line 329 of file element.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Automatically generates and assigns an 'id' attribute for the element.

Currently used to ensure that labels work on radio buttons and checkboxes. Per idea of Alexander Radivanovich.

private

Returns:
void

Reimplemented in HTML_QuickForm_radio.

Definition at line 418 of file element.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Used by getFrozenHtml() to pass the element's value if _persistantFreeze is on

private

Returns:
string

Definition at line 242 of file element.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_prepareValue ( value,
assoc 
)

Used by exportValue() to prepare the value for returning

Parameters:
mixedthe value found in exportValue()
boolwhether to return the value as associative array private
Returns:
mixed

Definition at line 460 of file element.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 an element is required
stringAn error message associated with an element public
Returns:
void

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

Definition at line 401 of file element.php.

Returns the current API version

Since:
1.0 public
Returns:
float

Reimplemented from HTML_Common.

Reimplemented in HTML_QuickForm_select.

Definition at line 104 of file element.php.

exportValue ( &$  submitValues,
assoc = false 
)

Returns a 'safe' element's value

Parameters:
arrayarray of submitted values to search
boolwhether to return the value as associative array public
Returns:
mixed

Reimplemented in HTML_QuickForm_select, MoodleQuickForm_selectgroups, HTML_QuickForm_group, MoodleQuickForm_rubriceditor, HTML_QuickForm_advcheckbox, HTML_QuickForm_checkbox, HTML_QuickForm_radio, MoodleQuickForm_date_time_selector, MoodleQuickForm_tags, MoodleQuickForm_date_selector, HTML_QuickForm_input, HTML_QuickForm_static, MoodleQuickForm_selectwithlink, HTML_QuickForm_xbutton, MoodleQuickForm_filepicker, MoodleQuickForm_select, and HTML_QuickForm_submit.

Definition at line 440 of file element.php.

Here is the call graph for this function:

getLabel ( )

Returns display text for the element

Since:
1.3 public
Returns:
string

Definition at line 314 of file element.php.

Here is the caller graph for this function:

getType ( )

Returns element type

Since:
1.0 public
Returns:
string

Definition at line 119 of file element.php.

Here is the caller graph for this function:

HTML_QuickForm_element ( elementName = null,
elementLabel = null,
attributes = null 
)

Class constructor

Parameters:
stringName of the element
mixedLabel(s) for the element
mixedAssociative array of tag attributes or HTML attributes name="value" pairs
Since:
1.0 public
Returns:
void

Definition at line 83 of file element.php.

Here is the call graph for this function:

Here is the caller graph for this function:

isFrozen ( )

Returns whether or not the element is frozen

Since:
1.3 public
Returns:
bool

Definition at line 266 of file element.php.

Here is the caller graph for this function:

setLabel ( label)

Sets display text for the element

Parameters:
string$labelDisplay text for the element
Since:
1.3 public
Returns:
void

Definition at line 299 of file element.php.

Here is the caller graph for this function:

setName ( name)

Sets the input field name

Parameters:
string$nameInput field name attribute
Since:
1.0 public
Returns:
void

Reimplemented in HTML_QuickForm_select, MoodleQuickForm_selectgroups, HTML_QuickForm_group, HTML_QuickForm_input, HTML_QuickForm_link, HTML_QuickForm_textarea, HTML_QuickForm_xbutton, HTML_QuickForm_static, MoodleQuickForm_wikifiletable, MoodleQuickForm_filemanager, and MoodleQuickForm_editor.

Definition at line 135 of file element.php.

Here is the caller graph for this function:

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 in HTML_QuickForm_group.

Definition at line 283 of file element.php.

Here is the caller graph for this function:

setValue ( value)
unfreeze ( )

Unfreezes the element so that it becomes editable

public

Returns:
void
Since:
3.2.4

Reimplemented in HTML_QuickForm_group.

Definition at line 211 of file element.php.


Field Documentation

$_flagFrozen = false

Definition at line 60 of file element.php.

$_label = ''

Definition at line 44 of file element.php.

$_persistantFreeze = false

Definition at line 68 of file element.php.

$_type = ''

Reimplemented in MoodleQuickForm_editor, and MoodleQuickForm_htmleditor.

Definition at line 52 of file element.php.


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