[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/views/modules/node/ -> views_handler_field_node_link_edit.inc (source)

   1  <?php
   2  /**
   3   * Field handler to present a link node edit.
   4   */
   5  class views_handler_field_node_link_edit extends views_handler_field_node_link {
   6    function construct() {
   7      parent::construct();
   8      $this->additional_fields['uid'] = 'uid';
   9      $this->additional_fields['type'] = 'type';
  10      $this->additional_fields['format'] = array('table' => 'node_revisions', 'field' => 'format');
  11    }
  12  
  13    function render($values) {
  14      // ensure user has access to edit this node.
  15      $node = new stdClass();
  16      $node->nid = $values->{$this->aliases['nid']};
  17      $node->uid = $values->{$this->aliases['uid']};
  18      $node->type = $values->{$this->aliases['type']};
  19      $node->format = $values->{$this->aliases['format']};
  20      $node->status = 1; // unpublished nodes ignore access control
  21      if (!node_access('update', $node)) {
  22        return;
  23      }
  24  
  25      $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
  26      return l($text, "node/$node->nid/edit", array('query' => drupal_get_destination()));
  27    }
  28  }
  29  


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