function views_handler_field_node::render_link

3.x views_handler_field_node.inc views_handler_field_node::render_link($data, $values)
2.x views_handler_field_node.inc views_handler_field_node::render_link($data, $values)

Render whatever the data is as a link to the node.

Data should be made XSS safe prior to calling this function.

5 calls to views_handler_field_node::render_link()
1 method overrides views_handler_field_node::render_link()
views_handler_field_node_revision::render_link in modules/node/views_handler_field_node_revision.inc
Render whatever the data is as a link to the node.

File

modules/node/views_handler_field_node.inc, line 53
Contains the basic 'node' field handler.

Class

views_handler_field_node
Field handler to provide simple renderer that allows linking to a node. Definition terms:

Code

function render_link($data, $values) {
  if (!empty($this->options['link_to_node']) && !empty($this->additional_fields['nid'])) {
    if ($data !== NULL && $data !== '') {
      $this->options['alter']['make_link'] = TRUE;
      $this->options['alter']['path'] = "node/" . $this->get_value($values, 'nid');
      if (isset($this->aliases['language'])) {
        $languages = language_list();
        $language = $this->get_value($values, 'language');
        if (isset($languages[$language])) {
          $this->options['alter']['language'] = $languages[$language];
        }
        else {
          unset($this->options['alter']['language']);
        }
      }
    }
    else {
      $this->options['alter']['make_link'] = FALSE;
    }
  }
  return $data;
}