You are here

function comment_activity_token_values in Activity 6.2

Implementation of hook_activity_token_values().

File

modules/comment.activity.inc, line 62
Activity definition file for comment.module

Code

function comment_activity_token_values($type, $object = NULL, $options = array()) {
  if ($type == 'comment') {
    $node = node_load($object->nid);
    $page = comment_new_page_count($node->comment_count, 1, $node);
    $query = array();
    if ($page > 0) {
      $query['page'] = $page;
    }
    return array(
      'activity-comment-author-link' => theme('activity_username', $object),
      'comment-link' => l(check_plain($object->subject), 'node/' . $object->nid, array(
        'query' => $query,
        'fragment' => 'comment-' . $object->cid,
      )),
    );
  }
  return array();
}