You are here

function rules_prepare_input_evaluators in Rules 6

Prepares the available input evaluator on the element.

1 call to rules_prepare_input_evaluators()
rules_admin_element_alter_form_submit in rules_admin/rules_admin.rule_forms.inc

File

rules/rules.input_evaluators.inc, line 24
Rules input evaluation system.

Code

function rules_prepare_input_evaluators(&$element, $variables) {
  $evaluators = rules_get_input_evaluators();
  $eval_settings = rules_get_settings_to_evaluate($element);
  $settings =& $element['#settings'];
  foreach ($evaluators as $base => $info) {
    foreach ($eval_settings as $name) {
      $setting = _rules_get_setting($settings, $name);
      if (isset($setting)) {

        // prepare the evaluation
        $data = call_user_func_array($base . '_prepare', array(
          $setting,
          $variables,
        ));
        if (isset($data)) {
          $settings['#eval input'][$base][$name] = $data;
        }
      }
    }
  }
}