You are here

function talk_token_values in Talk 6

Same name and namespace in other branches
  1. 7 talk.module \talk_token_values()

Implementation of hook_token_values().

File

./talk.module, line 317
Comments are displayed in a separate 'talk' tab, for node types you wish

Code

function talk_token_values($type, $object = NULL, $options = array()) {
  switch ($type) {
    case 'comment':
      if ($comment = (object) $object) {
        $talk = '';
        $node = node_load($comment->nid);
        if (talk_activated($node->type)) {
          $talk = '/talk';
        }
        $values['comment-talk-url'] = url('node/' . $comment->nid . $talk, array(
          'fragment' => 'comment-' . $comment->cid,
          'absolute' => TRUE,
        ));
        return $values;
      }
      break;
  }
}