You are here

function views_handler_node_delete in Views (for Drupal 7) 5

display a link to delete a node

File

modules/views_node.inc, line 900

Code

function views_handler_node_delete($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('delete', $data)) {
    $link_text = $fielddata['options'] ? $fielddata['options'] : t('Delete');
    return l($link_text, "node/{$data->nid}/delete");
  }
}