menu_get_active_nontask_item

  1. drupal
    1. 4.7
    2. 5
Versions
4.7 – 5 menu_get_active_nontask_item()

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.

Related topics

▾ 4 functions call menu_get_active_nontask_item()

menu_get_active_title in includes/menu.inc
Returns the title of the active menu item.
menu_get_local_tasks in includes/menu.inc
Return the local task tree.
menu_primary_local_tasks in includes/menu.inc
Returns the rendered HTML of the primary local tasks.
menu_secondary_local_tasks in includes/menu.inc
Returns the rendered HTML of the secondary local tasks.

Code

includes/menu.inc, line 473

<?php
function menu_get_active_nontask_item() {
  $mid = menu_get_active_item();

  // Find the first non-task item:
  while ($mid) {
    $item = menu_get_item($mid);

    if (!($item['type'] & MENU_IS_LOCAL_TASK)) {
      return $mid;
    }

    $mid = $item['pid'];
  }
}
?>