Class Horde_Form_Variable

Description

This class represents a single form variable that may be rendered as one or more form fields.

Located in /Form/Form.php (line 4397)


	
			
Variable Summary
Method Summary
 Horde_Form_Variable Horde_Form_Variable (string $humanName, string $varName,  &$type, boolean $required, [boolean $readonly = false], [string $description = null], Horde_Form_Type $type)
 void disable ()
 mixed getDefault ()
 string getDescription ()
 string getHelp ()
 string getHumanName ()
 mixed getInfo ( &$vars,  &$info, Variables $vars, mixed $info)
 mixed getOption (string $option)
 string getTypeName ()
 mixed getValue ( &$vars, [integer $index = null], Variables $vars)
 array getValues ()
 string getVarName ()
 boolean hasAction ()
 boolean hasDescription ()
 boolean hasHelp ()
 void hide ()
 boolean isArrayVal ()
 boolean isDisabled ()
 boolean isHidden ()
 boolean isReadonly ()
 boolean isRequired ()
 boolean isUpload ()
 void setAction (Horde_Form_Action $action)
 void setDefault (mixed $value)
 void setFormOb ( &$form, Horde_Form $form)
 void setHelp (string $help)
 void setOption (string $option, mixed $val)
 boolean validate ( &$vars,  &$message, Variables $vars, string $message)
 boolean wasChanged ( &$vars, Variables $vars)
Variables
string $description (line 4446)

A long description of the variable's purpose, special instructions, etc.

Horde_Form $form (line 4404)

The form instance this variable is assigned to.

string $help (line 4453)

The variable help text.

string $humanName (line 4411)

A short description of this variable's purpose.

boolean $readonly (line 4439)

Whether this is a readonly variable.

boolean $required (line 4432)

Whether this is a required variable.

Horde_Form_Type $type (line 4425)

A Horde_Form_Type instance.

string $varName (line 4418)

The internally used name.

Horde_Form_Action $_action (line 4474)

A Horde_Form_Action instance.

boolean $_arrayVal (line 4460)

Whether this is an array variable.

boolean $_autofilled = false (line 4488)

TODO

mixed $_defValue = null (line 4467)

The default value.

boolean $_disabled = false (line 4481)

Whether this variable is disabled.

boolean $_hidden = false (line 4495)

Whether this is a hidden variable.

array $_options = array() (line 4502)

TODO

Methods
Constructor Horde_Form_Variable (line 4516)

Variable constructor.

Horde_Form_Variable Horde_Form_Variable (string $humanName, string $varName,  &$type, boolean $required, [boolean $readonly = false], [string $description = null], Horde_Form_Type $type)
  • string $humanName: A short description of the variable's purpose.
  • string $varName: The internally used name.
  • Horde_Form_Type $type: A Horde_Form_Type instance.
  • boolean $required: Whether this is a required variable.
  • boolean $readonly: Whether this is a readonly variable.
  • string $description: A long description of the variable's purpose, special instructions, etc.
  • &$type
disable (line 4605)

Disables this variable.

void disable ()
getDefault (line 4553)

Returns this variable's default value.

  • return: This variable's default value.
mixed getDefault ()
getDescription (line 4706)

Returns this variable's long description.

  • return: This variable's long description.
string getDescription ()
getHelp (line 4757)

Returns the help text of this variable.

  • return: This variable's help text.
string getHelp ()
getHumanName (line 4625)

Return the short description of this variable.

  • return: A short description
string getHumanName ()
getInfo (line 4797)

Processes the submitted value of this variable according to the rules of the variable type.

  • return: Depending on the variable type.
mixed getInfo ( &$vars,  &$info, Variables $vars, mixed $info)
  • Variables $vars: The Variables instance of the submitted form.
  • mixed $info: A variable passed by reference that will be assigned the processed value of the submitted variable value.
  • &$vars
  • &$info
getOption (line 4780)

Returns a variable option's value.

  • return: The option's value.
mixed getOption (string $option)
  • string $option: The option name.
getType (line 4646)

Returns this variable's type.

Horde_Form_Type &getType ()
getTypeName (line 4656)

Returns the name of this variable's type.

string getTypeName ()
getValue (line 4878)

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.

  • return: The variable or element value.
mixed getValue ( &$vars, [integer $index = null], Variables $vars)
  • Variables $vars: The Variables instance of the submitted form.
  • integer $index: If the variable is an array variable, this specifies the array element to return.
  • &$vars
getValues (line 4686)

Returns the possible values of this variable.

  • return: The possible values of this variable or null.
array getValues ()
getVarName (line 4635)

Returns the internally used variable name.

  • return: This variable's internal name.
string getVarName ()
hasAction (line 4579)

Returns whether this variable has an attached action.

  • return: True if this variable has an attached action.
boolean hasAction ()
hasDescription (line 4696)

Returns whether this variable has a long description.

  • return: True if this variable has a long description.
boolean hasDescription ()
hasHelp (line 4747)

Returns whether this variable has some help text assigned.

  • return: True if this variable has a help text.
boolean hasHelp ()
hide (line 4587)

Makes this a hidden variable.

void hide ()
isArrayVal (line 4716)

Returns whether this is an array variable.

  • return: True if this an array variable.
boolean isArrayVal ()
isDisabled (line 4615)

Returns whether this variable is disabled.

  • return: True if this variable is disabled.
boolean isDisabled ()
isHidden (line 4597)

Returns whether this is a hidden variable.

  • return: True if this a hidden variable.
boolean isHidden ()
isReadonly (line 4676)

Returns whether this is a readonly variable.

  • return: True if this a readonly variable.
boolean isReadonly ()
isRequired (line 4666)

Returns whether this is a required variable.

  • return: True if this is a required variable.
boolean isRequired ()
isUpload (line 4726)

Returns whether this variable is to upload a file.

  • return: True if variable is to upload a file.
boolean isUpload ()
setAction (line 4569)

Assigns an action to this variable.

Example:

  1.  $v &$form->addVariable('My Variable''var1''text'false);

void setAction (Horde_Form_Action $action)
setDefault (line 4543)

Sets a default value for this variable.

void setDefault (mixed $value)
  • mixed $value: A variable value.
setFormOb (line 4533)

Assign this variable to the specified form.

void setFormOb ( &$form, Horde_Form $form)
  • Horde_Form $form: The form instance to assign this variable to.
  • &$form
setHelp (line 4736)

Assigns a help text to this variable.

void setHelp (string $help)
  • string $help: The variable help text.
setOption (line 4768)

Sets a variable option.

void setOption (string $option, mixed $val)
  • string $option: The option name.
  • mixed $val: The option's value.
validate (line 4836)

Validates this variable.

  • return: True if the variable validated.
boolean validate ( &$vars,  &$message, Variables $vars, string $message)
  • Variables $vars: The Variables instance of the submitted form.
  • string $message: A variable passed by reference that will be assigned a descriptive error message if validation failed.
  • &$vars
  • &$message
wasChanged (line 4813)

Returns whether this variable if it had the "trackchange" option set has actually been changed.

  • return: 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.
boolean wasChanged ( &$vars, Variables $vars)

Documentation generated on Sun, 30 Jan 2011 05:17:33 +0000 by phpDocumentor 1.4.3