webform_handler_field_node_link_results.inc 655 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Views handler to display a results link for Webform submissions.
  5. */
  6. /**
  7. * Field handler to present a link node edit.
  8. */
  9. class webform_handler_field_node_link_results extends views_handler_field_node_link {
  10. /**
  11. * Renders the link.
  12. */
  13. function render_link($node, $values) {
  14. // Ensure user has access to edit this node.
  15. if (!webform_results_access($node)) {
  16. return;
  17. }
  18. $this->options['alter']['make_link'] = TRUE;
  19. $this->options['alter']['path'] = "node/$node->nid/webform-results";
  20. $text = !empty($this->options['text']) ? $this->options['text'] : t('results');
  21. return $text;
  22. }
  23. }