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:
Sebastien Ros 2013-02-08 23:17:08 -08:00
parent d50b0f8eee
commit 5c6b97d636

View File

@ -1,32 +1,8 @@
using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;
using Orchard.Widgets.Models;
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 int Create() {