\Horde_Form_Action_ConditionalEnable

Horde_Form_Action_ConditionalEnable is a Horde_Form_Action that enables or disables an element based on the value of another element

Format of the $params passed to the constructor:

 $params = array(
     'target'  => '[name of element this is conditional on]',
     'enabled' => 'true' | 'false',
     'values'  => array([target values to check])
 );

So $params = array('foo', 'true', array(1, 2)) will enable the field this action is attached to if the value of 'foo' is 1 or 2, and disable it otherwise.

Summary

Methods
Properties
Constants
Horde_Form_Action()
getTrigger()
id()
getActionScript()
printJavaScript()
getTarget()
setValues()
factory()
singleton()
$_id
$_params
$_trigger
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_id

$_id : 

Type

$_params

$_params : 

Type

$_trigger

$_trigger : 

Type

Methods

Horde_Form_Action()

Horde_Form_Action(  $params = null) 

Parameters

$params

getTrigger()

getTrigger() 

id()

id() 

getActionScript()

getActionScript(  $form,   $renderer,   $varname) 

Parameters

$form
$renderer
$varname

printJavaScript()

printJavaScript() 

getTarget()

getTarget() 

setValues()

setValues(  $vars,   $sourceVal,   $index = null,   $arrayVal = false) 

Parameters

$vars
$sourceVal
$index
$arrayVal

factory()

factory(mixed  $action, array  $params = null) : \Horde_Form_Action

Attempts to return a concrete Horde_Form_Action instance based on $form.

Parameters

mixed $action

The type of concrete Horde_Form_Action subclass to return. If $action is an array, then we will look in $action[0]/lib/Form/Action/ for the subclass implementation named $action[1].php.

array $params

A hash containing any additional configuration a form might need.

Returns

\Horde_Form_Action

The concrete Horde_Form_Action reference, or false on an error.

singleton()

singleton(mixed  $action, array  $params = null) : \Horde_Form_Action

Attempts to return a reference to a concrete Horde_Form_Action instance based on $action. It will only create a new instance if no Horde_Form_Action instance with the same parameters currently exists.

This should be used if multiple types of form renderers (and, thus, multiple Horde_Form_Action instances) are required.

This method must be invoked as: $var = &Horde_Form_Action::singleton()

Parameters

mixed $action

The type of concrete Horde_Form_Action subclass to return. The code is dynamically included. If $action is an array, then we will look in $action[0]/lib/Form/Action/ for the subclass implementation named $action[1].php.

array $params

A hash containing any additional configuration a form might need.

Returns

\Horde_Form_Action

The concrete Horde_Form_Action reference, or false on an error.