@@ -22,8 +22,12 @@ index 38e4f77..990dfdc 100644 + * @param $path + * The path to use when finding the active trail. + */ -+function menu_tree_set_path($menu_name, $path) { -+ return menu_tree_get_path($menu_name, $path); ++function menu_tree_set_path($menu_name, $path = NULL) { ++ $paths = &drupal_static(__FUNCTION__); ++ if (isset($path)) { ++ $paths[$menu_name] = $path; ++ } ++ return isset($paths[$menu_name]) ? $paths[$menu_name] : NULL; +} + +/** @@ -31,26 +35,20 @@ index 38e4f77..990dfdc 100644 + * + * @param $menu_name + * The menu name of the requested tree. -+ * @param $path -+ * Internal use only. + * + * @return + * A string containing the path. If no path has been specified with + * menu_tree_set_path(), NULL is returned. + */ -+function menu_tree_get_path($menu_name, $path = NULL) { -+ $paths = &drupal_static(__FUNCTION__); -+ if (isset($path)) { -+ $paths[$menu_name] = $path; -+ } -+ return isset($paths[$menu_name]) ? $paths[$menu_name] : NULL; ++function menu_tree_get_path($menu_name) { ++ return menu_tree_set_path($menu_name); +} + +/** * Get the data structure representing a named menu tree, based on the current page. * * The tree order is maintained by storing each parent in an individual