views_handler_field_comment_link_reply.inc

  1. 3.x modules/comment/views_handler_field_comment_link_reply.inc
  2. 2.x modules/comment/views_handler_field_comment_link_reply.inc

Definition of views_handler_field_comment_link_reply.

File

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