Overview

Packages

  • Form
  • None

Classes

  • Horde_Form
  • Horde_Form_Action
  • Horde_Form_Action_conditional_enable
  • Horde_Form_Action_conditional_setvalue
  • Horde_Form_Action_ConditionalEnable
  • Horde_Form_Action_ConditionalSetValue
  • Horde_Form_Action_reload
  • Horde_Form_Action_setcursorpos
  • Horde_Form_Action_submit
  • Horde_Form_Action_sum_fields
  • Horde_Form_Action_updatefield
  • Horde_Form_Renderer
  • Horde_Form_Translation
  • Horde_Form_Type
  • Horde_Form_Type_address
  • Horde_Form_Type_addresslink
  • Horde_Form_Type_assign
  • Horde_Form_Type_boolean
  • Horde_Form_Type_captcha
  • Horde_Form_Type_category
  • Horde_Form_Type_cellphone
  • Horde_Form_Type_colorpicker
  • Horde_Form_Type_countedtext
  • Horde_Form_Type_country
  • Horde_Form_Type_creditcard
  • Horde_Form_Type_date
  • Horde_Form_Type_datetime
  • Horde_Form_Type_dblookup
  • Horde_Form_Type_description
  • Horde_Form_Type_email
  • Horde_Form_Type_emailConfirm
  • Horde_Form_Type_enum
  • Horde_Form_Type_figlet
  • Horde_Form_Type_file
  • Horde_Form_Type_header
  • Horde_Form_Type_hourminutesecond
  • Horde_Form_Type_image
  • Horde_Form_Type_int
  • Horde_Form_Type_intlist
  • Horde_Form_Type_invalid
  • Horde_Form_Type_ip6address
  • Horde_Form_Type_ipaddress
  • Horde_Form_Type_keyval_multienum
  • Horde_Form_Type_link
  • Horde_Form_Type_longtext
  • Horde_Form_Type_matrix
  • Horde_Form_Type_mlenum
  • Horde_Form_Type_monthdayyear
  • Horde_Form_Type_monthyear
  • Horde_Form_Type_multienum
  • Horde_Form_Type_number
  • Horde_Form_Type_obrowser
  • Horde_Form_Type_octal
  • Horde_Form_Type_password
  • Horde_Form_Type_passwordconfirm
  • Horde_Form_Type_pgp
  • Horde_Form_Type_phone
  • Horde_Form_Type_radio
  • Horde_Form_Type_selectfiles
  • Horde_Form_Type_set
  • Horde_Form_Type_smime
  • Horde_Form_Type_sorter
  • Horde_Form_Type_sound
  • Horde_Form_Type_spacer
  • Horde_Form_Type_stringarray
  • Horde_Form_Type_stringlist
  • Horde_Form_Type_tableset
  • Horde_Form_Type_text
  • Horde_Form_Type_time
  • Horde_Form_Variable
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Form_Variable

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

Package: Form
Author: Robert E. Coyle robertecoyle@hotmail.com
Located at Horde/Form/Variable.php
Methods summary
public
# Horde_Form_Variable( string $humanName, string $varName, Horde_Form_Type & $type, boolean $required, boolean $readonly = false, string $description = null )

Variable constructor.

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

$value
A variable value.
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
# disable( )

Disables this variable.

Disables this variable.

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

Horde_Form_Type

This variable's Horde_Form_Type instance.

public string
# getTypeName( )

Returns the name of this variable's type.

Returns the name of this variable's type.

Returns

string
This variable's Horde_Form_Type name.
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.

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

$option
The option name.

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.

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

A Horde_Form_Type instance.

A Horde_Form_Type instance.

#
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

The variable help text.

The variable help text.

#
public boolean $_arrayVal

Whether this is an array variable.

Whether this is an array variable.

#
public mixed $_defValue

The default value.

The default value.

# null
public Horde_Form_Action $_action

A Horde_Form_Action instance.

A Horde_Form_Action instance.

#
public boolean $_disabled

Whether this variable is disabled.

Whether this variable is disabled.

# false
public boolean $_autofilled

TODO

TODO

# false
public boolean $_hidden

Whether this is a hidden variable.

Whether this is a hidden variable.

# false
public array $_options

TODO

TODO

# array()
API documentation generated by ApiGen