diff --git a/modules/block.module b/modules/block.module index d18c84b1560..b89075f4aa8 100644 --- a/modules/block.module +++ b/modules/block.module @@ -321,7 +321,7 @@ function block_admin() { } } -function block_user($type, &$edit, &$user) { +function block_user($type, $edit, &$user) { switch ($type) { case "edit_form": $result = db_query("SELECT * FROM {blocks} WHERE custom = %d ORDER BY module, delta", 1); diff --git a/modules/block/block.module b/modules/block/block.module index d18c84b1560..b89075f4aa8 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -321,7 +321,7 @@ function block_admin() { } } -function block_user($type, &$edit, &$user) { +function block_user($type, $edit, &$user) { switch ($type) { case "edit_form": $result = db_query("SELECT * FROM {blocks} WHERE custom = %d ORDER BY module, delta", 1); diff --git a/modules/profile.module b/modules/profile.module index d74b75e125f..63833201631 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -75,7 +75,7 @@ function profile_settings() { $row[$i][] = form_checkbox("", "profile_required_fields][", $key, in_array($key, $profile_required_fields)); $i++; } - + $avatar = form_textfield(t("Avatar image path"), "profile_avatar_path", variable_get("profile_avatar_path", "avatars"), 30, 255, t("Subdirectory in the directory '%dir' where avatars will be stored.", array('%dir' => variable_get('file_directory_path', 'files') . FILE_SEPARATOR)) . $error['profile_avatar_path']); $avatar .= form_textfield(t("Avatar maximum dimensions"), "profile_avatar_dimensions", variable_get("profile_avatar_dimensions", "85x85"), 10, 10, t("Maximum dimensions for avatars.")); $avatar .= form_textfield(t("Avatar maximum file size"), "profile_avatar_file_size", variable_get("profile_avatar_file_size", "30"), 10, 10, t("Maximum file size for avatars, in kB.")); diff --git a/modules/profile/profile.module b/modules/profile/profile.module index d74b75e125f..63833201631 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -75,7 +75,7 @@ function profile_settings() { $row[$i][] = form_checkbox("", "profile_required_fields][", $key, in_array($key, $profile_required_fields)); $i++; } - + $avatar = form_textfield(t("Avatar image path"), "profile_avatar_path", variable_get("profile_avatar_path", "avatars"), 30, 255, t("Subdirectory in the directory '%dir' where avatars will be stored.", array('%dir' => variable_get('file_directory_path', 'files') . FILE_SEPARATOR)) . $error['profile_avatar_path']); $avatar .= form_textfield(t("Avatar maximum dimensions"), "profile_avatar_dimensions", variable_get("profile_avatar_dimensions", "85x85"), 10, 10, t("Maximum dimensions for avatars.")); $avatar .= form_textfield(t("Avatar maximum file size"), "profile_avatar_file_size", variable_get("profile_avatar_file_size", "30"), 10, 10, t("Maximum file size for avatars, in kB.")); diff --git a/modules/system.module b/modules/system.module index ea5e703b8c6..cf1d72d5c8d 100644 --- a/modules/system.module +++ b/modules/system.module @@ -76,9 +76,9 @@ function system_link($type) { } } -function system_user($type, &$edit, $user) { +function system_user($type, $edit, &$user) { if ($type == "edit_form") { - $options = "\n"; + $options = "\n"; if (count($themes = list_themes()) > 1) { foreach ($themes as $key => $value) { $options .= "\n"; @@ -92,9 +92,11 @@ function system_user($type, &$edit, $user) { $zones["$zone"] = date(variable_get("date_format_long", "l, F dS, Y - g:ia"), time() - date("Z") + $zone) . sprintf(" (GMT %s%02d:%02d)\n", ($offset >= 0) ? "+" : "-", floor(abs($offset)), (abs($offset) * 60) % 60); } $data[t('Locale settings')] = form_select(t("Time zone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your time zone settings will be set appropriate.")); + return $data; + } + else { + return $edit; } - - return $data; } function system_view_general() { diff --git a/modules/system/system.module b/modules/system/system.module index ea5e703b8c6..cf1d72d5c8d 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -76,9 +76,9 @@ function system_link($type) { } } -function system_user($type, &$edit, $user) { +function system_user($type, $edit, &$user) { if ($type == "edit_form") { - $options = "\n"; + $options = "\n"; if (count($themes = list_themes()) > 1) { foreach ($themes as $key => $value) { $options .= "\n"; @@ -92,9 +92,11 @@ function system_user($type, &$edit, $user) { $zones["$zone"] = date(variable_get("date_format_long", "l, F dS, Y - g:ia"), time() - date("Z") + $zone) . sprintf(" (GMT %s%02d:%02d)\n", ($offset >= 0) ? "+" : "-", floor(abs($offset)), (abs($offset) * 60) % 60); } $data[t('Locale settings')] = form_select(t("Time zone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your time zone settings will be set appropriate.")); + return $data; + } + else { + return $edit; } - - return $data; } function system_view_general() { diff --git a/modules/user.module b/modules/user.module index a46fe3809e3..75eca8a8792 100644 --- a/modules/user.module +++ b/modules/user.module @@ -951,7 +951,7 @@ function user_edit($edit = array()) { $output .= form_textfield(t("E-mail address"), "mail", $edit['mail'], 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.")); $output .= form_item(t("Password"), " ", t("Enter your new password twice if you want to change your current password or leave it blank if you are happy with your current password.")); $output = form_group(t('Account information'), $output); - $output .= _user_settings(); + $output .= _user_profile($user); $output .= form_submit(t("Save user information")); $output = form($output, "post", 0, array("enctype" => "multipart/form-data")); @@ -964,10 +964,10 @@ function user_edit($edit = array()) { return $output; } -function _user_settings($style = 'edit_form') { +function _user_profile($account) { foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', $style, $edit, $user)) { + if ($data = module_invoke($module, 'user', 'edit_form', $edit, $account)) { foreach ($data as $title => $form) { $groups[$title] .= $form; } @@ -1433,13 +1433,13 @@ function user_admin_edit($edit = array()) { $output .= form_item(t("User ID"), $account->uid); $output .= form_textfield(t("Username"), 'name', $account->name, 30, 55, t("Your full name or your preferred username: only letters, numbers and spaces are allowed.")); $output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.")); - - $output .= implode("\n", module_invoke_all('user', "edit_form", $edit, $account)); - $output .= form_item(t("Password"), " ", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password.")); - $output .= form_radios(t("Status"), "status", $account->status, array(t("blocked"), t("active"))); + $output .= form_radios(t("Status"), "status", $account->status, array(t("Blocked"), t("Active"))); $output .= form_radios(t("Role"), "rid", $account->rid, user_roles(1)); + $output = form_group(t('Account information'), $output); + $output .= _user_profile($account); + $output .= form_submit(t("Save account")); $output .= form_submit(t("Delete account")); diff --git a/modules/user/user.module b/modules/user/user.module index a46fe3809e3..75eca8a8792 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -951,7 +951,7 @@ function user_edit($edit = array()) { $output .= form_textfield(t("E-mail address"), "mail", $edit['mail'], 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.")); $output .= form_item(t("Password"), " ", t("Enter your new password twice if you want to change your current password or leave it blank if you are happy with your current password.")); $output = form_group(t('Account information'), $output); - $output .= _user_settings(); + $output .= _user_profile($user); $output .= form_submit(t("Save user information")); $output = form($output, "post", 0, array("enctype" => "multipart/form-data")); @@ -964,10 +964,10 @@ function user_edit($edit = array()) { return $output; } -function _user_settings($style = 'edit_form') { +function _user_profile($account) { foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', $style, $edit, $user)) { + if ($data = module_invoke($module, 'user', 'edit_form', $edit, $account)) { foreach ($data as $title => $form) { $groups[$title] .= $form; } @@ -1433,13 +1433,13 @@ function user_admin_edit($edit = array()) { $output .= form_item(t("User ID"), $account->uid); $output .= form_textfield(t("Username"), 'name', $account->name, 30, 55, t("Your full name or your preferred username: only letters, numbers and spaces are allowed.")); $output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.")); - - $output .= implode("\n", module_invoke_all('user', "edit_form", $edit, $account)); - $output .= form_item(t("Password"), " ", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password.")); - $output .= form_radios(t("Status"), "status", $account->status, array(t("blocked"), t("active"))); + $output .= form_radios(t("Status"), "status", $account->status, array(t("Blocked"), t("Active"))); $output .= form_radios(t("Role"), "rid", $account->rid, user_roles(1)); + $output = form_group(t('Account information'), $output); + $output .= _user_profile($account); + $output .= form_submit(t("Save account")); $output .= form_submit(t("Delete account"));