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