You are here

function views_handler_field_node_new_comments::render_link in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 modules/comment/views_handler_field_node_new_comments.inc \views_handler_field_node_new_comments::render_link()
  2. 7.3 modules/comment/views_handler_field_node_new_comments.inc \views_handler_field_node_new_comments::render_link()
1 call to views_handler_field_node_new_comments::render_link()
views_handler_field_node_new_comments::render in modules/comment/views_handler_field_node_new_comments.inc
Render the field.

File

modules/comment/views_handler_field_node_new_comments.inc, line 78

Class

views_handler_field_node_new_comments
Field handler to display the number of new comments

Code

function render_link($data, $values) {
  if (!empty($this->options['link_to_comment']) && $data !== NULL && $data !== '') {
    $node = new stdClass();
    $node->nid = $values->{$this->aliases['nid']};
    $node->type = $values->{$this->aliases['type']};
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = 'node/' . $node->nid;
    $this->options['alter']['query'] = comment_new_page_count($values->{$this->aliases['comment_count']}, $values->{$this->field_alias}, $node);
    $this->options['alter']['fragment'] = 'new';
  }
  return $data;
}