00001 <?php 00007 class views_handler_field_comment_link_delete extends views_handler_field_comment_link { 00008 function access() { 00009 //needs permission to administer comments in general 00010 return user_access('administer comments'); 00011 } 00012 00013 function render_link($data, $values) { 00014 $text = !empty($this->options['text']) ? $this->options['text'] : t('delete'); 00015 $cid = $this->get_value($values, 'cid'); 00016 00017 $this->options['alter']['make_link'] = TRUE; 00018 $this->options['alter']['path'] = "comment/" . $cid . "/delete"; 00019 $this->options['alter']['query'] = drupal_get_destination(); 00020 00021 return $text; 00022 } 00023 }