webform_handler_field_node_link_edit.inc 648 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Views handler to display an edit link for Webform configuration.
  5. */
  6. /**
  7. * Field handler to present a link node edit.
  8. */
  9. class webform_handler_field_node_link_edit 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 (!node_access('update', $node)) {
  16. return;
  17. }
  18. $this->options['alter']['make_link'] = TRUE;
  19. $this->options['alter']['path'] = "node/$node->nid/webform";
  20. $text = !empty($this->options['text']) ? $this->options['text'] : t('edit webform');
  21. return $text;
  22. }
  23. }