mirror of
				https://github.com/OrchardCMS/Orchard.git
				synced 2025-10-31 08:36:40 +08:00 
			
		
		
		
	Moving Rules remainings from Core
This commit is contained in:
		| @@ -112,7 +112,6 @@ | ||||
|     <Compile Include="Containers\ViewModels\ContainerWidgetViewModel.cs" /> | ||||
|     <Compile Include="Containers\ViewModels\ContainerViewModel.cs" /> | ||||
|     <Compile Include="Contents\ControlWrapper.cs" /> | ||||
|     <Compile Include="Contents\Handlers\RulesHandler.cs" /> | ||||
|     <Compile Include="Contents\Security\AuthorizationEventHandler.cs" /> | ||||
|     <Compile Include="Common\Services\BbcodeFilter.cs" /> | ||||
|     <Compile Include="Common\Services\ICommonService.cs" /> | ||||
|   | ||||
| @@ -1,15 +1,9 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Collections.Generic; | ||||
| using Orchard.ContentManagement; | ||||
| using Orchard.ContentManagement.Handlers; | ||||
| using Orchard.Environment.Extensions; | ||||
| using Orchard.Events; | ||||
| using Orchard.Rules.Services; | ||||
| 
 | ||||
| namespace Orchard.Core.Contents.Handlers { | ||||
| 
 | ||||
|     public interface IRulesManager : IEventHandler { | ||||
|         void TriggerEvent(string category, string type, Func<Dictionary<string, object>> tokensContext); | ||||
|     } | ||||
| namespace Orchard.Rules.Handlers { | ||||
| 
 | ||||
|     public class RulePartHandler : ContentHandler { | ||||
|         public RulePartHandler(IRulesManager rulesManager) { | ||||
| @@ -82,6 +82,7 @@ | ||||
|     <Content Include="Views\Web.config" /> | ||||
|     <Content Include="Scripts\Web.config" /> | ||||
|     <Content Include="Styles\Web.config" /> | ||||
|     <Compile Include="Handlers\ContentHandler.cs" /> | ||||
|     <Compile Include="ImportExport\RulesExportEventHandler.cs" /> | ||||
|     <Compile Include="ImportExport\RulesCustomExportStep.cs" /> | ||||
|     <Compile Include="ImportExport\RulesRecipeHandler.cs" /> | ||||
|   | ||||
| @@ -17,14 +17,14 @@ namespace Orchard.Rules.Providers { | ||||
|             Func<dynamic, bool> contentHasPart = ContentHasPart; | ||||
|  | ||||
|             describe.For("Content", T("Content Items"), T("Content Items")) | ||||
|                 .Element("Created", T("Content Created"), T("Content is actually created."), contentHasPart, (Func<dynamic, LocalizedString>)(context => T("When content with types ({0}) is created.", FormatPartsList(context))), "SelectContentTypes") | ||||
|                 .Element("Versioned", T("Content Versioned"), T("Content is actually versioned."), contentHasPart, (Func<dynamic, LocalizedString>)(context => T("When content with types ({0}) is versioned.", FormatPartsList(context))), "SelectContentTypes") | ||||
|                 .Element("Published", T("Content Published"), T("Content is actually published."), contentHasPart, (Func<dynamic, LocalizedString>)(context => T("When content with types ({0}) is published.", FormatPartsList(context))), "SelectContentTypes") | ||||
|                 .Element("Removed", T("Content Removed"), T("Content is actually removed."), contentHasPart, (Func<dynamic, LocalizedString>)(context => T("When content with types ({0}) is removed.", FormatPartsList(context))), "SelectContentTypes"); | ||||
|                 .Element("Created", T("Content Created"), T("Content is actually created."), contentHasPart, context => T("When content with types ({0}) is created.", FormatPartsList(context)), "SelectContentTypes") | ||||
|                 .Element("Versioned", T("Content Versioned"), T("Content is actually versioned."), contentHasPart, context => T("When content with types ({0}) is versioned.", FormatPartsList(context)), "SelectContentTypes") | ||||
|                 .Element("Published", T("Content Published"), T("Content is actually published."), contentHasPart, context => T("When content with types ({0}) is published.", FormatPartsList(context)), "SelectContentTypes") | ||||
|                 .Element("Removed", T("Content Removed"), T("Content is actually removed."), contentHasPart, context => T("When content with types ({0}) is removed.", FormatPartsList(context)), "SelectContentTypes"); | ||||
|         } | ||||
|  | ||||
|         private string FormatPartsList(dynamic context) { | ||||
|             var contenttypes = context.Properties["ContentTypes"]; | ||||
|         private string FormatPartsList(EventContext context) { | ||||
|             var contenttypes = context.Properties.ContainsKey("ContentTypes") ? context.Properties["ContentTypes"] : context.Properties["contenttypes"]; | ||||
|  | ||||
|             if (String.IsNullOrEmpty(contenttypes)) { | ||||
|                 return T("Any").Text; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Sebastien Ros
					Sebastien Ros