diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-12-04 10:53:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-12-04 10:53:37 +0000 |
commit | 33ed7644212205df457d38dad2460da5c2ab2ba8 (patch) | |
tree | 1d76b9a3780a672990d6622f234bb9220f278679 | |
parent | ce6dde980a6eb4a606f7e2d5b97c9445235b2b7a (diff) | |
download | brdo-33ed7644212205df457d38dad2460da5c2ab2ba8.tar.gz brdo-33ed7644212205df457d38dad2460da5c2ab2ba8.tar.bz2 |
- Patch #100174 by hickory and edkwh: node_delete_confirm used .
-rw-r--r-- | modules/node/node.module | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index aa9c5c91a..655c90aa2 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1156,7 +1156,7 @@ function node_menu($may_cache) { 'type' => MENU_LOCAL_TASK); $items[] = array('path' => 'node/'. arg(1) .'/delete', 'title' => t('Delete'), 'callback' => 'drupal_get_form', - 'callback arguments' => array('node_delete_confirm'), + 'callback arguments' => array('node_delete_confirm', $node), 'access' => node_access('delete', $node), 'weight' => 1, 'type' => MENU_CALLBACK); @@ -2212,20 +2212,14 @@ function node_form_submit($form_id, $form_values) { /** * Menu callback -- ask for confirmation of node deletion */ -function node_delete_confirm() { - $edit = $_POST; - $edit['nid'] = $edit['nid'] ? $edit['nid'] : arg(1); - $node = node_load($edit['nid']); +function node_delete_confirm($node) { + $form['nid'] = array('#type' => 'value', '#value' => $node->nid); - if (node_access('delete', $node)) { - $form['nid'] = array('#type' => 'value', '#value' => $node->nid); - $output = confirm_form($form, - t('Are you sure you want to delete %title?', array('%title' => $node->title)), - $_GET['destination'] ? $_GET['destination'] : 'node/'. $node->nid, t('This action cannot be undone.'), - t('Delete'), t('Cancel') ); - } - - return $output; + return confirm_form($form, + t('Are you sure you want to delete %title?', array('%title' => $node->title)), + $_GET['destination'] ? $_GET['destination'] : 'node/'. $node->nid, + t('This action cannot be undone.'), + t('Delete'), t('Cancel')); } /** |