|
| addElement (&$formElement, $required=false) |
|
| assign (&$tpl) |
|
| display () |
|
| getAction ($encode=true) |
|
| getArrayID ($value, $key, $ret, $hashinfo= 'sha1') |
|
& | getElementByName ($name) |
|
| getElementNames () |
|
& | getElements ($recurse=false) |
|
| getElementValue ($name, $encode=false) |
|
| getElementValues ($encode=false) |
|
& | getExtra () |
|
| getMethod () |
|
| getName ($encode=true) |
|
| getObjectID ($object, $hashinfo= 'sha1') |
|
& | getRequired () |
|
| getSummary ($encode=false) |
|
| getTitle ($encode=false) |
|
| insertBreak ($extra=null) |
|
| render () |
|
| renderValidationJS ($withtags=true) |
|
| setElementValue ($name, $value) |
|
| setElementValues ($values) |
|
| setExtra ($extra) |
|
| setRequired (&$formElement) |
|
| setSummary ($summary) |
|
| XoopsForm ($title, $name, $action, $method= 'post', $addtoken=false, $summary= '') |
|
Definition at line 32 of file form.php.
XoopsForm::addElement |
( |
& |
$formElement, |
|
|
|
$required = false |
|
) |
| |
Add an element to the form
- Parameters
-
| object | $ &$formElement reference to a XoopsFormElement |
bool | $required | is this a "required" element? |
Definition at line 262 of file form.php.
References $i.
XoopsForm::assign |
( |
& |
$tpl | ) |
|
assign to smarty form template instead of displaying directly
- Parameters
-
object | $ &$tpl reference to a Smarty object |
- See Also
- Smarty
Definition at line 555 of file form.php.
References $i, $js, $tpl, and _REQUIRED.
displays rendered form
Definition at line 501 of file form.php.
XoopsForm::getAction |
( |
|
$encode = true | ) |
|
get the "action" attribute for the <form> tag
- Parameters
-
bool | $encode | To sanitizer the text? |
- Returns
- string
Definition at line 240 of file form.php.
XoopsForm::getArrayID |
( |
|
$value, |
|
|
|
$key, |
|
|
|
$ret, |
|
|
|
$hashinfo = 'sha1' |
|
) |
| |
& XoopsForm::getElementByName |
( |
|
$name | ) |
|
XoopsForm::getElementNames |
( |
| ) |
|
get an array of "name" attributes of form elements
- Returns
- array array of form element names
Definition at line 319 of file form.php.
References $i, and $ret.
& XoopsForm::getElements |
( |
|
$recurse = false | ) |
|
get an array of forms elements
- Parameters
-
bool | $ get elements recursively? |
- Returns
- array array of XoopsFormElements
Definition at line 289 of file form.php.
References $i, $j, and $ret.
XoopsForm::getElementValue |
( |
|
$name, |
|
|
|
$encode = false |
|
) |
| |
Gets the "value" attribute of a form element
- Parameters
-
string | $name | the "name" attribute of a form element |
bool | $encode | To sanitizer the text? |
- Returns
- string the "value" attribute assigned to a form element, null if not set
Definition at line 390 of file form.php.
XoopsForm::getElementValues |
( |
|
$encode = false | ) |
|
gets the "value" attribute of all form elements
- Parameters
-
bool | $encode | To sanitizer the text? |
- Returns
- array array of name/value pairs assigned to form elements
Definition at line 405 of file form.php.
References $i.
& XoopsForm::getExtra |
( |
| ) |
|
get the extra attributes for the <form> tag
- Returns
- string
Definition at line 449 of file form.php.
get the "method" attribute for the <form> tag
- Returns
- string
Definition at line 251 of file form.php.
XoopsForm::getName |
( |
|
$encode = true | ) |
|
get the "name" attribute for the <form> tag
Deprecated, to be refactored
- Parameters
-
bool | $encode | To sanitizer the text? |
- Returns
- string
Definition at line 229 of file form.php.
XoopsForm::getObjectID |
( |
|
$object, |
|
|
|
$hashinfo = 'sha1' |
|
) |
| |
*#@+ retrieves object serialisation/identification id (sha1 used)
each object has serialisation
- legal requirement of enterprise relational management (ERM)
- Deprecated:
- public
Definition at line 138 of file form.php.
References $var.
& XoopsForm::getRequired |
( |
| ) |
|
XoopsForm::getSummary |
( |
|
$encode = false | ) |
|
return the summary of the form
- Parameters
-
bool | $encode | To sanitizer the text? |
- Returns
- string
Definition at line 205 of file form.php.
XoopsForm::getTitle |
( |
|
$encode = false | ) |
|
return the title of the form
- Parameters
-
bool | $encode | To sanitizer the text? |
- Returns
- string
Definition at line 216 of file form.php.
XoopsForm::insertBreak |
( |
|
$extra = null | ) |
|
insert a break in the form
This method is abstract. It must be overwritten in the child classes.
- Parameters
-
string | $extra | extra information for the break |
Definition at line 483 of file form.php.
returns renderered form
This method is abstract. It must be overwritten in the child classes.
Definition at line 494 of file form.php.
XoopsForm::renderValidationJS |
( |
|
$withtags = true | ) |
|
Renders the Javascript function needed for client-side for validation
Form elements that have been declared "required" and not set will prevent the form from being submitted. Additionally, each element class may provide its own "renderValidationJS" method that is supposed to return custom validation code for the element.
The element validation code can assume that the JS "myform" variable points to the form, and must execute return false if validation fails.
A basic element validation method may contain something like this: function renderValidationJS() { $name = $this->getName(); return "if ( myform.{$name}.value != 'valid' ) { " . "myform.{$name}.focus(); window.alert( '$name is invalid' ); return false;" . " }"; }
- Parameters
-
boolean | $withtags | Include the < javascript > tags in the returned string |
Definition at line 528 of file form.php.
References $js.
XoopsForm::setElementValue |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
Sets the "value" attribute of a form element
- Parameters
-
string | $name | the "name" attribute of a form element |
string | $value | the "value" attribute of a form element |
Definition at line 355 of file form.php.
XoopsForm::setElementValues |
( |
|
$values | ) |
|
Sets the "value" attribute of form elements in a batch
- Parameters
-
array | $values | array of name/value pairs to be assigned to form elements |
Definition at line 368 of file form.php.
References $i.
XoopsForm::setExtra |
( |
|
$extra | ) |
|
set the extra attributes for the <form> tag
- Parameters
-
string | $extra | extra attributes for the <form> tag |
Definition at line 425 of file form.php.
XoopsForm::setRequired |
( |
& |
$formElement | ) |
|
make an element "required"
- Parameters
-
Definition at line 460 of file form.php.
XoopsForm::setSummary |
( |
|
$summary | ) |
|
set the summary tag for the <form> tag
- Parameters
-
string | $extra | extra attributes for the <form> tag |
Definition at line 437 of file form.php.
XoopsForm::XoopsForm |
( |
|
$title, |
|
|
|
$name, |
|
|
|
$action, |
|
|
|
$method = 'post' , |
|
|
|
$addtoken = false , |
|
|
|
$summary = '' |
|
) |
| |
*#@- constructor
- Parameters
-
string | $title | title of the form |
string | $name | "name" attribute for the <form> tag |
string | $action | "action" attribute for the <form> tag |
string | $method | "method" attribute for the <form> tag |
bool | $addtoken | whether to add a security token to the form |
Definition at line 116 of file form.php.
References $action, $method, and $title.
XoopsForm::$_elements = array() |
XoopsForm::$_extra = array() |
XoopsForm::$_objid = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' |
additional seralised object checksum (ERM Analysis - Requirement)
- Deprecated:
- private
Definition at line 101 of file form.php.
XoopsForm::$_required = array() |
XoopsForm::$_summary = '' |
The documentation for this class was generated from the following file:
- L:/0xoops/xoops-2.5.6/htdocs/class/xoopsform/form.php