mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#19924: Adding back obsolete FormValueRequiredAttribute to the Orchard.Core.Contents.Controllers namespace to prevent 3rd party modules from failing to compile that still use this attribute.
--HG-- branch : 1.x
This commit is contained in:
@@ -16,7 +16,6 @@ using Orchard.Data;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Mvc.Extensions;
|
||||
using Orchard.Mvc.Html;
|
||||
using Orchard.UI.Navigation;
|
||||
@@ -110,7 +109,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("List")]
|
||||
[FormValueRequired("submit.Filter")]
|
||||
[Mvc.FormValueRequired("submit.Filter")]
|
||||
public ActionResult ListFilterPOST(ContentOptions options) {
|
||||
var routeValues = ControllerContext.RouteData.Values;
|
||||
if (options != null) {
|
||||
@@ -127,7 +126,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("List")]
|
||||
[FormValueRequired("submit.BulkEdit")]
|
||||
[Mvc.FormValueRequired("submit.BulkEdit")]
|
||||
public ActionResult ListPOST(ContentOptions options, IEnumerable<int> itemIds, string returnUrl) {
|
||||
if (itemIds != null) {
|
||||
var checkedContentItems = _contentManager.GetMany<ContentItem>(itemIds, VersionOptions.Latest, QueryHints.Empty);
|
||||
@@ -204,7 +203,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Create")]
|
||||
[FormValueRequired("submit.Save")]
|
||||
[Mvc.FormValueRequired("submit.Save")]
|
||||
public ActionResult CreatePOST(string id, string returnUrl) {
|
||||
return CreatePOST(id, returnUrl, contentItem => {
|
||||
if (!contentItem.Has<IPublishingControlAspect>() && !contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
|
||||
@@ -213,7 +212,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Create")]
|
||||
[FormValueRequired("submit.Publish")]
|
||||
[Mvc.FormValueRequired("submit.Publish")]
|
||||
public ActionResult CreateAndPublishPOST(string id, string returnUrl) {
|
||||
|
||||
// pass a dummy content to the authorization check to check for "own" variations
|
||||
@@ -267,7 +266,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Edit")]
|
||||
[FormValueRequired("submit.Save")]
|
||||
[Mvc.FormValueRequired("submit.Save")]
|
||||
public ActionResult EditPOST(int id, string returnUrl) {
|
||||
return EditPOST(id, returnUrl, contentItem => {
|
||||
if (!contentItem.Has<IPublishingControlAspect>() && !contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
|
||||
@@ -276,7 +275,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Edit")]
|
||||
[FormValueRequired("submit.Publish")]
|
||||
[Mvc.FormValueRequired("submit.Publish")]
|
||||
public ActionResult EditAndPublishPOST(int id, string returnUrl) {
|
||||
var content = _contentManager.Get(id, VersionOptions.Latest);
|
||||
|
||||
@@ -410,4 +409,18 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
ModelState.AddModelError(key, errorMessage.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("Use Orchard.Mvc.FormValueRequiredAttribute instead.")]
|
||||
public class FormValueRequiredAttribute : ActionMethodSelectorAttribute {
|
||||
private readonly string _submitButtonName;
|
||||
|
||||
public FormValueRequiredAttribute(string submitButtonName) {
|
||||
_submitButtonName = submitButtonName;
|
||||
}
|
||||
|
||||
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) {
|
||||
var value = controllerContext.HttpContext.Request.Form[_submitButtonName];
|
||||
return !string.IsNullOrEmpty(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,10 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Alias.Implementation.Holder;
|
||||
using Orchard.Alias.ViewModels;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
|
@@ -9,7 +9,6 @@ using Orchard.ContentTypes.Extensions;
|
||||
using Orchard.ContentTypes.Services;
|
||||
using Orchard.ContentTypes.Settings;
|
||||
using Orchard.ContentTypes.ViewModels;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Core.Contents.Settings;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Localization;
|
||||
|
@@ -8,7 +8,6 @@ using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Containers.Models;
|
||||
using Orchard.Core.Contents;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Core.Contents.Settings;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Lists.ViewModels;
|
||||
|
@@ -3,7 +3,6 @@ using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Core.Contents.Settings;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Localization.Models;
|
||||
|
@@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Media.Models;
|
||||
|
@@ -2,7 +2,6 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.MediaLibrary.Models;
|
||||
|
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Localization;
|
||||
|
@@ -12,7 +12,6 @@ using Orchard.Projections.Models;
|
||||
using Orchard.Projections.Services;
|
||||
using Orchard.Projections.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Notify;
|
||||
|
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc;
|
||||
@@ -12,7 +11,6 @@ using Orchard.Roles.Services;
|
||||
using Orchard.Roles.ViewModels;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Roles.Controllers {
|
||||
[ValidateInput(false)]
|
||||
|
@@ -8,7 +8,6 @@ using Orchard.Rules.Models;
|
||||
using Orchard.Rules.Services;
|
||||
using Orchard.Rules.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Data;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Localization;
|
||||
|
@@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Core.Settings.Models;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Localization;
|
||||
|
@@ -3,7 +3,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Security;
|
||||
|
@@ -4,7 +4,6 @@ using System.Globalization;
|
||||
using System.Web.Mvc;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.FileSystems.VirtualPath;
|
||||
|
@@ -4,7 +4,6 @@ using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.Controllers;
|
||||
using Orchard.Data;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Forms.Services;
|
||||
|
Reference in New Issue
Block a user