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