mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
@@ -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; }
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user