PHP Class Horde_Form_Variable, horde

Author: Robert E. Coyle ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Свойство Type Description
$_action Horde_Form_Action A {@link Horde_Form_Action} instance.
$_arrayVal boolean Whether this is an array variable.
$_autofilled boolean TODO
$_defValue mixed The default value.
$_disabled boolean Whether this variable is disabled.
$_hidden boolean Whether this is a hidden variable.
$_options array TODO
$description string A long description of the variable's purpose, special instructions, etc.
$form Horde_Form The form instance this variable is assigned to.
$help string The variable help text.
$humanName string A short description of this variable's purpose.
$readonly boolean Whether this is a readonly variable.
$required boolean Whether this is a required variable.
$type Horde_Form_Type A {@link Horde_Form_Type} instance.
$varName string The internally used name.

Méthodes publiques

Méthode Description
Horde_Form_Variable ( string $humanName, string $varName, Horde_Form_Type &$type, boolean $required, boolean $readonly = false, string $description = null ) Variable constructor.
disable ( ) Disables this variable.
getDefault ( ) : mixed Returns this variable's default value.
getDescription ( ) : string Returns this variable's long description.
getHelp ( ) : string Returns the help text of this variable.
getHumanName ( ) : string Return the short description of this variable.
getInfo ( Variables &$vars, mixed &$info ) : mixed Processes the submitted value of this variable according to the rules of the variable type.
getOption ( string $option ) : mixed Returns a variable option's value.
getType ( ) : Horde_Form_Type Returns this variable's type.
getTypeName ( ) : string Returns the name of this variable's type.
getValue ( Variables &$vars, integer $index = null ) : mixed Returns the submitted or default value of this variable.
getValues ( ) : array Returns the possible values of this variable.
getVarName ( ) : string Returns the internally used variable name.
hasAction ( ) : boolean Returns whether this variable has an attached action.
hasDescription ( ) : boolean Returns whether this variable has a long description.
hasHelp ( ) : boolean Returns whether this variable has some help text assigned.
hide ( ) Makes this a hidden variable.
isArrayVal ( ) : boolean Returns whether this is an array variable.
isDisabled ( ) : boolean Returns whether this variable is disabled.
isHidden ( ) : boolean Returns whether this is a hidden variable.
isReadonly ( ) : boolean Returns whether this is a readonly variable.
isRequired ( ) : boolean Returns whether this is a required variable.
isUpload ( ) : boolean Returns whether this variable is to upload a file.
setAction ( Horde_Form_Action $action ) Assigns an action to this variable.
setDefault ( mixed $value ) Sets a default value for this variable.
setFormOb ( Horde_Form &$form ) Assign this variable to the specified form.
setHelp ( string $help ) Assigns a help text to this variable.
setOption ( string $option, mixed $val ) Sets a variable option.
validate ( Variables &$vars, string &$message ) : boolean Validates this variable.
wasChanged ( Variables &$vars ) : boolean Returns whether this variable if it had the "trackchange" option set has actually been changed.

Method Details

Horde_Form_Variable() public méthode

Variable constructor.
public Horde_Form_Variable ( string $humanName, string $varName, Horde_Form_Type &$type, boolean $required, boolean $readonly = false, string $description = null )
$humanName string A short description of the variable's purpose.
$varName string The internally used name.
$type Horde_Form_Type A {@link Horde_Form_Type} instance.
$required boolean Whether this is a required variable.
$readonly boolean Whether this is a readonly variable.
$description string A long description of the variable's purpose, special instructions, etc.

disable() public méthode

Disables this variable.
public disable ( )

getDefault() public méthode

Returns this variable's default value.
public getDefault ( ) : mixed
Résultat mixed This variable's default value.

getDescription() public méthode

Returns this variable's long description.
public getDescription ( ) : string
Résultat string This variable's long description.

getHelp() public méthode

Returns the help text of this variable.
public getHelp ( ) : string
Résultat string This variable's help text.

getHumanName() public méthode

Return the short description of this variable.
public getHumanName ( ) : string
Résultat string A short description

getInfo() public méthode

Processes the submitted value of this variable according to the rules of the variable type.
public getInfo ( Variables &$vars, mixed &$info ) : mixed
$vars Variables The {@link Variables} instance of the submitted form.
$info mixed A variable passed by reference that will be assigned the processed value of the submitted variable value.
Résultat mixed Depending on the variable type.

getOption() public méthode

Returns a variable option's value.
public getOption ( string $option ) : mixed
$option string The option name.
Résultat mixed The option's value.

getType() public méthode

Returns this variable's type.
public getType ( ) : Horde_Form_Type
Résultat Horde_Form_Type This variable's {@link Horde_Form_Type} instance.

getTypeName() public méthode

Returns the name of this variable's type.
public getTypeName ( ) : string
Résultat string This variable's {@link Horde_Form_Type} name.

getValue() public méthode

If an action is attached to this variable, the value will get passed to the action object.
public getValue ( Variables &$vars, integer $index = null ) : mixed
$vars Variables The {@link Variables} instance of the submitted form.
$index integer If the variable is an array variable, this specifies the array element to return.
Résultat mixed The variable or element value.

getValues() public méthode

Returns the possible values of this variable.
public getValues ( ) : array
Résultat array The possible values of this variable or null.

getVarName() public méthode

Returns the internally used variable name.
public getVarName ( ) : string
Résultat string This variable's internal name.

hasAction() public méthode

Returns whether this variable has an attached action.
public hasAction ( ) : boolean
Résultat boolean True if this variable has an attached action.

hasDescription() public méthode

Returns whether this variable has a long description.
public hasDescription ( ) : boolean
Résultat boolean True if this variable has a long description.

hasHelp() public méthode

Returns whether this variable has some help text assigned.
public hasHelp ( ) : boolean
Résultat boolean True if this variable has a help text.

hide() public méthode

Makes this a hidden variable.
public hide ( )

isArrayVal() public méthode

Returns whether this is an array variable.
public isArrayVal ( ) : boolean
Résultat boolean True if this an array variable.

isDisabled() public méthode

Returns whether this variable is disabled.
public isDisabled ( ) : boolean
Résultat boolean True if this variable is disabled.

isHidden() public méthode

Returns whether this is a hidden variable.
public isHidden ( ) : boolean
Résultat boolean True if this a hidden variable.

isReadonly() public méthode

Returns whether this is a readonly variable.
public isReadonly ( ) : boolean
Résultat boolean True if this a readonly variable.

isRequired() public méthode

Returns whether this is a required variable.
public isRequired ( ) : boolean
Résultat boolean True if this is a required variable.

isUpload() public méthode

Returns whether this variable is to upload a file.
public isUpload ( ) : boolean
Résultat boolean True if variable is to upload a file.

setAction() public méthode

Example: $v = $form->addVariable('My Variable', 'var1', 'text', false); $v->setAction(Horde_Form_Action::factory('submit'));
public setAction ( Horde_Form_Action $action )
$action Horde_Form_Action A {@link Horde_Form_Action} instance.

setDefault() public méthode

Sets a default value for this variable.
public setDefault ( mixed $value )
$value mixed A variable value.

setFormOb() public méthode

Assign this variable to the specified form.
public setFormOb ( Horde_Form &$form )
$form Horde_Form The form instance to assign this variable to.

setHelp() public méthode

Assigns a help text to this variable.
public setHelp ( string $help )
$help string The variable help text.

setOption() public méthode

Sets a variable option.
public setOption ( string $option, mixed $val )
$option string The option name.
$val mixed The option's value.

validate() public méthode

Validates this variable.
public validate ( Variables &$vars, string &$message ) : boolean
$vars Variables The {@link Variables} instance of the submitted form.
$message string A variable passed by reference that will be assigned a descriptive error message if validation failed.
Résultat boolean True if the variable validated.

wasChanged() public méthode

Returns whether this variable if it had the "trackchange" option set has actually been changed.
public wasChanged ( Variables &$vars ) : boolean
$vars Variables The {@link Variables} instance of the submitted form.
Résultat 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.

Property Details

$_action public_oe property

A {@link Horde_Form_Action} instance.
public Horde_Form_Action $_action
Résultat Horde_Form_Action

$_arrayVal public_oe property

Whether this is an array variable.
public bool $_arrayVal
Résultat boolean

$_autofilled public_oe property

TODO
public bool $_autofilled
Résultat boolean

$_defValue public_oe property

The default value.
public mixed $_defValue
Résultat mixed

$_disabled public_oe property

Whether this variable is disabled.
public bool $_disabled
Résultat boolean

$_hidden public_oe property

Whether this is a hidden variable.
public bool $_hidden
Résultat boolean

$_options public_oe property

TODO
public array $_options
Résultat array

$description public_oe property

A long description of the variable's purpose, special instructions, etc.
public string $description
Résultat string

$form public_oe property

The form instance this variable is assigned to.
public Horde_Form $form
Résultat Horde_Form

$help public_oe property

The variable help text.
public string $help
Résultat string

$humanName public_oe property

A short description of this variable's purpose.
public string $humanName
Résultat string

$readonly public_oe property

Whether this is a readonly variable.
public bool $readonly
Résultat boolean

$required public_oe property

Whether this is a required variable.
public bool $required
Résultat boolean

$type public_oe property

A {@link Horde_Form_Type} instance.
public Horde_Form_Type $type
Résultat Horde_Form_Type

$varName public_oe property

The internally used name.
public string $varName
Résultat string