Horde_Form
__construct
( $vars, [ $title = ''], [ $name = null])
Horde_Form
Horde_Form
( &$vars, [ $title = ''], [ $name = null])
TODO
void
&addHidden
( $humanName, $varName, $type, $required, [ $readonly = false], [ $description = null], [ $params = array()])
-
$humanName
-
$varName
-
$type
-
$required
-
$readonly
-
$description
-
$params
TODO
void
&addVariable
( $humanName, $varName, $type, $required, [ $readonly = false], [ $description = null], [ $params = array()])
-
$humanName
-
$varName
-
$type
-
$required
-
$readonly
-
$description
-
$params
void
appendButtons
( $submit)
Fetch the field values of the submitted form.
void
getInfo
(
Variables $vars,
&$info,
array $info)
-
Variables
$vars: A Variables instance, optional since Horde 3.2.
-
array
$info: Array to be filled with the submitted field values.
-
&$info
Redefined in descendants as:
Get the renderer for this form, either a custom renderer or the standard one.
To use a custom form renderer, your form class needs to override this function:
{
$r = new CustomFormRenderer();
return $r;
}
... where CustomFormRenderer is the classname of the custom renderer class, which should extend Horde_Form_Renderer.
-
array
$params: A hash of renderer-specific parameters.
void
getSectionDesc
( $section)
void
getSectionExpandedState
( $section, [ $boolean = false])
void
getSectionImage
( $section)
void
&getType
( $type, [ $params = array()])
void
&getVariables
([ $flat = true], [ $withHidden = false])
TODO
void
&insertVariableBefore
( $before, $humanName, $varName, $type, $required, [ $readonly = false], [ $description = null], [ $params = array()])
-
$before
-
$humanName
-
$varName
-
$type
-
$required
-
$readonly
-
$description
-
$params
Determines if this form has been submitted or not. If the class var _submitted is null then it will check for the presence of the formname in the form variables.
Other events can explicitly set the _submitted variable to false to indicate a form submit but not for actual posting of data (eg. onChange events to update the display of fields).
boolean
isSubmitted
()
Checks if there is anything to do on the submission of the form by looping through each variable's onSubmit() function.
void
onSubmit
( &$vars, Horde_Variables $vars)
-
Horde_Variables
$vars
-
&$vars
void
open
( &$renderer, &$vars, $action, [ $method = 'get'], [ $enctype = null])
-
&$renderer
-
&$vars
-
$action
-
$method
-
$enctype
void
preserveVarByPost
( &$vars, $varname, [ $alt_varname = ''])
-
&$vars
-
$varname
-
$alt_varname
Removes a variable from the form.
As only variables can be passed by reference, you need to call this method this way if want to pass a variable name:
-
Horde_Form_Variable|string
$var: Either the variable's name or the variable to remove from the form.
-
&$var
Renders the form for editing.
void
renderActive
([
Horde_Form_Renderer $renderer =
null], [
Variables $vars =
null], [
string $action =
''], [
string $method =
'get'], [
string $enctype =
null], [
boolean $focus =
true])
-
Horde_Form_Renderer
$renderer: A renderer instance, optional since Horde 3.2.
-
Variables
$vars: A Variables instance, optional since Horde 3.2.
-
string
$action: The form action (url).
-
string
$method: The form method, usually either 'get' or 'post'.
-
string
$enctype: The form encoding type. Determined automatically if null.
-
boolean
$focus: Focus the first form field?
Renders the form for displaying.
-
Horde_Form_Renderer
$renderer: A renderer instance, optional since Horde 3.2.
-
Variables
$vars: A Variables instance, optional since Horde 3.2.
void
setButtons
( $submit, [ $reset = false])
void
setError
( $var, $message)
void
setOpenSection
( $section)
void
setSection
([ $section = ''], [ $desc = ''], [ $image = ''], [ $expanded = true])
-
$section
-
$desc
-
$image
-
$expanded
Explicitly sets the state of the form submit.
An event can override the automatic determination of the submit state in the isSubmitted() function.
void
setSubmitted
([boolean $state = true])
-
boolean
$state: Whether to set the state of the form as being submitted.
void
&singleton
( $form, &$vars, [ $title = ''], [ $name = null])
-
$form
-
&$vars
-
$title
-
$name
Sets or gets whether the form should be verified by tokens.
Tokens are used to verify that a form is only submitted once.
boolean
useToken
([boolean $token = null])
-
boolean
$token: If specified, sets whether to use form tokens.
Validates the form, checking if it really has been submitted by calling isSubmitted() and if true does any onSubmit() calls for variable types in the form. The _submitted variable is then rechecked.
boolean
validate
([
Variables $vars =
null], [
$canAutoFill =
false],
boolean $canAutofill)
-
Variables
$vars: A Variables instance, optional since Horde 3.2.
-
boolean
$canAutofill: Can the form be valid without being submitted?
-
$canAutoFill