summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/profile.module20
-rw-r--r--modules/profile/profile.module20
2 files changed, 28 insertions, 12 deletions
diff --git a/modules/profile.module b/modules/profile.module
index 91a5896f5..64ae47fb4 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -558,12 +558,20 @@ function profile_admin_edit($fid) {
* Menu callback; deletes a field from all user profiles.
*/
function profile_admin_delete($fid) {
- db_query('DELETE FROM {profile_fields} WHERE fid = %d', $fid);
-
- cache_clear_all();
-
- drupal_set_message(t('The field has been deleted.'));
- drupal_goto('admin/settings/profile');
+ $field = db_fetch_object(db_query("SELECT title FROM {profile_fields} WHERE fid = %d", $fid));
+ if ($_POST['edit']['confirm']) {
+ db_query('DELETE FROM {profile_fields} WHERE fid = %d', $fid);
+ cache_clear_all();
+ drupal_set_message(t('The field %field has been deleted.', array('%field' => theme('placeholder', $field->title))));
+ drupal_goto('admin/settings/profile');
+ }
+ else {
+ $output = theme('confirm',
+ t('Do you want to remove the field %field?',
+ array('%field' => $field->title)),
+ 'admin/settings/profile');
+ return $output;
+ }
}
function _profile_field_form($type, $edit = array()) {
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 91a5896f5..64ae47fb4 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -558,12 +558,20 @@ function profile_admin_edit($fid) {
* Menu callback; deletes a field from all user profiles.
*/
function profile_admin_delete($fid) {
- db_query('DELETE FROM {profile_fields} WHERE fid = %d', $fid);
-
- cache_clear_all();
-
- drupal_set_message(t('The field has been deleted.'));
- drupal_goto('admin/settings/profile');
+ $field = db_fetch_object(db_query("SELECT title FROM {profile_fields} WHERE fid = %d", $fid));
+ if ($_POST['edit']['confirm']) {
+ db_query('DELETE FROM {profile_fields} WHERE fid = %d', $fid);
+ cache_clear_all();
+ drupal_set_message(t('The field %field has been deleted.', array('%field' => theme('placeholder', $field->title))));
+ drupal_goto('admin/settings/profile');
+ }
+ else {
+ $output = theme('confirm',
+ t('Do you want to remove the field %field?',
+ array('%field' => $field->title)),
+ 'admin/settings/profile');
+ return $output;
+ }
}
function _profile_field_form($type, $edit = array()) {