You are here

function conditional_fields_is_triggered in Conditional Fields 6.2

Same name and namespace in other branches
  1. 5 conditional_fields.module \conditional_fields_is_triggered()
  2. 6 conditional_fields.module \conditional_fields_is_triggered()

Returns true if the field was triggered $selected_values The values of the controlling field selected by the user when creating the node $trigger_values An array containing the information we need to select the trigger values

4 calls to conditional_fields_is_triggered()
conditional_fields_nodeapi in ./conditional_fields.module
Implementation of hook_nodeapi().
conditional_fields_node_after_build in ./conditional_fields.module
Main tasks:
conditional_fields_node_form_validate in ./conditional_fields.module
Validation for node editing form.
conditional_fields_rules_condition_is_triggered in includes/conditional_fields.rules.inc
Condition: check if the controlled field is triggered

File

./conditional_fields.module, line 1051
Content fields and groups visibility based on the values of user defined 'trigger' fields.

Code

function conditional_fields_is_triggered($selected_values, $trigger_values) {
  foreach ((array) $selected_values as $values) {
    foreach ((array) $values as $value) {
      if (isset($value) && in_array($value, $trigger_values)) {
        return TRUE;
      }
    }
  }
  return FALSE;
}