diff options
Diffstat (limited to 'modules/profile.module')
-rw-r--r-- | modules/profile.module | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/modules/profile.module b/modules/profile.module index adf8af224..d74b75e12 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -45,7 +45,7 @@ function profile_help($section) { $output = t("Support for configurable user profiles."); break; case 'admin/system/modules/profile': - $output = t("When a user creates an account you can ask for some extra information, as well as letting the user have a small picture, called an avatar.<br />Notes:<ul><li>In order for a user to enter information you <strong>must</strong> check \"enable\".</li><li>In order for other people too see the entered information you must make it \"public\".</li><li>If an item is \"public\", but not enabled, the user can never give it a value and it will never be seen. Public does <strong>not</strong> imply \"enable\".</li><li>If an item is enabled, but not shown in the registration form the user will have to <a href=\"%edit\">edit their account</a> to place information in the field.</ul>", array("%edit" => url("user/edit"))); + $output = t("When a user creates an account you can ask for some extra information, as well as letting the user have a small picture, called an avatar.<br />Notes:<ul><li>In order for a user to enter information you <strong>must</strong> check \"enable\".</li><li>In order for other people too see the entered information you must make it \"public\".</li><li>If an item is \"public\", but not enabled, the user can never give it a value and it will never be seen. Public does <strong>not</strong> imply \"enable\".</li></ul>", array("%edit" => url("user/edit"))); break; } return $output; @@ -53,6 +53,7 @@ function profile_help($section) { function profile_settings() { global $profile_fields; + if (!$profile_fields) { _profile_init(); } @@ -64,23 +65,23 @@ function profile_settings() { $profile_public_fields = variable_get("profile_public_fields", array()); $profile_private_fields = variable_get("profile_private_fields", array()); $profile_required_fields = variable_get("profile_required_fields", array()); - $profile_register_fields = variable_get("profile_register_fields", array()); - $header = array(t("field"), t("enable"), t("public"), t("required"), t("show in registration form")); + $header = array(t("field"), t("enable"), t("public"), t("required")); $i = 0; foreach ($profile_fields as $key => $field) { $row[$i][] = $field[1]; $row[$i][] = form_checkbox("", "profile_private_fields][", $key, in_array($key, $profile_private_fields)); $row[$i][] = form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)); $row[$i][] = form_checkbox("", "profile_required_fields][", $key, in_array($key, $profile_required_fields)); - $row[$i][] = form_checkbox("", "profile_register_fields][", $key, in_array($key, $profile_register_fields)); $i++; } - $output .= theme("table", $header, $row); + + $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.")); - $output .= 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']); - $output .= form_textfield(t("Avatar maximum dimensions"), "profile_avatar_dimensions", variable_get("profile_avatar_dimensions", "85x85"), 10, 10, t("Maximum dimensions for avatars.")); - $output .= 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.")); + $output = theme("table", $header, $row); + $output .= form_group(t('Avatars'), $avatar); return $output; } @@ -92,12 +93,6 @@ function profile_user($type, $edit, &$user) { } switch ($type) { - case "register_form": - // first registration form (to add something to just email and nick) - return _profile_form($edit, "register"); - case "register_validate": - // validate first registration form - return _profile_validate($edit, "required", $user); case "edit_form": // when user tries to edit his own data return _profile_form(object2array($user), "private"); @@ -143,7 +138,7 @@ function _profile_form($edit, $mode) { $output .= form_file($profile_fields["avatar"][1], "profile_avatar", 64, $profile_fields["avatar"][2]); } - return $output; + return array(t('Personal information') => $output); } function _profile_validate($edit, $mode, $user) { |