You are here

function context_menu_navigation_links in Context 6.2

Same name and namespace in other branches
  1. 6 context.core.inc \context_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_menu_navigation_links()
context_preprocess_page in ./context.core.inc
Implementation of preprocess_page().

File

./context.core.inc, line 787

Code

function context_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.
  $active_paths = context_active_values('menu');
  if (!empty($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;
}