mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Use tenant prefix when building menus
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Security;
|
||||
using Orchard.Security.Permissions;
|
||||
@@ -19,6 +20,7 @@ namespace Orchard.Core.Navigation.Services {
|
||||
private readonly IEnumerable<INavigationFilter> _navigationFilters;
|
||||
private readonly UrlHelper _urlHelper;
|
||||
private readonly IOrchardServices _orchardServices;
|
||||
private readonly ShellSettings _shellSettings;
|
||||
|
||||
public NavigationManager(
|
||||
IEnumerable<INavigationProvider> navigationProviders,
|
||||
@@ -26,13 +28,15 @@ namespace Orchard.Core.Navigation.Services {
|
||||
IAuthorizationService authorizationService,
|
||||
IEnumerable<INavigationFilter> navigationFilters,
|
||||
UrlHelper urlHelper,
|
||||
IOrchardServices orchardServices) {
|
||||
IOrchardServices orchardServices,
|
||||
ShellSettings shellSettings) {
|
||||
_navigationProviders = navigationProviders;
|
||||
_menuProviders = menuProviders;
|
||||
_authorizationService = authorizationService;
|
||||
_navigationFilters = navigationFilters;
|
||||
_urlHelper = urlHelper;
|
||||
_orchardServices = orchardServices;
|
||||
_shellSettings = shellSettings;
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
|
||||
@@ -90,6 +94,9 @@ namespace Orchard.Core.Navigation.Services {
|
||||
!(url.StartsWith("/") || schemes.Any(scheme => url.StartsWith(scheme + ":")))) {
|
||||
if (url.StartsWith("~/")) {
|
||||
url = url.Substring(2);
|
||||
if (!String.IsNullOrEmpty(_shellSettings.RequestUrlPrefix)) {
|
||||
url = _shellSettings.RequestUrlPrefix + "/" + url;
|
||||
}
|
||||
}
|
||||
if (!url.StartsWith("#")) {
|
||||
var appPath = _urlHelper.RequestContext.HttpContext.Request.ApplicationPath;
|
||||
|
||||
Reference in New Issue
Block a user