You are here

function context_reaction_menu::menu_navigation_links in Context 6

Same name and namespace in other branches
  1. 6.3 plugins/context_reaction_menu.inc \context_reaction_menu::menu_navigation_links()

Wrapper around menu_navigation_links() that gives themers the option of building navigation links based on an active context trail.

1 call to context_reaction_menu::menu_navigation_links()
context_reaction_menu::execute in plugins/context_reaction_menu.inc
If primary + secondary links are pointed at the same menu, provide contextual trailing by default.

File

plugins/context_reaction_menu.inc, line 121

Class

context_reaction_menu
Expose menu items as context reactions.

Code

function menu_navigation_links($menu_name, $level = 0) {

  // Retrieve original path so we can repair it after our hack.
  $original_path = $_GET['q'];

  // Retrieve the first active menu path found.
  if ($active_paths = $this
    ->get_active_paths()) {
    $path = current($active_paths);
    if (menu_get_item($path)) {
      menu_set_active_item($path);
    }
  }

  // Build the links requested
  $links = menu_navigation_links($menu_name, $level);

  // Repair and get out
  menu_set_active_item($original_path);
  return $links;
}