Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
33ed7644
Commit
33ed7644
authored
Dec 04, 2006
by
Dries
Browse files
- Patch
#100174
by hickory and edkwh: node_delete_confirm used .
parent
ce6dde98
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/node/node.module
View file @
33ed7644
...
...
@@ -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'
));
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment