mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Ignoring layout phase if not explicitly required
--HG-- branch : dev
This commit is contained in:
@@ -8,10 +8,12 @@ using Orchard.FileSystems.AppData;
|
||||
using Orchard.Setup.Services;
|
||||
using Orchard.Setup.ViewModels;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Themes;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Setup.Controllers {
|
||||
[ValidateInput(false)]
|
||||
[Themed]
|
||||
public class SetupController : Controller {
|
||||
private readonly IAppDataFolder _appDataFolder;
|
||||
private readonly INotifier _notifier;
|
||||
|
@@ -7,6 +7,7 @@ using System.Web.Security;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc.Extensions;
|
||||
using Orchard.Security;
|
||||
using Orchard.Themes;
|
||||
using Orchard.Users.Services;
|
||||
using Orchard.Users.ViewModels;
|
||||
using Orchard.Settings;
|
||||
@@ -17,6 +18,7 @@ using Orchard.Mvc.Results;
|
||||
|
||||
namespace Orchard.Users.Controllers {
|
||||
[HandleError]
|
||||
[Themed]
|
||||
public class AccountController : Controller {
|
||||
private readonly IAuthenticationService _authenticationService;
|
||||
private readonly IMembershipService _membershipService;
|
||||
|
@@ -4,6 +4,8 @@ using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Mvc.Spooling;
|
||||
using Orchard.Themes;
|
||||
using Orchard.UI.Admin;
|
||||
|
||||
namespace Orchard.Mvc.ViewEngines.ThemeAwareness {
|
||||
public interface ILayoutAwareViewEngine : IDependency, IViewEngine {
|
||||
@@ -34,6 +36,11 @@ namespace Orchard.Mvc.ViewEngines.ThemeAwareness {
|
||||
return viewResult;
|
||||
}
|
||||
|
||||
// Don't layout the result if it's not an Admin controller and it's disabled
|
||||
if ( !AdminFilter.IsApplied(controllerContext.RequestContext) && !ThemeFilter.IsApplied(controllerContext.RequestContext) ) {
|
||||
return viewResult;
|
||||
}
|
||||
|
||||
var layoutView = new LayoutView((viewContext, writer, viewDataContainer) => {
|
||||
var childContentWriter = new HtmlStringWriter();
|
||||
|
||||
|
Reference in New Issue
Block a user