You are here

function talk_link in Talk 5

Same name and namespace in other branches
  1. 6 talk.module \talk_link()

Implementation of hook_link().

File

./talk.module, line 110
Comments are displayed in a separate 'talk' tab, for node types you wish Made for Drupal 5.x

Code

function talk_link($type, $node = NULL, $teaser = FALSE) {
  if ($type == 'node' && talk_activated($node->type) && user_access('access comments')) {
    $result = array();
    if ($node->comment_count) {
      $result['talk_view'] = array(
        'title' => t('@title page (@nr comments)', array(
          '@nr' => $node->comment_count,
          '@title' => talk_title(),
        )),
        'href' => 'node/' . $node->nid . '/talk',
      );
    }
    if (_talk_node_comment_value($node) == COMMENT_NODE_READ_WRITE) {
      $result['comment_add'] = array(
        'title' => t('Add new comment'),
        'href' => "comment/reply/{$node->nid}",
      );
    }
    return $result;
  }
}