2 // $Id: views_handler_field_comment_link.inc,v 1.2 2008/09/10 00:16:14 merlinofchaos Exp $
4 * Base field handler to present a link.
6 class views_handler_field_comment_link extends views_handler_field {
9 $this->additional_fields['cid'] = 'cid';
10 $this->additional_fields['nid'] = 'nid';
13 function option_definition() {
14 $options = parent::option_definition();
15 $options['text'] = array('default' => '', 'translatable' => TRUE);
19 function options_form(&$form, &$form_state) {
20 parent::options_form($form, $form_state);
21 $form['text'] = array(
22 '#type' => 'textfield',
23 '#title' => t('Text to display'),
24 '#default_value' => $this->options['text'],
29 $this->ensure_my_table();
30 $this->add_additional_fields();
33 function render($values) {
34 $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
35 return l($text, "node/" . $values->{$this->aliases['nid']}, array('html' => TRUE, 'fragment' => "comment-" . $values->{$this->aliases['cid']}));