1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Views handler to display a results link for Webform submissions.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Field handler to present a link node edit.
|
10
|
*/
|
11
|
class webform_handler_field_node_link_results 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 (!webform_results_access($node)) {
|
19
|
return;
|
20
|
}
|
21
|
|
22
|
$this->options['alter']['make_link'] = TRUE;
|
23
|
$this->options['alter']['path'] = "node/$node->nid/webform-results";
|
24
|
|
25
|
$text = !empty($this->options['text']) ? $this->options['text'] : t('results');
|
26
|
return $text;
|
27
|
}
|
28
|
|
29
|
}
|
30
|
|