From 6b36a256b0b7e35b1c6cb2d88df34510fa3268ae Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Mon, 12 Mar 2012 15:02:00 -0700 Subject: [PATCH] #18538: Fixing Page Layer Hinting with Autoroute --HG-- branch : 1.x --- .hgsubstate | 2 +- .../Orchard.Widgets/Handlers/LayerHintHandler.cs | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.hgsubstate b/.hgsubstate index 448882dde..ce128a003 100644 --- a/.hgsubstate +++ b/.hgsubstate @@ -1,4 +1,4 @@ -d695b7235fc4f1edf216a610ced8fb9c6e7f29d6 src/Orchard.Web/Modules/Orchard.Autoroute +35c9fddc4d187a0ee48a4599df476ffe4802f143 src/Orchard.Web/Modules/Orchard.Autoroute 214e7b89d42abd00abd4e5fe2b1eb0b181b79946 src/Orchard.Web/Modules/Orchard.Forms 7a1553d61ec49f709395a409a8edfe0956ab991c src/Orchard.Web/Modules/Orchard.Rules dab42f20280f46c25c6c78ef13870f9a063bd026 src/Orchard.Web/Modules/Orchard.TaskLease diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Handlers/LayerHintHandler.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Handlers/LayerHintHandler.cs index f7fe7b251..241df0dd9 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Handlers/LayerHintHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Handlers/LayerHintHandler.cs @@ -1,23 +1,20 @@ using System.Web.Mvc; using System.Web.Routing; -using Orchard.ContentManagement.Handlers; using Orchard.Environment.Extensions; using Orchard.Localization; using Orchard.UI.Notify; using Orchard.Events; using Orchard.ContentManagement; using System; -using System.Collections.Generic; -using Orchard.ContentManagement.Aspects; namespace Orchard.Widgets.Handlers { - public interface IRoutePatternProvider : IEventHandler { - void Routed(IContent content, String path, ICollection> aliases); + public interface IRouteEvents : IEventHandler { + void Routed(IContent content, String path); } [OrchardFeature("Orchard.Widgets.PageLayerHinting")] - public class LayerHintHandler : IRoutePatternProvider { + public class LayerHintHandler : IRouteEvents { public LayerHintHandler(IOrchardServices services, RequestContext requestContext) { T = NullLocalizer.Instance; _requestContext = requestContext; @@ -27,12 +24,12 @@ namespace Orchard.Widgets.Handlers { public IOrchardServices Services { get; set; } public Localizer T { get; set; } - public void Routed(IContent content, string path, ICollection> aliases) { + public void Routed(IContent content, String path) { // Only going to help in creating a layer if the content is a page // TODO: (PH) Any reason not to enable the hint for *all* routed content? // TODO: (PH:Autoroute) Previously this only ran when the item was first published. Now it's running any time item is published. We want to catch // that and edit the existing layer rule rather than create a new one. - if (!(content.ContentItem.ContentType == "Page")) + if (content.ContentItem.ContentType != "Page") return; var urlHelper = new UrlHelper(_requestContext);