You are here

function flag_comment_action in Flag 6.2

Same name and namespace in other branches
  1. 7.3 includes/flag.actions.inc \flag_comment_action()
  2. 7.2 includes/flag.actions.inc \flag_comment_action()

Implements Drupal action. Flags a comment.

File

includes/flag.actions.inc, line 131
Hooks for flag actions.

Code

function flag_comment_action(&$comment, $context = array()) {
  if ($flag = flag_get_flag($context['flag_action']['flag'])) {
    $account = isset($context['account']) ? $context['account'] : $GLOBALS['user'];
    $flag
      ->flag($context['flag_action']['op'], $comment->cid, $account, TRUE);
  }
}