Methods summary
public
|
#
Horde_Form_Variable( string $humanName, string $varName, Horde_Form_Type & $type, boolean $required, boolean $readonly = false, string $description = null )
Variable constructor.
Parameters
- $humanName
- <p>A short description of the variable's
purpose.</p>
- $varName
- The internally used name.
- $type
- A <code><a href="class-Horde_Form_Type.html">Horde_Form_Type</a></code> instance.
- $required
- Whether this is a required variable.
- $readonly
- Whether this is a readonly variable.
- $description
- <p>A long description of the variable's
purpose, special instructions, etc.</p>
|
public
|
#
setFormOb( Horde_Form & $form )
Assign this variable to the specified form.
Assign this variable to the specified form.
Parameters
- $form
- The form instance to assign this variable to.
|
public
|
#
setDefault( mixed $value )
Sets a default value for this variable.
Sets a default value for this variable.
Parameters
|
public
mixed
|
#
getDefault( )
Returns this variable's default value.
Returns this variable's default value.
Returns
mixed This variable's default value.
|
public
|
#
setAction( Horde_Form_Action $action )
Assigns an action to this variable.
Assigns an action to this variable.
Example:
$v = &$form->addVariable('My Variable', 'var1', 'text', false);
$v->setAction(Horde_Form_Action::factory('submit'));
Parameters
- $action
- A <code><a href="class-Horde_Form_Action.html">Horde_Form_Action</a></code> instance.
|
public
boolean
|
#
hasAction( )
Returns whether this variable has an attached action.
Returns whether this variable has an attached action.
Returns
boolean True if this variable has an attached action.
|
public
|
#
hide( )
Makes this a hidden variable.
Makes this a hidden variable.
|
public
boolean
|
#
isHidden( )
Returns whether this is a hidden variable.
Returns whether this is a hidden variable.
Returns
boolean True if this a hidden variable.
|
public
|
|
public
boolean
|
#
isDisabled( )
Returns whether this variable is disabled.
Returns whether this variable is disabled.
Returns
boolean True if this variable is disabled.
|
public
string
|
#
getHumanName( )
Return the short description of this variable.
Return the short description of this variable.
Returns
string A short description
|
public
string
|
#
getVarName( )
Returns the internally used variable name.
Returns the internally used variable name.
Returns
string This variable's internal name.
|
public
Horde_Form_Type
&
|
#
getType( )
Returns this variable's type.
Returns this variable's type.
Returns
|
public
string
|
#
getTypeName( )
Returns the name of this variable's type.
Returns the name of this variable's type.
Returns
|
public
boolean
|
#
isRequired( )
Returns whether this is a required variable.
Returns whether this is a required variable.
Returns
boolean True if this is a required variable.
|
public
boolean
|
#
isReadonly( )
Returns whether this is a readonly variable.
Returns whether this is a readonly variable.
Returns
boolean True if this a readonly variable.
|
public
array
|
#
getValues( )
Returns the possible values of this variable.
Returns the possible values of this variable.
Returns
array The possible values of this variable or null.
|
public
boolean
|
#
hasDescription( )
Returns whether this variable has a long description.
Returns whether this variable has a long description.
Returns
boolean True if this variable has a long description.
|
public
string
|
#
getDescription( )
Returns this variable's long description.
Returns this variable's long description.
Returns
string This variable's long description.
|
public
boolean
|
#
isArrayVal( )
Returns whether this is an array variable.
Returns whether this is an array variable.
Returns
boolean True if this an array variable.
|
public
boolean
|
#
isUpload( )
Returns whether this variable is to upload a file.
Returns whether this variable is to upload a file.
Returns
boolean True if variable is to upload a file.
|
public
|
#
setHelp( string $help )
Assigns a help text to this variable.
Assigns a help text to this variable.
Parameters
- $help
- The variable help text.
|
public
boolean
|
#
hasHelp( )
Returns whether this variable has some help text assigned.
Returns whether this variable has some help text assigned.
Returns
boolean True if this variable has a help text.
|
public
string
|
#
getHelp( )
Returns the help text of this variable.
Returns the help text of this variable.
Returns
string This variable's help text.
|
public
|
#
setOption( string $option, mixed $val )
Sets a variable option.
Parameters
- $option
- The option name.
- $val
- The option's value.
|
public
mixed
|
#
getOption( string $option )
Returns a variable option's value.
Returns a variable option's value.
Parameters
Returns
mixed The option's value.
|
public
mixed
|
#
getInfo( Variables & $vars, mixed & $info )
Processes the submitted value of this variable according to the rules of
the variable type.
Processes the submitted value of this variable according to the rules of
the variable type.
Parameters
- $vars
- <p>The Variables instance of the submitted
form.</p>
- $info
- <p>A variable passed by reference that will be
assigned the processed value of the submitted
variable value.</p>
Returns
mixed Depending on the variable type.
|
public
boolean
|
#
wasChanged( Variables & $vars )
Returns whether this variable if it had the "trackchange" option set
has actually been changed.
Returns whether this variable if it had the "trackchange" option set
has actually been changed.
Parameters
- $vars
- <p>The Variables instance of the submitted
form.</p>
Returns
boolean Null if this variable doesn't have the "trackchange"
option set or the form wasn't submitted yet. A boolean
indicating whether the variable was changed otherwise.
|
public
boolean
|
#
validate( Variables & $vars, string & $message )
Validates this variable.
Parameters
- $vars
- <p>The Variables instance of the submitted
form.</p>
- $message
- <p>A variable passed by reference that will be
assigned a descriptive error message if
validation failed.</p>
Returns
boolean True if the variable validated.
|
public
mixed
|
#
getValue( Variables & $vars, integer $index = null )
Returns the submitted or default value of this variable.
If an action is attached to this variable, the value will get passed to
the action object.
Returns the submitted or default value of this variable.
If an action is attached to this variable, the value will get passed to
the action object.
Parameters
- $vars
- <p>The Variables instance of the submitted
form.</p>
- $index
- <p>If the variable is an array variable, this
specifies the array element to return.</p>
Returns
mixed The variable or element value.
|
Properties summary
public
Horde_Form
|
$form
The form instance this variable is assigned to.
The form instance this variable is assigned to.
|
|
public
string
|
$humanName
A short description of this variable's purpose.
A short description of this variable's purpose.
|
|
public
string
|
$varName
The internally used name.
The internally used name.
|
|
public
Horde_Form_Type
|
$type
|
|
public
boolean
|
$required
Whether this is a required variable.
Whether this is a required variable.
|
|
public
boolean
|
$readonly
Whether this is a readonly variable.
Whether this is a readonly variable.
|
|
public
string
|
$description
A long description of the variable's purpose, special instructions, etc.
A long description of the variable's purpose, special instructions, etc.
|
|
public
string
|
$help
|
|
public
boolean
|
$_arrayVal
Whether this is an array variable.
Whether this is an array variable.
|
|
public
mixed
|
$_defValue
|
|
public
Horde_Form_Action
|
$_action
|
|
public
boolean
|
$_disabled
Whether this variable is disabled.
Whether this variable is disabled.
|
|
public
boolean
|
$_autofilled
|
|
public
boolean
|
$_hidden
Whether this is a hidden variable.
Whether this is a hidden variable.
|
|
public
array
|
$_options
|
|