summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.admin.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-17 05:42:42 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-17 05:42:42 +0000
commitfd7a32443705f6b4adcf77a6d6480301f90d5858 (patch)
tree973ffefc89807e6d8248ca849eb0892b73b975a2 /modules/taxonomy/taxonomy.admin.inc
parent00319d8e9a8b35148a6856d3380d572c571b94dc (diff)
downloadbrdo-fd7a32443705f6b4adcf77a6d6480301f90d5858.tar.gz
brdo-fd7a32443705f6b4adcf77a6d6480301f90d5858.tar.bz2
#645374 follow-up by sun: Make entity ids available to confirm form submit handlers.
Diffstat (limited to 'modules/taxonomy/taxonomy.admin.inc')
-rw-r--r--modules/taxonomy/taxonomy.admin.inc34
1 files changed, 20 insertions, 14 deletions
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index 954a062f0..715246d92 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -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'));
}
/**