Render whatever the data is as a link to the node.
Data should be made XSS safe prior to calling this function.
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
->getValue($values, 'nid');
if (isset($this->aliases['langcode'])) {
$languages = language_list();
$langcode = $this
->getValue($values, 'langcode');
if (isset($languages[$langcode])) {
$this->options['alter']['language'] = $languages[$langcode];
}
else {
unset($this->options['alter']['language']);
}
}
}
else {
$this->options['alter']['make_link'] = FALSE;
}
}
return $data;
}