--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-11-03 14:14:20 -07:00
3 changed files with 10 additions and 2 deletions

View File

@@ -6,6 +6,9 @@ namespace Orchard.Core.Contents.Extensions {
public static ContentTypeDefinitionBuilder Creatable(this ContentTypeDefinitionBuilder builder, bool creatable = true) {
return builder.WithSetting("ContentTypeSettings.Creatable", creatable.ToString());
}
public static ContentTypeDefinitionBuilder Draftable(this ContentTypeDefinitionBuilder builder, bool draftable = true) {
return builder.WithSetting("ContentTypeSettings.Draftable", draftable.ToString());
}
public static ContentPartDefinitionBuilder Attachable(this ContentPartDefinitionBuilder builder, bool attachable = true) {
return builder.WithSetting("ContentPartSettings.Attachable", attachable.ToString());
}

View File

@@ -1,8 +1,12 @@
namespace Orchard.Core.Contents.Settings {
public class ContentTypeSettings {
/// <summary>
/// This setting is used to display a Content Type in Content Management menu like
/// Used to determine if an instance of this content type can be created through the UI
/// </summary>
public bool Creatable { get; set; }
/// <summary>
/// Used to determine if this content type supports draft versions
/// </summary>
public bool Draftable { get; set; }
}
}

View File

@@ -73,7 +73,8 @@ namespace Orchard.ContentTypes.Services {
var contentTypeDefinition = new ContentTypeDefinition(name, typeViewModel.DisplayName);
_contentDefinitionManager.StoreTypeDefinition(contentTypeDefinition);
_contentDefinitionManager.AlterTypeDefinition(name, cfg => cfg.Creatable());
_contentDefinitionManager.AlterTypeDefinition(name,
cfg => cfg.Creatable().Draftable());
return new EditTypeViewModel(contentTypeDefinition);
}