commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / views / modules / comment / views_handler_field_comment_link_delete.inc
1 <?php
2
3 /**
4 * @file
5 * Definition of views_handler_field_comment_link_delete.
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_delete extends views_handler_field_comment_link {
14 function access() {
15 //needs permission to administer comments in general
16 return user_access('administer comments');
17 }
18
19 function render_link($data, $values) {
20 $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
21 $cid = $this->get_value($values, 'cid');
22
23 $this->options['alter']['make_link'] = TRUE;
24 $this->options['alter']['path'] = "comment/" . $cid . "/delete";
25 $this->options['alter']['query'] = drupal_get_destination();
26
27 return $text;
28 }
29 }