You are here

function theme_talk_comments in Talk 7

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

A theme function to provide flexible rendering of the comments.

Parameters

$node: The node whose talk page is being displayed.

1 theme call to theme_talk_comments()
template_preprocess_talkpage in ./talk.module
Template preprocess function.

File

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

Code

function theme_talk_comments($variables) {
  $node = clone $variables['node'];
  $node->comment = _talk_node_comment_value($node);
  comment_node_view($node, 'full');
  if ($node->comment == COMMENT_NODE_OPEN) {
    if (user_access('post comments')) {

      // If comment form on same page as Talk, alter "Add new comment" link
      if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_BELOW) == COMMENT_FORM_BELOW) {
        $links_comments =& $node->content['links']['comment']['#links'];
        if (isset($links_comments['comment-add'])) {
          $links_comments['comment-add']['href'] = "node/{$node->nid}/talk";
        }
      }
    }
  }
  return drupal_render($node->content);
}