You are here

function heartbeat_rule_action_get_variables in Heartbeat 6.4

Helper function to fetch the defined variables for this message

2 calls to heartbeat_rule_action_get_variables()
heartbeat_activity_rules_action_message_id_js in modules/heartbeat_rules/hrules.module
Callback function to add variables to the user activity actions forms
heartbeat_rules_default_action_form in modules/heartbeat_rules/hrules.rules.inc
Action drupal message configuration form.

File

modules/heartbeat_rules/hrules.module, line 192
Heartbeat rules implementation module

Code

function heartbeat_rule_action_get_variables($message, $values = array()) {
  $defined_variables = heartbeat_match_variables($message->message, $message->message_concat);

  // If words are found as match to a heartbeat message variable,
  // variables are needed in the message
  if (count($defined_variables['words']) > 0) {

    // Add the textarea where all the magic variables go into
    return heartbeat_variables_compare($defined_variables['words'], $values);
  }
  return '';
}