You are here

function power_menu_get_breadcrumbs in Power Menu 6

Same name and namespace in other branches
  1. 7.2 power_menu.module \power_menu_get_breadcrumbs()
  2. 7 power_menu.module \power_menu_get_breadcrumbs()

Set Breadcrumbs based on active menu trail. I borrowed this function from the menutrails module

2 calls to power_menu_get_breadcrumbs()
power_menu_link in ./power_menu.module
implementation of hook_link().
power_menu_nodeapi in ./power_menu.module
implementation of hook_nodeapi().

File

./power_menu.module, line 382
This module provides some additional menu features. The features are not actually new, but are part of other modules. it's though very cumbersome to creating a new menu item, because one has to go to all the different places to configure these…

Code

function power_menu_get_breadcrumbs() {
  $item = menu_get_item();

  // Give first priority to the selected menu.
  $menu = power_menu_get_menu();
  if (!$menu) {
    $menu = db_result(db_query("SELECT menu_name FROM {menu_links} WHERE link_path = '%s' AND module = 'menu'", $item['href']));
  }
  $tree = menu_tree_page_data($menu);
  $crumbs = array(
    l(t('Home'), '<front>'),
  );
  _power_menu_recurse_crumbs($tree, $item, $crumbs);
  return $crumbs;
}