From c9597658319d68f9c99dfdbc90931c90f4a1c547 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Thu, 30 Sep 2010 16:25:25 -0700 Subject: [PATCH] Ignoring layout phase if not explicitly required --HG-- branch : dev --- .../Modules/Orchard.Setup/Controllers/SetupController.cs | 2 ++ .../Modules/Orchard.Users/Controllers/AccountController.cs | 2 ++ .../ViewEngines/ThemeAwareness/LayoutAwareViewEngine.cs | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs index 5e37f7e4e..bda6fdd71 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs @@ -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; diff --git a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs index a6057bd1f..3d97c2663 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs @@ -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; diff --git a/src/Orchard/Mvc/ViewEngines/ThemeAwareness/LayoutAwareViewEngine.cs b/src/Orchard/Mvc/ViewEngines/ThemeAwareness/LayoutAwareViewEngine.cs index 4d01dc58e..20230512b 100644 --- a/src/Orchard/Mvc/ViewEngines/ThemeAwareness/LayoutAwareViewEngine.cs +++ b/src/Orchard/Mvc/ViewEngines/ThemeAwareness/LayoutAwareViewEngine.cs @@ -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();