Moodle  2.2.1
http://www.collinsharper.com
SimpleForm Class Reference

Public Member Functions

 SimpleForm ($tag, &$page)
 _setEncodingClass ($tag)
 setDefaultTarget ($frame)
 getMethod ()
 _createAction ($action, &$page)
 getAction ()
 _encode ()
 getId ()
 addWidget (&$tag)
 _setWidget (&$tag)
 _addRadioButton (&$tag)
 _addCheckbox (&$tag)
 getValue ($selector)
 setField ($selector, $value, $position=false)
 attachLabelBySelector ($selector, $label)
 hasSubmit ($selector)
 hasImage ($selector)
 submitButton ($selector, $additional=false)
 submitImage ($selector, $x, $y, $additional=false)
 submit ()

Data Fields

 $_method
 $_action
 $_encoding
 $_default_target
 $_id
 $_buttons
 $_images
 $_widgets
 $_radios
 $_checkboxes

Detailed Description

Definition at line 22 of file form.php.


Member Function Documentation

_addCheckbox ( &$  tag)

Adds a checkbox, making it a group on a repeated name.

Parameters:
SimpleCheckboxTag$tagIncoming form control. private

Definition at line 186 of file form.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_addRadioButton ( &$  tag)

Adds a radio button, building a group if necessary.

Parameters:
SimpleRadioButtonTag$tagIncoming form control. private

Definition at line 173 of file form.php.

Here is the caller graph for this function:

_createAction ( action,
&$  page 
)

Combined action attribute with current location to get an absolute form target.

Parameters:
string$actionAction attribute from form tag.
SimpleUrl$basePage location.
Returns:
SimpleUrl Absolute form target.

Definition at line 93 of file form.php.

Here is the caller graph for this function:

_encode ( )

Creates the encoding for the current values in the form.

Returns:
SimpleFormEncoding Request to submit. private

Definition at line 119 of file form.php.

Here is the caller graph for this function:

_setEncodingClass ( tag)

Creates the request packet to be sent by the form.

Parameters:
SimpleTag$tagForm tag to read.
Returns:
string Packet class. private

Definition at line 58 of file form.php.

Here is the caller graph for this function:

_setWidget ( &$  tag)

Sets the widget into the form, grouping radio buttons if any.

Parameters:
SimpleWidget$tagIncoming form control. private

Definition at line 158 of file form.php.

Here is the call graph for this function:

Here is the caller graph for this function:

addWidget ( &$  tag)

Adds a tag contents to the form.

Parameters:
SimpleWidget$tagInput tag to add. public

Definition at line 142 of file form.php.

Here is the call graph for this function:

attachLabelBySelector ( selector,
label 
)

Used by the page object to set widgets labels to external label tags.

Parameters:
SimpleSelector$selectorCriteria to apply. public

Definition at line 253 of file form.php.

getAction ( )

Absolute URL of the target.

Returns:
SimpleUrl URL target. public

Definition at line 105 of file form.php.

getId ( )

ID field of form for unique identification.

Returns:
string Unique tag ID. public

Definition at line 133 of file form.php.

getMethod ( )

Accessor for method of form submission.

Returns:
string Either get or post. public

Definition at line 82 of file form.php.

getValue ( selector)

Extracts current value from form.

Parameters:
SimpleSelector$selectorCriteria to apply.
Returns:
string/array Value(s) as string or null if not set. public

Definition at line 208 of file form.php.

hasImage ( selector)

Test to see if a form has an image control.

Parameters:
SimpleSelector$selectorCriteria to apply.
Returns:
boolean True if present. public

Definition at line 285 of file form.php.

hasSubmit ( selector)

Test to see if a form has a submit button.

Parameters:
SimpleSelector$selectorCriteria to apply.
Returns:
boolean True if present. public

Definition at line 270 of file form.php.

setDefaultTarget ( frame)

Sets the frame target within a frameset.

Parameters:
string$frameName of frame. public

Definition at line 73 of file form.php.

setField ( selector,
value,
position = false 
)

Sets a widget value within the form.

Parameters:
SimpleSelector$selectorCriteria to apply.
string$valueValue to input into the widget.
Returns:
boolean True if value is legal, false otherwise. If the field is not present, nothing will be set. public

Definition at line 231 of file form.php.

SimpleForm ( tag,
&$  page 
)

Starts with no held controls/widgets.

Parameters:
SimpleTag$tagForm tag to read.
SimplePage$pageHolding page.

Definition at line 39 of file form.php.

Here is the call graph for this function:

submit ( )

Simply submits the form without the submit button value. Used when there is only one button or it is unimportant.

Returns:
hash Submitted values. public

Definition at line 351 of file form.php.

Here is the call graph for this function:

submitButton ( selector,
additional = false 
)

Gets the submit values for a selected button.

Parameters:
SimpleSelector$selectorCriteria to apply.
hash$additionalAdditional data for the form.
Returns:
SimpleEncoding Submitted values or false if there is no such button in the form. public

Definition at line 303 of file form.php.

Here is the call graph for this function:

submitImage ( selector,
x,
y,
additional = false 
)

Gets the submit values for an image.

Parameters:
SimpleSelector$selectorCriteria to apply.
integer$xX-coordinate of click.
integer$yY-coordinate of click.
hash$additionalAdditional data for the form.
Returns:
SimpleEncoding Submitted values or false if there is no such button in the form. public

Definition at line 329 of file form.php.

Here is the call graph for this function:


Field Documentation

$_action

Definition at line 24 of file form.php.

$_buttons

Definition at line 28 of file form.php.

$_checkboxes

Definition at line 32 of file form.php.

$_default_target

Definition at line 26 of file form.php.

$_encoding

Definition at line 25 of file form.php.

$_id

Definition at line 27 of file form.php.

$_images

Definition at line 29 of file form.php.

$_method

Definition at line 23 of file form.php.

$_radios

Definition at line 31 of file form.php.

$_widgets

Definition at line 30 of file form.php.


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