You are here

function flag_comment::replace_tokens in Flag 5

Same name and namespace in other branches
  1. 6.2 flag.inc \flag_comment::replace_tokens()
  2. 6 flag.inc \flag_comment::replace_tokens()
  3. 7.3 includes/flag/flag_comment.inc \flag_comment::replace_tokens()
  4. 7.2 flag.inc \flag_comment::replace_tokens()

File

./flag.inc, line 1022
Implements various flags. Uses object oriented style inspired by that of Views 2.

Class

flag_comment
Implements a comment flag.

Code

function replace_tokens($label, $contexts, $content_id) {
  if ($content_id) {
    if (($comment = $this
      ->fetch_content($content_id)) && ($node = node_load($comment->nid))) {
      $contexts['node'] = $node;
      $contexts['comment'] = $comment;
    }
  }
  return parent::replace_tokens($label, $contexts, $content_id);
}