You are here

class module_grants_views_handler_field_node_link_edit in Module Grants 6.3

@file Views field handler for node edit link based on Module Grants access.

Hierarchy

Expanded class hierarchy of module_grants_views_handler_field_node_link_edit

1 string reference to 'module_grants_views_handler_field_node_link_edit'
module_grants_views_views_data_alter in module_grants_views/module_grants_views.views.inc
Implementation of hook_views_data_alter().

File

module_grants_views/module_grants_views_handler_field_node_link_edit.inc, line 7
Views field handler for node edit link based on Module Grants access.

View source
class module_grants_views_handler_field_node_link_edit extends views_handler_field_node_link {
  function render($values) {
    $nid = $values->{$this->aliases['nid']};
    $node = node_load($nid);
    if (module_grants_node_access('update', $node)) {
      $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
      return l($text, "node/{$node->nid}/edit", array(
        'query' => drupal_get_destination(),
      ));
    }
  }

}

Members