mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +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) {
|
public static ContentTypeDefinitionBuilder Creatable(this ContentTypeDefinitionBuilder builder, bool creatable = true) {
|
||||||
return builder.WithSetting("ContentTypeSettings.Creatable", creatable.ToString());
|
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) {
|
public static ContentPartDefinitionBuilder Attachable(this ContentPartDefinitionBuilder builder, bool attachable = true) {
|
||||||
return builder.WithSetting("ContentPartSettings.Attachable", attachable.ToString());
|
return builder.WithSetting("ContentPartSettings.Attachable", attachable.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
namespace Orchard.Core.Contents.Settings {
|
namespace Orchard.Core.Contents.Settings {
|
||||||
public class ContentTypeSettings {
|
public class ContentTypeSettings {
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public bool Creatable { get; set; }
|
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);
|
var contentTypeDefinition = new ContentTypeDefinition(name, typeViewModel.DisplayName);
|
||||||
_contentDefinitionManager.StoreTypeDefinition(contentTypeDefinition);
|
_contentDefinitionManager.StoreTypeDefinition(contentTypeDefinition);
|
||||||
_contentDefinitionManager.AlterTypeDefinition(name, cfg => cfg.Creatable());
|
_contentDefinitionManager.AlterTypeDefinition(name,
|
||||||
|
cfg => cfg.Creatable().Draftable());
|
||||||
|
|
||||||
return new EditTypeViewModel(contentTypeDefinition);
|
return new EditTypeViewModel(contentTypeDefinition);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user