<%
if (feature.IsEnabled) {
- using (Html.BeginFormAntiForgeryPost(string.Format("{0}#{1}", Url.Action("Disable", new { area = "Orchard.Modules" }), Html.AttributeEncode(feature.Descriptor.Name)), FormMethod.Post, new {@class = "inline link"})) { %>
- <%=Html.Hidden("featureName", feature.Descriptor.Name) %>
+ using (Html.BeginFormAntiForgeryPost(string.Format("{0}#{1}", Url.Action("Disable", new { area = "Orchard.Modules" }), featureId), FormMethod.Post, new {@class = "inline link"})) { %>
+ <%=Html.Hidden("id", feature.Descriptor.Name, new { id = "" })%>
<%
}
} else {
- using (Html.BeginFormAntiForgeryPost(string.Format("{0}#{1}", Url.Action("Enable", new { area = "Orchard.Modules" }), Html.AttributeEncode(feature.Descriptor.Name)), FormMethod.Post, new {@class = "inline link"})) { %>
- <%=Html.Hidden("featureName", feature.Descriptor.Name) %>
+ using (Html.BeginFormAntiForgeryPost(string.Format("{0}#{1}", Url.Action("Enable", new { area = "Orchard.Modules" }), featureId), FormMethod.Post, new {@class = "inline link"})) { %>
+ <%=Html.Hidden("id", feature.Descriptor.Name, new { id = "" })%>
<%
}
} %>
diff --git a/src/Orchard.Web/Modules/Orchard.Pages/Handlers/PageHandler.cs b/src/Orchard.Web/Modules/Orchard.Pages/Handlers/PageHandler.cs
index 6b3b2e7a9..ef9d535ec 100644
--- a/src/Orchard.Web/Modules/Orchard.Pages/Handlers/PageHandler.cs
+++ b/src/Orchard.Web/Modules/Orchard.Pages/Handlers/PageHandler.cs
@@ -28,7 +28,7 @@ namespace Orchard.Pages.Handlers {
Filters.Add(new ActivatingFilter
(PageDriver.ContentType.Name));
Filters.Add(new ActivatingFilter(PageDriver.ContentType.Name));
- OnLoaded((context, p) => p.ScheduledPublishUtc = _pageService.GetScheduledPublishUtc(p));
+ OnLoaded((context, page) => page._scheduledPublishUtc.Loader(value => _pageService.GetScheduledPublishUtc(page)));
}
Localizer T { get; set; }
diff --git a/src/Orchard.Web/Modules/Orchard.Pages/Models/Page.cs b/src/Orchard.Web/Modules/Orchard.Pages/Models/Page.cs
index 178bccf7c..800747dc0 100644
--- a/src/Orchard.Web/Modules/Orchard.Pages/Models/Page.cs
+++ b/src/Orchard.Web/Modules/Orchard.Pages/Models/Page.cs
@@ -1,6 +1,7 @@
using System;
using System.Web.Mvc;
using Orchard.ContentManagement;
+using Orchard.ContentManagement.Utilities;
using Orchard.Core.Common.Models;
using Orchard.Security;
@@ -52,7 +53,8 @@ namespace Orchard.Pages.Models {
}
}
- public DateTime? ScheduledPublishUtc { get; set; }
+ public readonly LazyField _scheduledPublishUtc = new LazyField();
+ public DateTime? ScheduledPublishUtc { get { return _scheduledPublishUtc.Value; } set{ _scheduledPublishUtc.Value = value;} }
private string _scheduledPublishUtcDate;
diff --git a/src/Orchard/Utility/Extensions/StringExtensions.cs b/src/Orchard/Utility/Extensions/StringExtensions.cs
index 4e7e233f8..bbd10a13c 100644
--- a/src/Orchard/Utility/Extensions/StringExtensions.cs
+++ b/src/Orchard/Utility/Extensions/StringExtensions.cs
@@ -14,16 +14,20 @@ namespace Orchard.Utility.Extensions {
return cleanTailRegex.Replace(text.Substring(0, characterCount + 1), "") + ellipsis;
}
+
+ public static string HtmlClassify(this string text) {
+ return Regex.Replace(text, @"[^a-zA-Z]+", m => m.Index == 0 ? "" : "-").ToLowerInvariant();
+ }
+
public static bool IsNullOrEmptyTrimmed(this string text) {
- if (text == null) return true;
- return string.IsNullOrEmpty(text.Trim());
+ return text == null
+ || string.IsNullOrEmpty(text.Trim());
}
public static string OrDefault(this string text, string defaultValue) {
- if (string.IsNullOrEmpty(text))
- return defaultValue;
- else
- return text;
+ return string.IsNullOrEmpty(text)
+ ? defaultValue
+ : text;
}
}
}
\ No newline at end of file