You are here

function node_delete_confirm in Drupal 4

Same name and namespace in other branches
  1. 5 modules/node/node.module \node_delete_confirm()
  2. 6 modules/node/node.pages.inc \node_delete_confirm()
  3. 7 modules/node/node.pages.inc \node_delete_confirm()

Menu callback -- ask for confirmation of node deletion

1 string reference to 'node_delete_confirm'
node_menu in modules/node.module
Implementation of hook_menu().

File

modules/node.module, line 1938
The core that allows content to be submitted to the site.

Code

function node_delete_confirm() {
  $edit = $_POST['edit'];
  $edit['nid'] = $edit['nid'] ? $edit['nid'] : arg(1);
  $node = node_load($edit['nid']);
  if (node_access('delete', $node)) {
    $form['nid'] = array(
      '#type' => 'value',
      '#value' => $node->nid,
    );
    $output = confirm_form('node_delete_confirm', $form, t('Are you sure you want to delete %title?', array(
      '%title' => theme('placeholder', $node->title),
    )), $_GET['destination'] ? $_GET['destination'] : 'node/' . $node->nid, t('This action cannot be undone.'), t('Delete'), t('Cancel'));
  }
  return $output;
}