function flag_comment::replace_tokens in Flag 7.3
Same name and namespace in other branches
- 5 flag.inc \flag_comment::replace_tokens()
- 6.2 flag.inc \flag_comment::replace_tokens()
- 6 flag.inc \flag_comment::replace_tokens()
- 7.2 flag.inc \flag_comment::replace_tokens()
Replaces tokens.
Overrides flag_entity::replace_tokens
File
- includes/
flag/ flag_comment.inc, line 156 - Contains the flag_comment class.
Class
- flag_comment
- Implements a comment flag.
Code
function replace_tokens($label, $contexts, $options, $entity_id) {
if ($entity_id) {
if (($comment = $this
->fetch_entity($entity_id)) && ($node = node_load($comment->nid))) {
$contexts['node'] = $node;
$contexts['comment'] = $comment;
}
}
return parent::replace_tokens($label, $contexts, $options, $entity_id);
}