mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Removing unused code for creating layers in migrations.
They are created in the recipes actually, and the code was not used. --HG-- branch : 1.x
This commit is contained in:
parent
d50b0f8eee
commit
5c6b97d636
@ -1,32 +1,8 @@
|
|||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement.MetaData;
|
||||||
using Orchard.ContentManagement.MetaData;
|
|
||||||
using Orchard.Core.Contents.Extensions;
|
using Orchard.Core.Contents.Extensions;
|
||||||
using Orchard.Data.Migration;
|
using Orchard.Data.Migration;
|
||||||
using Orchard.Widgets.Models;
|
|
||||||
|
|
||||||
namespace Orchard.Widgets {
|
namespace Orchard.Widgets {
|
||||||
public interface IDefaultLayersInitializer : IDependency {
|
|
||||||
void CreateDefaultLayers();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class DefaultLayersInitializer : IDefaultLayersInitializer {
|
|
||||||
private readonly IContentManager _contentManager;
|
|
||||||
|
|
||||||
public DefaultLayersInitializer(IContentManager contentManager) {
|
|
||||||
_contentManager = contentManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CreateDefaultLayers() {
|
|
||||||
IContent defaultLayer = _contentManager.Create<LayerPart>("Layer", t => { t.Record.Name = "Default"; t.Record.LayerRule = "true"; });
|
|
||||||
_contentManager.Publish(defaultLayer.ContentItem);
|
|
||||||
IContent authenticatedLayer = _contentManager.Create<LayerPart>("Layer", t => { t.Record.Name = "Authenticated"; t.Record.LayerRule = "authenticated"; });
|
|
||||||
_contentManager.Publish(authenticatedLayer.ContentItem);
|
|
||||||
IContent anonymousLayer = _contentManager.Create<LayerPart>("Layer", t => { t.Record.Name = "Anonymous"; t.Record.LayerRule = "not authenticated"; });
|
|
||||||
_contentManager.Publish(anonymousLayer.ContentItem);
|
|
||||||
IContent disabledLayer = _contentManager.Create<LayerPart>("Layer", t => { t.Record.Name = "Disabled"; t.Record.LayerRule = "false"; });
|
|
||||||
_contentManager.Publish(disabledLayer.ContentItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class WidgetsDataMigration : DataMigrationImpl {
|
public class WidgetsDataMigration : DataMigrationImpl {
|
||||||
public int Create() {
|
public int Create() {
|
||||||
|
Loading…
Reference in New Issue
Block a user