You are here

function rules_helper_do_recursive in Rules 6

Helper function Applies the function $function to all elements. Aborts if FALSE is returned.

2 calls to rules_helper_do_recursive()
rules_import_workflow_ng_rule in rules/rules.install
Transform a workflow-ng rule into a rule
rules_rule_format_upgrade_6003 in rules/rules.install
Upgrades the format of the rule to 6003 by flipping the argument maps of all rule elements.

File

rules/rules.install, line 290
Rules - Installation file.

Code

function rules_helper_do_recursive($function, &$elements) {
  drupal_load('module', 'rules');
  if ($function($elements) === FALSE) {
    return FALSE;
  }

  // recurse
  foreach (element_children($elements) as $key) {
    if (rules_helper_do_recursive($function, $elements[$key]) === FALSE) {
      return FALSE;
    }
  }
  return TRUE;
}