Same name and namespace in other branches
  1. 6.x-3.x modules/translation/views_handler_field_node_translation_link.inc \views_handler_field_node_translation_link::render_link()
1 call to views_handler_field_node_translation_link::render_link()
views_handler_field_node_translation_link::render in modules/translation/views_handler_field_node_translation_link.inc
Render the field.

File

modules/translation/views_handler_field_node_translation_link.inc, line 45
Definition of views_handler_field_node_translation_link.

Class

views_handler_field_node_translation_link
Field handler to present a link to the node.

Code

public function render_link($data, $values) {
  global $language;
  $tnid = $this
    ->get_value($values, 'tnid');

  // Only load translations if the node isn't in the current language.
  if ($this
    ->get_value($values, 'language') != $language->language) {
    $translations = translation_node_get_translations($tnid);
    if (isset($translations[$language->language])) {
      $values->{$this->aliases['nid']} = $translations[$language->language]->nid;
      $values->{$this->aliases['title']} = $translations[$language->language]->title;
    }
  }
  $this->options['alter']['make_link'] = TRUE;
  $this->options['alter']['path'] = "node/" . $this
    ->get_value($values, 'nid');
  return $this
    ->get_value($values, 'title');
}