You are here

function _menu_get_active_trail in Drupal 4

Same name and namespace in other branches
  1. 5 includes/menu.inc \_menu_get_active_trail()

Returns an array with the menu items that lead to the current menu item.

2 calls to _menu_get_active_trail()
menu_get_active_breadcrumb in includes/menu.inc
Returns an array of rendered menu items in the active breadcrumb trail.
menu_in_active_trail in includes/menu.inc
Returns true when the menu item is in the active trail.

File

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

Code

function _menu_get_active_trail() {
  static $trail;
  if (!isset($trail)) {
    $trail = array();
    $mid = menu_get_active_item();

    // Follow the parents up the chain to get the trail.
    while ($mid && ($item = menu_get_item($mid))) {
      array_unshift($trail, $mid);
      $mid = $item['pid'];
    }
  }
  return $trail;
}