Documentation

Horde_Form_Action_ConditionalEnable extends Horde_Form_Action
in package

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.

Tags
author

Matt Kynaston matt@kynx.org

category

Horde

copyright

2002-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL

Table of Contents

$_id  : mixed
$_params  : mixed
$_trigger  : mixed
__construct()  : mixed
factory()  : Horde_Form_Action
Attempts to return a concrete Horde_Form_Action instance based on $form.
getActionScript()  : mixed
getTarget()  : mixed
getTrigger()  : mixed
Horde_Form_Action()  : mixed
id()  : mixed
printJavaScript()  : mixed
setValues()  : mixed
singleton()  : 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.

Properties

Methods

__construct()

public __construct([mixed $params = null ]) : mixed
Parameters
$params : mixed = null
Return values
mixed

factory()

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

public static & factory(mixed $action[, array<string|int, mixed> $params = null ]) : Horde_Form_Action
Parameters
$action : mixed

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.

$params : array<string|int, mixed> = null

A hash containing any additional configuration a form might need.

Return values
Horde_Form_Action

The concrete Horde_Form_Action reference, or false on an error.

getActionScript()

public getActionScript(mixed &$form, mixed $renderer, mixed $varname) : mixed
Parameters
$form : mixed
$renderer : mixed
$varname : mixed
Return values
mixed

getTarget()

public getTarget() : mixed
Return values
mixed

getTrigger()

public getTrigger() : mixed
Return values
mixed

Horde_Form_Action()

public Horde_Form_Action([mixed $params = null ]) : mixed
Parameters
$params : mixed = null
Return values
mixed

id()

public id() : mixed
Return values
mixed

printJavaScript()

public printJavaScript() : mixed
Return values
mixed

setValues()

public setValues(mixed &$vars, mixed $sourceVal[, mixed $index = null ][, mixed $arrayVal = false ]) : mixed
Parameters
$vars : mixed
$sourceVal : mixed
$index : mixed = null
$arrayVal : mixed = false
Return values
mixed

singleton()

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.

public & singleton(mixed $action[, array<string|int, mixed> $params = null ]) : Horde_Form_Action

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
$action : mixed

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.

$params : array<string|int, mixed> = null

A hash containing any additional configuration a form might need.

Return values
Horde_Form_Action

The concrete Horde_Form_Action reference, or false on an error.

Search results