2 // $Id: views_handler_field_node_link.inc,v 1.1 2008/09/03 19:21:29 merlinofchaos Exp $
4 * Field handler to present a link to the node.
6 class views_handler_field_node_link extends views_handler_field {
9 $this->additional_fields['nid'] = 'nid';
12 function option_definition() {
13 $options = parent::option_definition();
15 $options['text'] = array('default' => '', 'translatable' => TRUE);
20 function options_form(&$form, &$form_state) {
21 parent::options_form($form, $form_state);
22 $form['text'] = array(
23 '#type' => 'textfield',
24 '#title' => t('Text to display'),
25 '#default_value' => $this->options['text'],
30 $this->ensure_my_table();
31 $this->add_additional_fields();
34 function render($values) {
35 $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
36 $nid = $values->{$this->aliases['nid']};
37 return l($text, "node/$nid");