You are here

function flag_heartbeat_message::replace_tokens in Heartbeat 7

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

File

modules/heartbeat_plugins/plugins/flagattachment.inc, line 308

Class

flag_heartbeat_message
Exposes a Heartbeat Message Flag.

Code

function replace_tokens($label, $contexts, $options, $content_id) {
  if ($content_id) {
    if ($content_id instanceof HeartbeatActivity) {
      $contexts['heartbeat_activity'] = $content_id;
      $content_id = $contexts['heartbeat_activity']->uaid;
    }
    elseif ($message = $this
      ->fetch_content($content_id)) {
      $contexts['heartbeat_activity'] = $message;
    }
  }
  return parent::replace_tokens($label, $contexts, $options, $content_id);
}