You are here

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

Same name and namespace in other branches
  1. 6.3 modules/node/views_handler_field_node.inc \views_handler_field_node::render_link()
  2. 7.3 modules/node/views_handler_field_node.inc \views_handler_field_node::render_link()

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()
views_handler_field_history_user_timestamp::render in modules/node/views_handler_field_history_user_timestamp.inc
Render the field.
views_handler_field_node::render in modules/node/views_handler_field_node.inc
Render the field.
views_handler_field_node_language::render in modules/translation/views_handler_field_node_language.inc
Render the field.
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.
views_handler_field_node_type::render in modules/node/views_handler_field_node_type.inc
Render the field.
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 48
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'])) {
    if ($data !== NULL && $data !== '') {
      $this->options['alter']['make_link'] = TRUE;
      $this->options['alter']['path'] = "node/" . $values->{$this->aliases['nid']};
      if (isset($this->aliases['language'])) {
        $languages = language_list();
        if (isset($languages[$values->{$this->aliases['language']}])) {
          $this->options['alter']['language'] = $languages[$values->{$this->aliases['language']}];
        }
        else {
          unset($this->options['alter']['language']);
        }
      }
    }
    else {
      $this->options['alter']['make_link'] = FALSE;
    }
  }
  return $data;
}