You are here

function hook_webform_conditional_operator_info in Webform 7.4

Declare conditional types and their operators.

Each conditional type defined here may then be referenced in hook_webform_component_info(). For each type this hook also declares a set of operators that may be applied to a component of this conditional type in conditionals.

Return value

array A 2-dimensional array of operator configurations. The configurations are keyed first by their conditional type then by operator key. Each operator declaration is an array with the following keys:

  • label: Translated label for this operator that is shown in the UI.
  • comparison callback: A callback for server-side evaluation.
  • js comparison callback: A JavaScript callback for client-side evaluation. The callback will be looked for in the Drupal.webform object.
  • form callback (optional): A form callback that allows configuring additional parameters for this operator. Default: 'webform_conditional_operator_text'.

See also

hook_webform_component_info()

callback_webform_conditional_comparision_operator()

callback_webform_conditional_rule_value_form()

Related topics

1 function implements hook_webform_conditional_operator_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

webform_webform_conditional_operator_info in ./webform.module
Implements hook_webform_conditional_operator_info().
1 invocation of hook_webform_conditional_operator_info()
webform_conditional_operators in includes/webform.conditionals.inc
Return a list of all Webform conditional operators.

File

./webform.api.php, line 1486
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_conditional_operator_info() {
  $operators = array();
  $operators['string']['not_equal'] = array(
    'label' => t('is not'),
    'comparison callback' => 'webform_conditional_operator_string_not_equal',
    'js comparison callback' => 'conditionalOperatorStringNotEqual',
  );
  return $operators;
}