[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/webform/views/ -> webform_handler_field_node_link_results.inc (source)

   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    function construct() {
  13      parent::construct();
  14      $this->additional_fields['uid'] = 'uid';
  15      $this->additional_fields['type'] = 'type';
  16      $this->additional_fields['format'] = array('table' => 'node_revisions', 'field' => 'format');
  17    }
  18  
  19    function render($values) {
  20      // ensure user has access to edit this node.
  21      $node = new stdClass();
  22      $node->nid = $values->{$this->aliases['nid']};
  23      $node->uid = $values->{$this->aliases['uid']};
  24      $node->type = $values->{$this->aliases['type']};
  25      $node->format = $values->{$this->aliases['format']};
  26      $node->status = 1; // unpublished nodes ignore access control
  27      if (!webform_results_access($node)) {
  28        return;
  29      }
  30  
  31      $text = !empty($this->options['text']) ? $this->options['text'] : t('results');
  32      return l($text, "node/$node->nid/webform-results");
  33    }
  34  }
  35  


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7