1 views_handler_field_comment_node_link.inc views_handler_field_comment_node_link::render($values)

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

core/modules/comment/views/views_handler_field_comment_node_link.inc, line 51
Definition of views_handler_field_comment_node_link.

Class

views_handler_field_comment_node_link
Handler for showing comment module's node link.

Code

function render($values) {
  // Build fake $node.
  $node = $this->get_value($values);

  // Call comment.module's hook_link: comment_link($type, $node = NULL, $teaser = FALSE)
  // Call node by reference so that something is changed here
  comment_node_view($node, $this->options['teaser'] ? 'teaser' : 'full');
  // question: should we run these through:    backdrop_alter('link', $links, $node);
  // might this have unexpected consequences if these hooks expect items in $node that we don't have?

  // Only render the links, if they are defined.
  return !empty($node->content['links']['comment']) ? backdrop_render($node->content['links']['comment']) : '';
}