You are here

function nodejs_actions_comment_action in Node.js integration 7

Comment object action callback.

Parameters

object $node:

array $context:

File

nodejs_actions/nodejs_actions.module, line 76

Code

function nodejs_actions_comment_action($comment, $context = array()) {
  if ($action = nodejs_actions_get_action($context)) {
    $subject = t('Comment %action.', array(
      '%action' => $action,
    ));
    $link = l($comment->subject, 'node/' . $comment->nid, array(
      'fragment' => 'comment-' . $comment->cid,
    ));
    $body = t('The comment !link was %action.', array(
      '!link' => $link,
      '%action' => $action,
    ));
    nodejs_actions_enqueue_message($subject, $body);
  }
}