Moving content rules to the rules module

This commit is contained in:
Sebastien Ros 2013-09-05 16:46:53 -07:00
parent 887e02c38a
commit 0ea0077fa3
4 changed files with 106 additions and 112 deletions

View File

@ -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" />

View File

@ -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" />

View File

@ -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"))

View File

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