From 1c55ed7d88d6dd23458e4cec68e6321965d98a02 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 27 Jul 2007 13:08:17 +0000 Subject: - Patch #162486 by Eaton: user/%user/edit/foo tabs only appear if additional profile categories have been defined. --- modules/user/user.module | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'modules/user/user.module') 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; -- cgit v1.2.3