summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2007-06-22 08:32:28 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2007-06-22 08:32:28 +0000
commitfe8b35f52778b63b96c969da27d2929beee8c1b9 (patch)
treebb7a2a5014006acb1fc893e29299f2dc77918327 /modules
parent39a0ee0264f2e6e88b66e983e53bbf8a98072d3b (diff)
downloadbrdo-fe8b35f52778b63b96c969da27d2929beee8c1b9.tar.gz
brdo-fe8b35f52778b63b96c969da27d2929beee8c1b9.tar.bz2
#153781: Convert all remaining confirm_forms() to deletion api.
Diffstat (limited to 'modules')
-rw-r--r--modules/block/block.module2
-rw-r--r--modules/contact/contact.module2
-rw-r--r--modules/filter/filter.module10
-rw-r--r--modules/forum/forum.module4
-rw-r--r--modules/menu/menu.module10
-rw-r--r--modules/node/content_types.inc4
-rw-r--r--modules/node/node.module7
-rw-r--r--modules/path/path.module3
-rw-r--r--modules/profile/profile.module6
-rw-r--r--modules/search/search.module7
-rw-r--r--modules/system/system.module20
-rw-r--r--modules/taxonomy/taxonomy.module14
-rw-r--r--modules/user/user.module17
13 files changed, 68 insertions, 38 deletions
diff --git a/modules/block/block.module b/modules/block/block.module
index 0de6aec17..a276b3df7 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -566,7 +566,7 @@ function block_box_delete($bid = 0) {
$form['info'] = array('#type' => 'hidden', '#value' => $box['info'] ? $box['info'] : $box['title']);
$form['bid'] = array('#type' => 'hidden', '#value' => $bid);
- return confirm_form($form, t('Are you sure you want to delete the block %name?', array('%name' => $box['info'])), 'admin/build/block', '', t('Delete'), t('Cancel'));
+ return confirm_form($form, t('Are you sure you want to delete the block %name?', array('%name' => $box['info'])), 'admin/build/block');
}
/**
diff --git a/modules/contact/contact.module b/modules/contact/contact.module
index 0b983b061..dad3f3e08 100644
--- a/modules/contact/contact.module
+++ b/modules/contact/contact.module
@@ -265,7 +265,7 @@ function contact_admin_delete(&$form_state, $cid = NULL) {
'#value' => $info->category,
);
- return confirm_form($form, t('Are you sure you want to delete %category?', array('%category' => $info->category)), 'admin/build/contact', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
+ return confirm_form($form, t('Are you sure you want to delete %category?', array('%category' => $info->category)), 'admin/build/contact');
}
else {
drupal_set_message(t('Category not found.'), 'error');
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 2683990fc..c2cbc7728 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -32,15 +32,15 @@ function filter_help($section) {
<p>Below you can configure which input formats are available to which roles, as well as choose a default input format (used for imported content, for example).</p>
<p>Note that (1) the default format is always available to all roles, and (2) all filter formats can always be used by roles with the "administer filters" permission even if they are not explicitly listed in the Roles column of this table.</p>');
- case 'admin/settings/filters/'. arg(3):
+ case 'admin/settings/filters/'. ((int)arg(3)):
return t('
<p>Every <em>filter</em> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format.</p>
<p>If you notice some filters are causing conflicts in the output, you can <a href="@rearrange">rearrange them</a>.</p>', array('@rearrange' => url('admin/settings/filters/'. arg(3) .'/order')));
- case 'admin/settings/filters/'. arg(3) .'/configure':
+ case 'admin/settings/filters/'. ((int)arg(3)) .'/configure':
return '<p>'. t('If you cannot find the settings for a certain filter, make sure you have enabled it on the <a href="@url">view tab</a> first.', array('@url' => url('admin/settings/filters/'. arg(3)))) .'</p>';
- case 'admin/settings/filters/'. arg(3) .'/order':
+ case 'admin/settings/filters/'. ((int)arg(3)) .'/order':
return t('
<p>Because of the flexible filtering system, you might encounter a situation where one filter prevents another from doing its job. For example: a word in an URL gets converted into a glossary term, before the URL can be converted in a clickable link. When this happens, you will need to rearrange the order in which filters get executed.</p>
<p>Filters are executed from top-to-bottom. You can use the weight column to rearrange them: heavier filters "sink" to the bottom.</p>');
@@ -337,7 +337,9 @@ function filter_admin_delete() {
$form['format'] = array('#type' => 'hidden', '#value' => $format->format);
$form['name'] = array('#type' => 'hidden', '#value' => $format->name);
- return confirm_form($form, t('Are you sure you want to delete the input format %format?', array('%format' => $format->name)), 'admin/settings/filters', t('If you have any content left in this input format, it will be switched to the default input format. This action cannot be undone.'), t('Delete'), t('Cancel'));
+ $options = array('description' => t('If you have any content left in this input format, it will be switched to the default input format. This action cannot be undone.'));
+
+ return confirm_form($form, t('Are you sure you want to delete the input format %format?', array('%format' => $format->name)), 'admin/settings/filters', $options);
}
else {
drupal_set_message(t('The default format cannot be deleted.'));
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 893cc3821..2130a2ea7 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -610,7 +610,9 @@ function forum_confirm_delete(&$form_state, $tid) {
$form['tid'] = array('#type' => 'value', '#value' => $tid);
$form['name'] = array('#type' => 'value', '#value' => $term->name);
- return confirm_form($form, t('Are you sure you want to delete the forum %name?', array('%name' => $term->name)), 'admin/content/forum', t('Deleting a forum or container will delete all sub-forums and associated posts as well. This action cannot be undone.'), t('Delete'), t('Cancel'));
+ $options = array('description' => t('Deleting a forum or container will delete all sub-forums and associated posts as well. This action cannot be undone.'));
+
+ return confirm_form($form, t('Are you sure you want to delete the forum %name?', array('%name' => $term->name)), 'admin/content/forum', $options);
}
/**
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 1af1cec97..424d9d75a 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -464,7 +464,7 @@ function menu_item_delete_form(&$form_state, $mlid) {
}
$form['#item'] = $item;
- return confirm_form($form, t('Are you sure you want to delete the custom menu item %item?', array('%item' => $item['link_title'])), 'admin/build/menu/'. $item['menu_name'], t('This action cannot be undone.'), t('Delete'));
+ return confirm_form($form, t('Are you sure you want to delete the custom menu item %item?', array('%item' => $item['link_title'])), 'admin/build/menu/'. $item['menu_name']);
}
/**
@@ -485,7 +485,13 @@ function menu_item_delete_form_submit($form, &$form_state) {
function menu_reset_item(&$form_state, $mlid) {
if (isset($mlid) && $item = db_fetch_array(db_query('SELECT router_path, link_title FROM {menu_links} WHERE mlid = %d', $mlid))) {
$form['#router_path'] = $item['router_path'];
- return confirm_form($form, t('Are you sure you want to reset the item %item to its default values?', array('%item' => $item['link_title'])), 'admin/build/menu', t('Any customizations will be lost. This action cannot be undone.'), t('Reset'));
+
+ $options = array(
+ 'description' => t('Any customizations will be lost. This action cannot be undone.'),
+ 'yes' => t('Reset')
+ );
+
+ return confirm_form($form, t('Are you sure you want to reset the item %item to its default values?', array('%item' => $item['link_title'])), 'admin/build/menu', $options);
}
else {
drupal_not_found();
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index d4999d637..8340544c5 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -392,7 +392,9 @@ function node_type_delete_confirm(&$form_state, $type) {
$caption .= '<p>'. t('This action cannot be undone.') .'</p>';
- return confirm_form($form, $message, 'admin/content/types', $caption, t('Delete'));
+ $options = array('description' => $caption);
+
+ return confirm_form($form, $message, 'admin/content/types', $options);
}
/**
diff --git a/modules/node/node.module b/modules/node/node.module
index 7bc971b97..aa2f79ede 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1078,8 +1078,13 @@ function node_configure_validate($form, &$form_state) {
* Menu callback: confirm rebuilding of permissions.
*/
function node_configure_rebuild_confirm() {
+ $options = array(
+ 'description' => t('This will wipe all current node permissions and rebuild them based on current settings. Rebuilding the permissions may take a while so please be patient. This action cannot be undone.'),
+ 'yes' => t('Rebuild permissions')
+ );
+
return confirm_form(array(), t('Are you sure you want to rebuild node permissions on the site?'),
- 'admin/content/node-settings', t('This will wipe all current node permissions and rebuild them based on current settings. Rebuilding the permissions may take a while so please be patient. This action cannot be undone.'), t('Rebuild permissions'), t('Cancel'));
+ 'admin/content/node-settings', $options);
}
/**
diff --git a/modules/path/path.module b/modules/path/path.module
index 9900d6641..5a663e77b 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -96,8 +96,7 @@ function path_admin_delete_confirm($pid) {
$form['pid'] = array('#type' => 'value', '#value' => $pid);
$output = confirm_form($form,
t('Are you sure you want to delete path alias %title?', array('%title' => $path['dst'])),
- isset($_GET['destination']) ? $_GET['destination'] : 'admin/build/path', t('This action cannot be undone.'),
- t('Delete'), t('Cancel') );
+ isset($_GET['destination']) ? $_GET['destination'] : 'admin/build/path');
}
return $output;
}
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 098ef9ed7..c973986af 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -398,10 +398,10 @@ function profile_field_delete(&$form_state, $fid) {
$form['fid'] = array('#type' => 'value', '#value' => $fid);
$form['title'] = array('#type' => 'value', '#value' => $field->title);
+ $options = array('description' => t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="@edit-field">edit this field</a> and change it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => url('admin/user/profile/edit/'. $fid))));
+
return confirm_form($form,
- t('Are you sure you want to delete the field %field?', array('%field' => $field->title)), 'admin/user/profile',
- t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="@edit-field">edit this field</a> and change it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => url('admin/user/profile/edit/'. $fid))),
- t('Delete'), t('Cancel'));
+ t('Are you sure you want to delete the field %field?', array('%field' => $field->title)), 'admin/user/profile', $options);
}
/**
diff --git a/modules/search/search.module b/modules/search/search.module
index 8f5abbf44..1ac901a75 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -262,8 +262,13 @@ function search_admin_settings() {
* Menu callback: confirm wiping of the index.
*/
function search_wipe_confirm() {
+ $options = array(
+ 'description' => t(' The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed. This action cannot be undone.'),
+ 'yes' => t('Re-index site')
+ );
+
return confirm_form(array(), t('Are you sure you want to re-index the site?'),
- 'admin/settings/search', t(' The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed. This action cannot be undone.'), t('Re-index site'), t('Cancel'));
+ 'admin/settings/search', $options);
}
/**
diff --git a/modules/system/system.module b/modules/system/system.module
index 3b221f204..2d1f019ae 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1641,14 +1641,18 @@ function system_modules_confirm_form($modules, $storage) {
$form['text'] = array('#value' => theme('item_list', $items));
if ($form) {
+ $options = array(
+ 'description' => t('Would you like to continue with enabling the above?'),
+ 'yes' => t('Continue'),
+ );
+
// Set some default form values
$form = confirm_form(
$form,
t('Some required modules must be enabled'),
'admin/build/modules',
- t('Would you like to continue with enabling the above?'),
- t('Continue'),
- t('Cancel'));
+ $options);
+
return $form;
}
}
@@ -1929,13 +1933,17 @@ function system_modules_uninstall_confirm_form($storage) {
$form['#confirmed'] = TRUE;
$form['uninstall']['#tree'] = TRUE;
$form['modules'] = array('#value' => '<p>'. t('The following modules will be completely uninstalled from your site, and <em>all data from these modules will be lost</em>!') .'</p>'. theme('item_list', $uninstall));
+
+ $options = array(
+ 'description' => t('Would you like to continue with uninstalling the above?'),
+ 'yes' => t('Uninstall')
+ );
+
$form = confirm_form(
$form,
t('Confirm uninstall'),
'admin/build/modules/uninstall',
- t('Would you like to continue with uninstalling the above?'),
- t('Uninstall'),
- t('Cancel'));
+ $options);
return $form;
}
}
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 8db4a3457..17e169f8c 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -384,13 +384,14 @@ function taxonomy_vocabulary_confirm_delete(&$form_state, $vid) {
$form['type'] = array('#type' => 'value', '#value' => 'vocabulary');
$form['vid'] = array('#type' => 'value', '#value' => $vid);
$form['name'] = array('#type' => 'value', '#value' => $vocabulary->name);
+
+ $options = array('description' => t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'));
+
return confirm_form($form,
t('Are you sure you want to delete the vocabulary %title?',
array('%title' => $vocabulary->name)),
'admin/content/taxonomy',
- t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'),
- t('Delete'),
- t('Cancel'));
+ $options);
}
function taxonomy_vocabulary_confirm_delete_submit($form, &$form_state) {
@@ -620,13 +621,14 @@ function taxonomy_term_confirm_delete(&$form_state, $tid) {
$form['type'] = array('#type' => 'value', '#value' => 'term');
$form['name'] = array('#type' => 'value', '#value' => $term->name);
$form['tid'] = array('#type' => 'value', '#value' => $tid);
+
+ $options = array('description' => t('Deleting a term will delete all its children if there are any. This action cannot be undone.'));
+
return confirm_form($form,
t('Are you sure you want to delete the term %title?',
array('%title' => $term->name)),
'admin/content/taxonomy',
- t('Deleting a term will delete all its children if there are any. This action cannot be undone.'),
- t('Delete'),
- t('Cancel'));
+ $options);
}
function taxonomy_term_confirm_delete_submit($form, &$form_state) {
diff --git a/modules/user/user.module b/modules/user/user.module
index c790bee9b..9d90d30ad 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1607,11 +1607,12 @@ function user_edit($form_state, $category = 'account') {
}
function user_confirm_delete($name, $uid) {
+ $options = array('description' => t('All submissions made by this user will be attributed to the anonymous account. This action cannot be undone.'));
+
return confirm_form(array(),
t('Are you sure you want to delete the account %name?', array('%name' => $name)),
'user/'. $uid,
- t('All submissions made by this user will be attributed to the anonymous account. This action cannot be undone.'),
- t('Delete'), t('Cancel'));
+ $options);
}
/**
@@ -1663,7 +1664,7 @@ function user_view($account) {
// Retrieve all profile fields and store data in content element.
$account->content = user_build_content($account);
drupal_set_title(check_plain($account->name));
- /**
+ /**
* To theme user profiles, copy modules/user/user_profile.tpl.php
* to your theme directory, and edit it as instructed in that file's comments.
*/
@@ -1844,10 +1845,7 @@ function user_admin_access_delete_confirm($aid = 0) {
$form['aid'] = array('#type' => 'hidden', '#value' => $aid);
$output = confirm_form($form,
t('Are you sure you want to delete the @type rule for %rule?', array('@type' => $access_types[$edit->type], '%rule' => $edit->mask)),
- 'admin/user/rules',
- t('This action cannot be undone.'),
- t('Delete'),
- t('Cancel'));
+ 'admin/user/rules');
return $output;
}
@@ -2448,10 +2446,11 @@ function user_multiple_delete_confirm(&$form_state) {
}
$form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
+ $options = array('yes' => t('Delete all'));
+
return confirm_form($form,
t('Are you sure you want to delete these users?'),
- 'admin/user/user', t('This action cannot be undone.'),
- t('Delete all'), t('Cancel'));
+ 'admin/user/user', $options);
}
function user_multiple_delete_confirm_submit($form, &$form_state) {