1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_field_comment_link_reply.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Field handler to present a link to delete a node.
|
10
|
*
|
11
|
* @ingroup views_field_handlers
|
12
|
*/
|
13
|
class views_handler_field_comment_link_reply extends views_handler_field_comment_link {
|
14
|
|
15
|
/**
|
16
|
* {@inheritdoc}
|
17
|
*/
|
18
|
public function access() {
|
19
|
// Check for permission to reply to comments.
|
20
|
return user_access('post comments');
|
21
|
}
|
22
|
|
23
|
/**
|
24
|
* {@inheritdoc}
|
25
|
*/
|
26
|
public function render_link($data, $values) {
|
27
|
$text = !empty($this->options['text']) ? $this->options['text'] : t('reply');
|
28
|
$nid = $this->get_value($values, 'nid');
|
29
|
$cid = $this->get_value($values, 'cid');
|
30
|
|
31
|
$this->options['alter']['make_link'] = TRUE;
|
32
|
$this->options['alter']['path'] = "comment/reply/" . $nid . '/' . $cid;
|
33
|
|
34
|
return $text;
|
35
|
}
|
36
|
|
37
|
}
|