Ignoring layout phase if not explicitly required

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-09-30 16:25:25 -07:00
parent b9bd5a06ca
commit c959765831
3 changed files with 11 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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();