summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-07-27 13:08:17 +0000
committerDries Buytaert <dries@buytaert.net>2007-07-27 13:08:17 +0000
commit1c55ed7d88d6dd23458e4cec68e6321965d98a02 (patch)
treedea40ee5461a9e2046f43bdd68e8862d625d56e6 /modules
parent49ca29d1b2802e1775136c65ba00f001cb945224 (diff)
downloadbrdo-1c55ed7d88d6dd23458e4cec68e6321965d98a02.tar.gz
brdo-1c55ed7d88d6dd23458e4cec68e6321965d98a02.tar.bz2
- Patch #162486 by Eaton: user/%user/edit/foo tabs only appear if additional profile categories have been defined.
Diffstat (limited to 'modules')
-rw-r--r--modules/user/user.module22
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 418a451e5..b277d1f39 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -972,16 +972,24 @@ function user_menu() {
'type' => MENU_LOCAL_TASK,
);
+ $items['user/%user/edit/account'] = array(
+ 'title' => 'Account',
+ 'type' => MENU_DEFAULT_LOCAL_TASK,
+ );
+
$empty_account = new stdClass();
if (($categories = _user_categories($empty_account)) && (count($categories) > 1)) {
foreach ($categories as $key => $category) {
- $items['user/%user/edit/'. $category['name']] = array(
- 'title callback' => 'check_plain',
- 'title arguments' => array($category['title']),
- 'page arguments' => array('user_edit', 3),
- 'type' => $category['name'] == 'account' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
- 'weight' => $category['weight'],
- );
+ // 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK.
+ if ($category['name'] != 'account') {
+ $items['user/%user/edit/'. $category['name']] = array(
+ 'title callback' => 'check_plain',
+ 'title arguments' => array($category['title']),
+ 'page arguments' => array('user_edit', 3),
+ 'type' => MENU_LOCAL_TASK,
+ 'weight' => $category['weight'],
+ );
+ }
}
}
return $items;