menu_node_edit_preprocess_page(&$vars)Create fake second-level tabs.
We could do this in hook_menu(), which is safer, but the sheer number of possible menu options makes it questionable.
Potentially, we could generate X menu items for Y users. So fake tabs seems more optimal here.
./menu_node_edit.module, line 836
<?php
function menu_node_edit_preprocess_page(&$vars) {
$menu = menu_get_item();
if ($menu['page_callback'] != 'menu_node_edit_page') {
return;
}
$account = $menu['map'][1];
$pages = menu_node_edit_get_pages($account);
// We cannot store sub-tabs for every possible user/section combination, so
// instead we add fake tabs.
if (count($pages) < 2) {
return;
}
// Now, make the fake second-level tabs.
$tabs = array();
foreach ($pages as $mlid => $title) {
$tabs[] = l($title, 'user/'. $account->uid .'/sections/'. $mlid);
}
$vars['tabs'] .= '</ul></div><div id ="menu-access"><ul class="tabs secondary">';
foreach ($tabs as $tab) {
$vars['tabs'] .= '<li>'. $tab . '</li>';
}
$vars['tabs'] .= '</ul><div class="clear"></div>';
}
?>