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
fd7a3244
Commit
fd7a3244
authored
Feb 17, 2010
by
webchick
Browse files
#645374
follow-up by sun: Make entity ids available to confirm form submit handlers.
parent
00319d8e
Changes
4
Hide whitespace changes
Inline
Side-by-side
modules/comment/comment.admin.inc
View file @
fd7a3244
...
...
@@ -241,6 +241,8 @@ function comment_multiple_delete_confirm_submit($form, &$form_state) {
*/
function
comment_confirm_delete
(
$form
,
&
$form_state
,
$comment
)
{
$form
[
'#comment'
]
=
$comment
;
// Always provide entity id in the same form key as in the entity edit form.
$form
[
'cid'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$comment
->
cid
);
return
confirm_form
(
$form
,
t
(
'Are you sure you want to delete the comment %title?'
,
array
(
'%title'
=>
$comment
->
subject
)),
...
...
modules/node/node.pages.inc
View file @
fd7a3244
...
...
@@ -469,11 +469,9 @@ function node_form_submit_build_node($form, &$form_state) {
* Menu callback -- ask for confirmation of node deletion
*/
function
node_delete_confirm
(
$form
,
&
$form_state
,
$node
)
{
$form
[
'nid'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$node
->
nid
,
);
$form
[
'#node'
]
=
$node
;
// Always provide entity id in the same form key as in the entity edit form.
$form
[
'nid'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$node
->
nid
);
return
confirm_form
(
$form
,
t
(
'Are you sure you want to delete %title?'
,
array
(
'%title'
=>
$node
->
title
)),
'node/'
.
$node
->
nid
,
...
...
modules/taxonomy/taxonomy.admin.inc
View file @
fd7a3244
...
...
@@ -864,18 +864,21 @@ function taxonomy_term_confirm_parents($form, &$form_state, $vocabulary) {
function
taxonomy_term_confirm_delete
(
$form
,
&
$form_state
,
$tid
)
{
$term
=
taxonomy_term_load
(
$tid
);
// Always provide entity id in the same form key as in the entity edit form.
$form
[
'tid'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$tid
);
$form
[
'#term'
]
=
$term
;
$form
[
'type'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
'term'
);
$form
[
'name'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$term
->
name
);
$form
[
'tid'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$tid
);
$form
[
'vocabulary_machine_name'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$term
->
vocabulary_machine_name
);
$form
[
'delete'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
TRUE
);
return
confirm_form
(
$form
,
t
(
'Are you sure you want to delete the term %title?'
,
array
(
'%title'
=>
$term
->
name
)),
'admin/structure/taxonomy'
,
t
(
'Deleting a term will delete all its children if there are any. This action cannot be undone.'
),
t
(
'Delete'
),
t
(
'Cancel'
));
t
(
'Are you sure you want to delete the term %title?'
,
array
(
'%title'
=>
$term
->
name
)),
'admin/structure/taxonomy'
,
t
(
'Deleting a term will delete all its children if there are any. This action cannot be undone.'
),
t
(
'Delete'
),
t
(
'Cancel'
));
}
/**
...
...
@@ -901,18 +904,21 @@ function taxonomy_term_confirm_delete_submit($form, &$form_state) {
function
taxonomy_vocabulary_confirm_delete
(
$form
,
&
$form_state
,
$vid
)
{
$vocabulary
=
taxonomy_vocabulary_load
(
$vid
);
// Always provide entity id in the same form key as in the entity edit form.
$form
[
'vid'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$vid
);
$form
[
'#vocabulary'
]
=
$vocabulary
;
$form
[
'#id'
]
=
'taxonomy_vocabulary_confirm_delete'
;
$form
[
'type'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
'vocabulary'
);
$form
[
'vid'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$vid
);
$form
[
'name'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$vocabulary
->
name
);
$form
[
'#submit'
]
=
array
(
'taxonomy_vocabulary_confirm_delete_submit'
);
return
confirm_form
(
$form
,
t
(
'Are you sure you want to delete the vocabulary %title?'
,
array
(
'%title'
=>
$vocabulary
->
name
)),
'admin/structure/taxonomy'
,
t
(
'Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'
),
t
(
'Delete'
),
t
(
'Cancel'
));
t
(
'Are you sure you want to delete the vocabulary %title?'
,
array
(
'%title'
=>
$vocabulary
->
name
)),
'admin/structure/taxonomy'
,
t
(
'Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'
),
t
(
'Delete'
),
t
(
'Cancel'
));
}
/**
...
...
modules/user/user.pages.inc
View file @
fd7a3244
...
...
@@ -388,6 +388,8 @@ function user_cancel_confirm_form($form, &$form_state, $account) {
}
}
// Always provide entity id in the same form key as in the entity edit form.
$form
[
'uid'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$account
->
uid
);
return
confirm_form
(
$form
,
$question
,
'user/'
.
$account
->
uid
,
...
...
Write
Preview
Markdown
is supported
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