mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-17 04:30:20 +08:00
Moving content rules to the rules module
This commit is contained in:
parent
887e02c38a
commit
0ea0077fa3
@ -113,8 +113,6 @@
|
||||
<Compile Include="Containers\ViewModels\ContainerViewModel.cs" />
|
||||
<Compile Include="Contents\ControlWrapper.cs" />
|
||||
<Compile Include="Contents\Handlers\RulesHandler.cs" />
|
||||
<Compile Include="Contents\Rules\ContentEvents.cs" />
|
||||
<Compile Include="Contents\Rules\ContentForms.cs" />
|
||||
<Compile Include="Contents\Security\AuthorizationEventHandler.cs" />
|
||||
<Compile Include="Common\Services\BbcodeFilter.cs" />
|
||||
<Compile Include="Common\Services\ICommonService.cs" />
|
||||
|
@ -138,6 +138,8 @@
|
||||
<Compile Include="Models\TypeDescriptor.cs" />
|
||||
<Compile Include="Migrations.cs" />
|
||||
<Compile Include="Models\RuleRecord.cs" />
|
||||
<Compile Include="Providers\ContentEvents.cs" />
|
||||
<Compile Include="Providers\ContentForms.cs" />
|
||||
<Compile Include="Providers\ScheduleForms.cs" />
|
||||
<Compile Include="Providers\ScheduleActions.cs" />
|
||||
<Compile Include="Providers\NotificationForms.cs" />
|
||||
|
@ -1,14 +1,11 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Events;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Rules.Models;
|
||||
using Orchard.Rules.Services;
|
||||
|
||||
namespace Orchard.Core.Contents.Rules {
|
||||
public interface IEventProvider : IEventHandler {
|
||||
void Describe(dynamic describe);
|
||||
}
|
||||
|
||||
namespace Orchard.Rules.Providers {
|
||||
public class ContentEvents : IEventProvider {
|
||||
public ContentEvents() {
|
||||
T = NullLocalizer.Instance;
|
||||
@ -16,7 +13,7 @@ namespace Orchard.Core.Contents.Rules {
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public void Describe(dynamic describe) {
|
||||
public void Describe(DescribeEventContext describe) {
|
||||
Func<dynamic, bool> contentHasPart = ContentHasPart;
|
||||
|
||||
describe.For("Content", T("Content Items"), T("Content Items"))
|
@ -3,13 +3,10 @@ using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Events;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Core.Contents.Rules {
|
||||
public interface IFormProvider : IEventHandler {
|
||||
void Describe(dynamic context);
|
||||
}
|
||||
namespace Orchard.Rules.Providers {
|
||||
|
||||
public class ContentForms : IFormProvider {
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
@ -24,14 +21,14 @@ namespace Orchard.Core.Contents.Rules {
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public void Describe(dynamic context) {
|
||||
public void Describe(DescribeContext context) {
|
||||
Func<IShapeFactory, dynamic> form =
|
||||
shape => {
|
||||
|
||||
var f = Shape.Form(
|
||||
Id: "AnyOfContentTypes",
|
||||
_Parts: Shape.SelectList(
|
||||
Id: "contenttypes", Name: "contenttypes",
|
||||
Id: "contenttypes", Name: "ContentTypes",
|
||||
Title: T("Content types"),
|
||||
Description: T("Select some content types."),
|
||||
Size: 10,
|
Loading…
Reference in New Issue
Block a user