menu_get_active_nontask_item()
drupal/includes/menu.inc, line 406
Returns the ID of the current menu item or, if the current item is a local task, the menu item to which this task is attached.
| Name | Description |
|---|---|
| Menu system | Define the navigation menus, and route page requests to code based on URLs. |
function menu_get_active_nontask_item() {
$menu = menu_get_menu();
$mid = menu_get_active_item();
// Find the first non-task item:
while ($mid && ($menu['items'][$mid]['type'] & MENU_IS_LOCAL_TASK)) {
$mid = $menu['items'][$mid]['pid'];
}
if ($mid) {
return $mid;
}
}