mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Merge
--HG-- branch : autoroute
This commit is contained in:
@@ -6,4 +6,4 @@ a1ef39ba4e2d0cd78b3c91d6150e841793acb34b src/Orchard.Web/Modules/Orchard.Routabl
|
|||||||
204bdef384f41bb5e463bed6b98a056945a7d839 src/Orchard.Web/Modules/Orchard.Rules
|
204bdef384f41bb5e463bed6b98a056945a7d839 src/Orchard.Web/Modules/Orchard.Rules
|
||||||
ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease
|
ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease
|
||||||
42d34730d8bb22052585ca94e3e945111aea3b9d src/Orchard.Web/Modules/Orchard.Tokens
|
42d34730d8bb22052585ca94e3e945111aea3b9d src/Orchard.Web/Modules/Orchard.Tokens
|
||||||
08eadecb5e5fae52e8b4c7d1c60f29e51c63b2ca src/orchard.web/modules/Orchard.Fields
|
1babbc24ce7e890ec95755c992c14c9ff4ed448d src/orchard.web/modules/Orchard.Fields
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using Orchard.Environment;
|
||||||
using Orchard.Events;
|
using Orchard.Events;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Logging;
|
using Orchard.Logging;
|
||||||
@@ -11,14 +12,14 @@ using Orchard.UI.Notify;
|
|||||||
namespace Orchard.Exceptions {
|
namespace Orchard.Exceptions {
|
||||||
public class DefaultExceptionPolicy : IExceptionPolicy {
|
public class DefaultExceptionPolicy : IExceptionPolicy {
|
||||||
private readonly INotifier _notifier;
|
private readonly INotifier _notifier;
|
||||||
private readonly Lazy<IAuthorizer> _authorizer;
|
private readonly Work<IAuthorizer> _authorizer;
|
||||||
|
|
||||||
public DefaultExceptionPolicy() {
|
public DefaultExceptionPolicy() {
|
||||||
Logger = NullLogger.Instance;
|
Logger = NullLogger.Instance;
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultExceptionPolicy(INotifier notifier, Lazy<IAuthorizer> authorizer) {
|
public DefaultExceptionPolicy(INotifier notifier, Work<IAuthorizer> authorizer) {
|
||||||
_notifier = notifier;
|
_notifier = notifier;
|
||||||
_authorizer = authorizer;
|
_authorizer = authorizer;
|
||||||
Logger = NullLogger.Instance;
|
Logger = NullLogger.Instance;
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.ServiceModel.Activation;
|
using System.ServiceModel.Activation;
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
using Autofac;
|
|
||||||
using Orchard.Environment;
|
using Orchard.Environment;
|
||||||
using Orchard.Environment.Configuration;
|
using Orchard.Environment.Configuration;
|
||||||
|
|
||||||
@@ -10,17 +9,17 @@ namespace Orchard.Mvc.Routes {
|
|||||||
public class RoutePublisher : IRoutePublisher {
|
public class RoutePublisher : IRoutePublisher {
|
||||||
private readonly RouteCollection _routeCollection;
|
private readonly RouteCollection _routeCollection;
|
||||||
private readonly ShellSettings _shellSettings;
|
private readonly ShellSettings _shellSettings;
|
||||||
private readonly ILifetimeScope _shellLifetimeScope;
|
private readonly IWorkContextAccessor _workContextAccessor;
|
||||||
private readonly IRunningShellTable _runningShellTable;
|
private readonly IRunningShellTable _runningShellTable;
|
||||||
|
|
||||||
public RoutePublisher(
|
public RoutePublisher(
|
||||||
RouteCollection routeCollection,
|
RouteCollection routeCollection,
|
||||||
ShellSettings shellSettings,
|
ShellSettings shellSettings,
|
||||||
ILifetimeScope shellLifetimeScope,
|
IWorkContextAccessor workContextAccessor,
|
||||||
IRunningShellTable runningShellTable) {
|
IRunningShellTable runningShellTable) {
|
||||||
_routeCollection = routeCollection;
|
_routeCollection = routeCollection;
|
||||||
_shellSettings = shellSettings;
|
_shellSettings = shellSettings;
|
||||||
_shellLifetimeScope = shellLifetimeScope;
|
_workContextAccessor = workContextAccessor;
|
||||||
_runningShellTable = runningShellTable;
|
_runningShellTable = runningShellTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ namespace Orchard.Mvc.Routes {
|
|||||||
|
|
||||||
// new routes are added
|
// new routes are added
|
||||||
foreach (var routeDescriptor in routesArray) {
|
foreach (var routeDescriptor in routesArray) {
|
||||||
ShellRoute shellRoute = new ShellRoute(routeDescriptor.Route, _shellSettings, _shellLifetimeScope, _runningShellTable);
|
var shellRoute = new ShellRoute(routeDescriptor.Route, _shellSettings, _workContextAccessor, _runningShellTable);
|
||||||
_routeCollection.Add(routeDescriptor.Name, shellRoute);
|
_routeCollection.Add(routeDescriptor.Name, shellRoute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,6 @@ using System.Web;
|
|||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
using System.Web.SessionState;
|
using System.Web.SessionState;
|
||||||
using Autofac;
|
|
||||||
using Orchard.Environment;
|
using Orchard.Environment;
|
||||||
using Orchard.Environment.Configuration;
|
using Orchard.Environment.Configuration;
|
||||||
using Orchard.Mvc.Extensions;
|
using Orchard.Mvc.Extensions;
|
||||||
@@ -18,11 +17,11 @@ namespace Orchard.Mvc.Routes {
|
|||||||
private readonly IRunningShellTable _runningShellTable;
|
private readonly IRunningShellTable _runningShellTable;
|
||||||
private readonly UrlPrefix _urlPrefix;
|
private readonly UrlPrefix _urlPrefix;
|
||||||
|
|
||||||
public ShellRoute(RouteBase route, ShellSettings shellSettings, ILifetimeScope shellLifetimeScope, IRunningShellTable runningShellTable) {
|
public ShellRoute(RouteBase route, ShellSettings shellSettings, IWorkContextAccessor workContextAccessor, IRunningShellTable runningShellTable) {
|
||||||
_route = route;
|
_route = route;
|
||||||
_shellSettings = shellSettings;
|
_shellSettings = shellSettings;
|
||||||
_runningShellTable = runningShellTable;
|
_runningShellTable = runningShellTable;
|
||||||
_workContextAccessor = shellLifetimeScope.Resolve<IWorkContextAccessor>();
|
_workContextAccessor = workContextAccessor;
|
||||||
if (!string.IsNullOrEmpty(_shellSettings.RequestUrlPrefix))
|
if (!string.IsNullOrEmpty(_shellSettings.RequestUrlPrefix))
|
||||||
_urlPrefix = new UrlPrefix(_shellSettings.RequestUrlPrefix);
|
_urlPrefix = new UrlPrefix(_shellSettings.RequestUrlPrefix);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user