menu_get_active_nontask_item

5 menu.inc 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 calls to menu_get_active_nontask_item()

File

includes/menu.inc, line 472
API for the Drupal menu system.

Code

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'];
  }
}
Login or register to post comments