From 1b1c47025a0ab84f6dcf8cce9650f3af03415905 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 27 Jun 2004 19:10:52 +0000 Subject: 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. --- modules/system/system.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/system') diff --git a/modules/system/system.module b/modules/system/system.module index e010c27bd..5fccde31e 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -94,14 +94,14 @@ function system_menu() { * * Allows users to individually set their theme and time zone. */ -function system_user($type, $edit, &$user) { - if ($type == 'form') { +function system_user($type, $edit, &$user, $category = NULL) { + if ($type == 'form' && $category == 'account') { $options = '\n"; if (count($themes = list_themes()) > 1) { foreach ($themes as $key => $value) { $options .= "\n"; } - $data[t('Theme settings')] = form_item(t('Theme'), "", t('Selecting a different theme will change the look and feel of the site.')); + $data[] = array('title' => t('Theme settings'), 'data' => form_item(t('Theme'), "", t('Selecting a different theme will change the look and feel of the site.')), 'weight' => 2); } if (!variable_get('sitewide_timezone', 0)) { @@ -111,7 +111,7 @@ function system_user($type, $edit, &$user) { $zone = $offset * 3600; $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') . ' O', $zone); } - $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 appropriately.')); + $data[] = array('title' => t('Locale settings'), 'data' => form_select(t('Time zone'), 'timezone', $edit['timezone'], $zones, t('Select what time you currently have and your time zone settings will be set appropriately.')), 'weight' => 2); } return $data; } -- cgit v1.2.3