You are here

function flag_heartbeat_message::replace_tokens in Heartbeat 6.3

Same name and namespace in other branches
  1. 6.4 modules/flag_heartbeat/class.flag_heartbeat_message.inc \flag_heartbeat_message::replace_tokens()
  2. 7 modules/heartbeat_plugins/plugins/flagattachment.inc \flag_heartbeat_message::replace_tokens()

File

modules/flag_heartbeat/class.flag_heartbeat_message.inc, line 49

Class

flag_heartbeat_message
Implements a Heartbeat message flag.

Code

function replace_tokens($label, $contexts, $content_id) {
  if ($content_id) {
    if ($message = $this
      ->fetch_content($content_id)) {
      $contexts['heartbeat_message'] = $message;
      if ($message->uid > 0) {
        $contexts['user'] = user_load($message->uid);
      }
      if ($message->target_nid > 0) {
        $contexts['node'] = node_load($message->target_nid);
      }
    }
  }
  return parent::replace_tokens($label, $contexts, $content_id);
}