Commit 1c55ed7d authored by Dries's avatar Dries
Browse files

- Patch #162486 by Eaton: user/%user/edit/foo tabs only appear if additional...

- Patch #162486 by Eaton: user/%user/edit/foo tabs only appear if additional profile categories have been defined.
parent 49ca29d1
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment