summaryrefslogtreecommitdiff
path: root/modules/locale/locale.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-06-27 19:10:52 +0000
committerDries Buytaert <dries@buytaert.net>2004-06-27 19:10:52 +0000
commit1b1c47025a0ab84f6dcf8cce9650f3af03415905 (patch)
tree277c086ec2d592118be8fe58b1127968a682d228 /modules/locale/locale.module
parent83851509f62bf240bd11433b03ba78cd1860420f (diff)
downloadbrdo-1b1c47025a0ab84f6dcf8cce9650f3af03415905.tar.gz
brdo-1b1c47025a0ab84f6dcf8cce9650f3af03415905.tar.bz2
I refactored quite a bit of the user.module:
$ diffstat user.patch database/database.mysql | 4 database/database.pgsql | 2 database/updates.inc | 10 - modules/block.module | 20 +- modules/locale.module | 9 modules/profile.module | 108 +++++++---- modules/system.module | 8 modules/user.module | 456 +++++++++++++++++++----------------------------- 8 files changed, 289 insertions(+), 328 deletions(-) More functionality, less code. Here is a list of the changes: - Some user API changes: + When $type is 'form', you have to return an associative array of groups. In turn, each group is an array with a 'title', 'data' and 'weight'. + A new $type has been added, namely 'categories'. User settings can be organized in categories. Categories can be sorted, as can the groups within a category. (Ordering 'categories' is somewhat broken due to a bug in the menu system.) - The 'my account > edit' page will use subtabs for each 'category'. Read: you can break down the account settings into multiple subpages. - Profile module improvements: + Added support for private fields to the profile module! + Improved workflow of profile administration pages. + Improved the form descriptions. - Code improvements: + Unified user_edit() and user_admin_edit(). + Unified and cleaned up the validation code. Fixed some validation glitches too.
Diffstat (limited to 'modules/locale/locale.module')
-rw-r--r--modules/locale/locale.module9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index d5a3a0f13..48e2ae528 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -92,10 +92,13 @@ function locale_menu() {
/**
* Implementation of hook_user(). Allows each user to select an interface language.
*/
-function locale_user($type, &$edit, &$user) {
+function locale_user($type, &$edit, &$user, $category = NULL) {
global $languages;
- if ($type == 'form' && count($languages) > 1) {
- return array(t('Locale settings') => form_radios(t('Language'), 'language', $user->language, $languages, t('Selecting a different language will change the language of the site.')));
+ if ($type == 'form' && count($languages) > 1 && $category == 'account') {
+ return array(array(
+ 'title' => t('Locale settings'),
+ 'data' => form_radios(t('Language'), 'language', $user->language, $languages, t('Selecting a different language will change the language of the site.')),
+ 'weight' => 2));
}
}