You are here

function nice_menus_build_page_trail in Nice Menus 7.3

Same name and namespace in other branches
  1. 6.2 nice_menus.module \nice_menus_build_page_trail()
  2. 7.2 nice_menus.module \nice_menus_build_page_trail()

Builds the active trail from the page's menu data.

Parameters

array $page_menu: The menu data for a page.

Return value

mixed An array of parent menu item ids.

1 call to nice_menus_build_page_trail()
theme_nice_menus_tree in ./nice_menus.module
Builds the final Nice menu.

File

./nice_menus.module, line 348
Module to enable CSS dropdown and flyout menus.

Code

function nice_menus_build_page_trail($page_menu) {
  $trail = array();
  foreach ($page_menu as $item) {
    if ($item['link']['in_active_trail']) {
      $trail[] = $item['link']['mlid'];
    }
    if ($item['below']) {
      $trail = array_merge($trail, nice_menus_build_page_trail($item['below']));
    }
  }
  return $trail;
}