Renamed private method in NavigationHelper.

This commit is contained in:
Sipke Schoorstra
2016-06-16 21:55:07 +02:00
parent a5ac956b6a
commit 0a06a788b2

View File

@@ -81,8 +81,8 @@ namespace Orchard.UI.Navigation {
/// <returns>A stack with the selection path being the last node the currently selected one.</returns> /// <returns>A stack with the selection path being the last node the currently selected one.</returns>
public static Stack<MenuItem> SetSelectedPath(IEnumerable<MenuItem> menuItems, HttpRequestBase currentRequest, RouteValueDictionary currentRouteData) { public static Stack<MenuItem> SetSelectedPath(IEnumerable<MenuItem> menuItems, HttpRequestBase currentRequest, RouteValueDictionary currentRouteData) {
// doing route data comparison first and if that fails, fallback to string-based URL lookup // doing route data comparison first and if that fails, fallback to string-based URL lookup
var path = SetSelectedPath(menuItems, currentRequest, currentRouteData, false) var path = GetSelectedPath(menuItems, currentRequest, currentRouteData, false)
?? SetSelectedPath(menuItems, currentRequest, currentRouteData, true); ?? GetSelectedPath(menuItems, currentRequest, currentRouteData, true);
if(path != null) { if(path != null) {
foreach(var menuItem in path) { foreach(var menuItem in path) {
@@ -101,10 +101,10 @@ namespace Orchard.UI.Navigation {
/// <param name="currentRouteData">The current route data.</param> /// <param name="currentRouteData">The current route data.</param>
/// <param name="compareUrls">Should compare raw string URLs instead of route data.</param> /// <param name="compareUrls">Should compare raw string URLs instead of route data.</param>
/// <returns>A stack with the selection path being the last node the currently selected one.</returns> /// <returns>A stack with the selection path being the last node the currently selected one.</returns>
private static Stack<MenuItem> SetSelectedPath(IEnumerable<MenuItem> menuItems, HttpRequestBase currentRequest, RouteValueDictionary currentRouteData, bool compareUrls) { private static Stack<MenuItem> GetSelectedPath(IEnumerable<MenuItem> menuItems, HttpRequestBase currentRequest, RouteValueDictionary currentRouteData, bool compareUrls) {
var selectedPaths = new List<Stack<MenuItem>>(); var selectedPaths = new List<Stack<MenuItem>>();
foreach (MenuItem menuItem in menuItems) { foreach (MenuItem menuItem in menuItems) {
Stack<MenuItem> selectedPath = SetSelectedPath(menuItem.Items, currentRequest, currentRouteData, compareUrls); Stack<MenuItem> selectedPath = GetSelectedPath(menuItem.Items, currentRequest, currentRouteData, compareUrls);
if (selectedPath != null) { if (selectedPath != null) {
selectedPath.Push(menuItem); selectedPath.Push(menuItem);
if (compareUrls) { if (compareUrls) {