You are here

function module_grants_node_delete_confirm in Module Grants 6.4

Same name and namespace in other branches
  1. 6.3 module_grants.pages.inc \module_grants_node_delete_confirm()

Menu callback attached to 'node/%node/delete'. Ask for confirmation before proceeding with node deletion.

1 string reference to 'module_grants_node_delete_confirm'
module_grants_menu_alter in ./module_grants.module
Implementation of hook_menu_alter().

File

./module_grants.pages.inc, line 14
Rendering of pages used by Module Grants. Node deletion is overridden here, as node_delete calls node_access(), which it shouldn't when module_grants_node_access() is at work.

Code

function module_grants_node_delete_confirm(&$form_state, $node) {
  $nid = $node->nid;
  $form['nid'] = array(
    '#type' => 'value',
    '#value' => $nid,
  );
  $cancel_page = "node/{$nid}";
  return confirm_form($form, t('Are you sure you want to delete %title?', array(
    '%title' => $node->title,
  )), isset($_GET['destination']) ? $_GET['destination'] : $cancel_page, t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}