XOOPS
2.6.0
|
Public Member Functions | |
__construct ($title, $name, $action, $method= 'post', $addtoken=false, $display= '') | |
addElement (Element $formElement, $required=false) | |
assign (\XoopsTpl $tpl) | |
display () | |
getAction ($encode=true) | |
getDisplay ($encode=false) | |
getElementByName ($name) | |
getElementNames () | |
getElements ($recurse=false) | |
getElementValue ($name, $encode=false) | |
getElementValues ($encode=false) | |
getExtra () | |
getMethod () | |
getName ($encode=true) | |
getRequired () | |
getTitle ($encode=false) | |
render () | |
renderValidationJS ($withtags=true) | |
setAction ($value= '') | |
setElementValue ($name, $value) | |
setElementValues ($values) | |
setExtra ($extra) | |
setRequired (Element $formElement) | |
setSummary ($summary) | |
setTitle ($title) | |
Private Attributes | |
$action | |
$display = '' | |
$elements = array() | |
$extra = array() | |
$method | |
$name | |
$required = array() | |
$summary = '' | |
$title | |
Xoops\Form\Form::__construct | ( | $title, | |
$name, | |||
$action, | |||
$method = 'post' , |
|||
$addtoken = false , |
|||
$display = '' |
|||
) |
constructor
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 |
boolean | $addtoken | whether to add a security token to the form |
string | $display | class for the form, i.e. horizontal, vertical, inline |
Definition at line 101 of file Form.php.
References Xoops\Form\Form\$action, Xoops\Form\Form\$display, Xoops\Form\Form\$method, Xoops\Form\Form\$name, Xoops\Form\Form\$title, Xoops\Form\Form\addElement(), and Xoops\Form\Form\display().
addElement - Add an element to the form
Definition at line 206 of file Form.php.
References $count, $i, Xoops\Form\Form\$required, and Xoops\Form\Element\setRequired().
Referenced by AvatarsAvatar_userForm\__construct(), XcaptchaImageForm\__construct(), XcaptchaTextForm\__construct(), ImagesImageForm\__construct(), AvatarsAvatarForm\__construct(), XcaptchaRecaptchaForm\__construct(), XcaptchaCaptchaForm\__construct(), ImagesCategoryselectForm\__construct(), ImagesCategoryForm\__construct(), SmiliesSmiliesForm\__construct(), CommentsCommentForm\__construct(), ImagesCategory_imagemanagerForm\__construct(), UserrankRanksForm\__construct(), MenusMenus_menuForm\__construct(), MenusMenus_menusForm\__construct(), ImagesImage_imagemanagerForm\__construct(), SystemUserForm\__construct(), SystemGroupForm\__construct(), Xoops\Form\GroupPermissionForm\__construct(), Xoops\Form\Form\__construct(), MaintenanceMaintenanceForm\getDump(), UserconfigsConfigsForm\getForm(), SystemPreferencesForm\getForm(), SystemBlockForm\getForm(), MaintenanceMaintenanceForm\getMaintenance(), UserconfigsModulesForm\getModulesForm(), SearchSearchForm\getSearchFrom(), Xoops\Form\SimpleForm\insertBreak(), Xoops\Form\ThemeForm\insertBreak(), Xoops\Form\TableForm\insertBreak(), and Xoops\Form\GroupPermissionForm\render().
Xoops\Form\Form::assign | ( | \XoopsTpl | $tpl | ) |
assign - assign to smarty form template instead of displaying directly
\XoopsTpl | $tpl | template |
Definition at line 499 of file Form.php.
References Xoops\Form\Form\$elements, $i, Xoops\Form\Form\getAction(), Xoops\Form\Form\getElements(), Xoops\Form\Form\getExtra(), Xoops\Form\Form\getMethod(), Xoops\Form\Form\getName(), Xoops\Form\Form\getRequired(), Xoops\Form\Form\getTitle(), Xoops\Form\Form\renderValidationJS(), and XoopsLocaleEn_US\REQUIRED.
Xoops\Form\Form::display | ( | ) |
display - displays rendered form
Definition at line 442 of file Form.php.
References Xoops\Form\Form\render().
Referenced by Xoops\Form\Form\__construct(), and Xoops\Form\Form\getDisplay().
Xoops\Form\Form::getAction | ( | $encode = true | ) |
getAction - get the "action" attribute for the <form> tag
boolean | $encode | True to encode special characters |
Definition at line 182 of file Form.php.
References Xoops\Form\Form\$action.
Referenced by Xoops\Form\Form\assign(), Xoops\Form\SimpleForm\render(), Xoops\Form\TableForm\render(), Xoops\Form\ThemeForm\render(), and Xoops\Form\GroupPermissionForm\render().
Xoops\Form\Form::getDisplay | ( | $encode = false | ) |
getDisplay - return the summary of the form
boolean | $encode | True to encode special characters |
Definition at line 120 of file Form.php.
References Xoops\Form\Form\$display, and Xoops\Form\Form\display().
Referenced by Xoops\Form\ThemeForm\render().
Xoops\Form\Form::getElementByName | ( | $name | ) |
getElementByName - get a reference to a Xoops by its name
string | $name | name attribute assigned to a Xoops |
Definition at line 280 of file Form.php.
References Xoops\Form\Form\$elements, Xoops\Form\Form\$name, and Xoops\Form\Form\getElements().
Referenced by Xoops\Form\Form\getElementValue(), and Xoops\Form\Form\setElementValue().
Xoops\Form\Form::getElementNames | ( | ) |
getElementNames - get an array of "name" attributes of form elements
Definition at line 261 of file Form.php.
References Xoops\Form\Form\$elements, and Xoops\Form\Form\getElements().
Xoops\Form\Form::getElements | ( | $recurse = false | ) |
getElements - get an array of forms elements
boolean | $recurse | true to get elements recursively |
Implements Xoops\Form\ContainerInterface.
Definition at line 232 of file Form.php.
References Xoops\Form\Form\$elements.
Referenced by Xoops\Form\Form\assign(), Xoops\Form\Form\getElementByName(), Xoops\Form\Form\getElementNames(), Xoops\Form\Form\getElementValues(), UserconfigsConfigsForm\getForm(), SystemPreferencesForm\getForm(), Xoops\Form\BlockForm\render(), Xoops\Form\SimpleForm\render(), Xoops\Form\TableForm\render(), Xoops\Form\ThemeForm\render(), Xoops\Form\GroupPermissionForm\render(), Xoops\Form\Form\renderValidationJS(), and Xoops\Form\Form\setElementValues().
Xoops\Form\Form::getElementValue | ( | $name, | |
$encode = false |
|||
) |
getElementValue - Gets the value attribute of a form element
string | $name | the name attribute of a form element |
boolean | $encode | True to encode special characters |
Definition at line 339 of file Form.php.
References Xoops\Form\Form\$name, and Xoops\Form\Form\getElementByName().
Xoops\Form\Form::getElementValues | ( | $encode = false | ) |
getElementValues - gets the value attribute of all form elements
boolean | $encode | True to encode special characters |
Definition at line 352 of file Form.php.
References Xoops\Form\Form\$elements, Xoops\Form\Form\$name, and Xoops\Form\Form\getElements().
Xoops\Form\Form::getExtra | ( | ) |
getExtra - get the extra attributes for the <form> tag
Definition at line 400 of file Form.php.
References Xoops\Form\Form\$extra.
Referenced by Xoops\Form\Form\assign(), Xoops\Form\SimpleForm\render(), Xoops\Form\TableForm\render(), Xoops\Form\ThemeForm\render(), and Xoops\Form\GroupPermissionForm\render().
Xoops\Form\Form::getMethod | ( | ) |
getMethod - get the "method" attribute for the <form> tag
Definition at line 193 of file Form.php.
Referenced by Xoops\Form\Form\assign(), Xoops\Form\SimpleForm\render(), Xoops\Form\TableForm\render(), Xoops\Form\ThemeForm\render(), and Xoops\Form\GroupPermissionForm\render().
Xoops\Form\Form::getName | ( | $encode = true | ) |
get the "name" attribute for the <form> tag
Deprecated, to be refactored
boolean | $encode | True to encode special characters |
Definition at line 158 of file Form.php.
References Xoops\Form\Form\$name.
Referenced by Xoops\Form\Form\assign(), Xoops\Form\SimpleForm\render(), Xoops\Form\TableForm\render(), Xoops\Form\ThemeForm\render(), Xoops\Form\GroupPermissionForm\render(), and Xoops\Form\Form\renderValidationJS().
Xoops\Form\Form::getRequired | ( | ) |
getRequired - get an array of required form elements
Implements Xoops\Form\ContainerInterface.
Definition at line 423 of file Form.php.
References Xoops\Form\Form\$required.
Referenced by Xoops\Form\Form\assign().
Xoops\Form\Form::getTitle | ( | $encode = false | ) |
getTitle - return the title of the form
bool | $encode | To sanitizer the text? |
Definition at line 132 of file Form.php.
References Xoops\Form\Form\$title.
Referenced by Xoops\Form\Form\assign(), Xoops\Form\SimpleForm\render(), Xoops\Form\TableForm\render(), Xoops\Form\ThemeForm\render(), and Xoops\Form\GroupPermissionForm\render().
|
abstract |
render - returns renderered form
This method is abstract. It must be overwritten in the child classes.
Referenced by Xoops\Form\Form\display().
Xoops\Form\Form::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;" . " }"; }
boolean | $withtags | Include the < javascript > tags in the returned string |
Definition at line 471 of file Form.php.
References Xoops\Form\Form\$elements, Xoops\Form\Form\getElements(), and Xoops\Form\Form\getName().
Referenced by Xoops\Form\Form\assign(), Xoops\Form\ThemeForm\render(), and Xoops\Form\GroupPermissionForm\render().
Xoops\Form\Form::setAction | ( | $value = '' | ) |
Xoops\Form\Form::setElementValue | ( | $name, | |
$value | |||
) |
setElementValue - Sets the "value" attribute of a form element
string | $name | the "name" attribute of a form element |
string | $value | the "value" attribute of a form element |
Definition at line 301 of file Form.php.
References Xoops\Form\Form\$name, and Xoops\Form\Form\getElementByName().
Xoops\Form\Form::setElementValues | ( | $values | ) |
setElementValues - Sets the "value" attribute of form elements in a batch
array | $values | array of name/value pairs to be assigned to form elements |
Definition at line 316 of file Form.php.
References Xoops\Form\Form\$elements, Xoops\Form\Form\$name, and Xoops\Form\Form\getElements().
Xoops\Form\Form::setExtra | ( | $extra | ) |
set the extra attributes for the <form> tag
string | $extra | extra attributes for the <form> tag |
Definition at line 374 of file Form.php.
References Xoops\Form\Form\$extra.
Referenced by AvatarsAvatar_userForm\__construct(), ImagesImageForm\__construct(), AvatarsAvatarForm\__construct(), SmiliesSmiliesForm\__construct(), UserrankRanksForm\__construct(), ImagesImage_imagemanagerForm\__construct(), and SystemGroupForm\__construct().
Xoops\Form\Form::setRequired | ( | Element | $formElement | ) |
Xoops\Form\Form::setSummary | ( | $summary | ) |
setSummary - set the summary tag for the <form> tag
string | $summary | summary |
Definition at line 388 of file Form.php.
References Xoops\Form\Form\$summary.
Xoops\Form\Form::setTitle | ( | $title | ) |
setTitle
string | $title | form title |
Definition at line 144 of file Form.php.
References Xoops\Form\Form\$title.
|
private |
Definition at line 33 of file Form.php.
Referenced by AvatarsAvatar_userForm\__construct(), AvatarsAvatarForm\__construct(), Xoops\Form\Form\__construct(), and Xoops\Form\Form\getAction().
|
private |
Definition at line 61 of file Form.php.
Referenced by Xoops\Form\Form\__construct(), and Xoops\Form\Form\getDisplay().
|
private |
Definition at line 68 of file Form.php.
Referenced by Xoops\Form\Form\assign(), Xoops\Form\Form\getElementByName(), Xoops\Form\Form\getElementNames(), Xoops\Form\Form\getElements(), Xoops\Form\Form\getElementValues(), Xoops\Form\GroupPermissionForm\render(), Xoops\Form\Form\renderValidationJS(), and Xoops\Form\Form\setElementValues().
|
private |
Definition at line 75 of file Form.php.
Referenced by Xoops\Form\Form\getExtra(), Xoops\Form\SimpleForm\insertBreak(), Xoops\Form\ThemeForm\insertBreak(), and Xoops\Form\Form\setExtra().
|
private |
Definition at line 40 of file Form.php.
Referenced by Xoops\Form\Form\__construct().
|
private |
Definition at line 47 of file Form.php.
Referenced by Xoops\Form\Form\__construct(), Xoops\Form\Form\getElementByName(), Xoops\Form\Form\getElementValue(), Xoops\Form\Form\getElementValues(), UserconfigsConfigsForm\getForm(), SystemPreferencesForm\getForm(), Xoops\Form\Form\getName(), Xoops\Form\Form\setElementValue(), and Xoops\Form\Form\setElementValues().
|
private |
Definition at line 82 of file Form.php.
Referenced by Xoops\Form\Form\addElement(), and Xoops\Form\Form\getRequired().
|
private |
Definition at line 87 of file Form.php.
Referenced by Xoops\Form\Form\setSummary().
|
private |
Definition at line 54 of file Form.php.
Referenced by ImagesImageForm\__construct(), AvatarsAvatarForm\__construct(), ImagesCategoryForm\__construct(), SmiliesSmiliesForm\__construct(), UserrankRanksForm\__construct(), MenusMenus_menusForm\__construct(), MenusMenus_menuForm\__construct(), ImagesImage_imagemanagerForm\__construct(), SystemGroupForm\__construct(), Xoops\Form\GroupPermissionForm\__construct(), Xoops\Form\Form\__construct(), UserconfigsConfigsForm\getForm(), SystemPreferencesForm\getForm(), SystemBlockForm\getForm(), Xoops\Form\Form\getTitle(), ImagesImageForm\message(), and Xoops\Form\Form\setTitle().