summaryrefslogtreecommitdiff
path: root/modules/profile/profile.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-05-14 13:43:38 +0000
committerDries Buytaert <dries@buytaert.net>2007-05-14 13:43:38 +0000
commitac65ff9074223e7b09c1c609c9d82da45b28aa55 (patch)
tree21efe0a7607d7836de38a58f75ba85c073df9ead /modules/profile/profile.module
parented768b53c0337cbd632d3ad208a60a48fcc50496 (diff)
downloadbrdo-ac65ff9074223e7b09c1c609c9d82da45b28aa55.tar.gz
brdo-ac65ff9074223e7b09c1c609c9d82da45b28aa55.tar.bz2
- Patch #138706 by eaton, chx, webchick, yched et al: form api 3 ... yay. :)
Diffstat (limited to 'modules/profile/profile.module')
-rw-r--r--modules/profile/profile.module12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 93fccc078..af6d23d84 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -331,7 +331,7 @@ Unless you know what you are doing, it is highly recommended that you prefix the
/**
* Validate profile_field_form submissions.
*/
-function profile_field_form_validate($form_id, $form_values) {
+function profile_field_form_validate($form_values, $form, &$form_state) {
// Validate the 'field name':
if (preg_match('/[^a-zA-Z0-9_-]/', $form_values['name'])) {
form_set_error('name', t('The specified form name contains one or more illegal characters. Spaces or any other special characters except dash (-) and underscore (_) are not allowed.'));
@@ -367,7 +367,7 @@ function profile_field_form_validate($form_id, $form_values) {
/**
* Process profile_field_form submissions.
*/
-function profile_field_form_submit($form_id, $form_values) {
+function profile_field_form_submit($form_values, $form, &$form_state) {
if (!isset($form_values['fid'])) {
db_query("INSERT INTO {profile_fields} (title, name, explanation, category, type, weight, required, register, visibility, autocomplete, options, page) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d, '%s', '%s')", $form_values['title'], $form_values['name'], $form_values['explanation'], $form_values['category'], $form_values['type'], $form_values['weight'], $form_values['required'], $form_values['register'], $form_values['visibility'], $form_values['autocomplete'], $form_values['options'], $form_values['page']);
@@ -382,7 +382,8 @@ function profile_field_form_submit($form_id, $form_values) {
cache_clear_all();
menu_rebuild();
- return 'admin/user/profile';
+ $form_state['redirect'] = 'admin/user/profile';
+ return;
}
/**
@@ -406,7 +407,7 @@ function profile_field_delete($fid) {
/**
* Process a field delete form submission.
*/
-function profile_field_delete_submit($form_id, $form_values) {
+function profile_field_delete_submit($form_values, $form, &$form_state) {
db_query('DELETE FROM {profile_fields} WHERE fid = %d', $form_values['fid']);
db_query('DELETE FROM {profile_values} WHERE fid = %d', $form_values['fid']);
@@ -415,7 +416,8 @@ function profile_field_delete_submit($form_id, $form_values) {
drupal_set_message(t('The field %field has been deleted.', array('%field' => $form_values['title'])));
watchdog('profile', 'Profile field %field deleted.', array('%field' => $form_values['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/user/profile'));
- return 'admin/user/profile';
+ $form_state['redirect'] = 'admin/user/profile';
+ return;
}
/**