You are here

function views_handler_node_edit_destination in Views (for Drupal 7) 5

display a link to edit a node with a destination return

File

modules/views_node.inc, line 886

Code

function views_handler_node_edit_destination($fieldinfo, $fielddata, $value, $data) {

  // try to build a fake node object
  $data->type = $data->node_type;
  $data->uid = $data->node_uid;
  $data->status = 1;
  if (node_access('update', $data)) {
    $link_text = $fielddata['options'] ? $fielddata['options'] : t('Edit');
    return l($link_text, "node/{$data->nid}/edit", NULL, drupal_get_destination());
  }
}