diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo.CmsKit.Domain.Shared.csproj b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo.CmsKit.Domain.Shared.csproj index 22160272fd..876034cfdf 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo.CmsKit.Domain.Shared.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo.CmsKit.Domain.Shared.csproj @@ -12,6 +12,7 @@ + diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatureDefinitionProvider.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatureDefinitionProvider.cs new file mode 100644 index 0000000000..894d85ddc4 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatureDefinitionProvider.cs @@ -0,0 +1,79 @@ +using Volo.Abp.Features; +using Volo.Abp.Localization; +using Volo.Abp.Validation.StringValues; +using Volo.CmsKit.Localization; + +namespace Volo.CmsKit.Features; +public class CmsKitFeatureDefinitionProvider : FeatureDefinitionProvider +{ + public override void Define(IFeatureDefinitionContext context) + { + var group = context.AddGroup(CmsKitFeatures.GroupName, + L("Feature:CmsKitGroup")); + + group.AddFeature(CmsKitFeatures.BlogEnable, + "true", + L("Feature:BlogEnable"), + L("Feature:BlogEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.BlogPostEnable, + "true", + L("Feature:BlogPostEnable"), + L("Feature:BlogPostEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.CommentEnable, + "true", + L("Feature:CommentEnable"), + L("Feature:CommentEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.GlobalResourceEnable, + "true", + L("Feature:GlobalResourceEnable"), + L("Feature:GlobalResourceEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.MediaEnable, + "true", + L("Feature:MediaEnable"), + L("Feature:MediaEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.MenuEnable, + "true", + L("Feature:MenuEnable"), + L("Feature:MenuEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.PageEnable, + "true", + L("Feature:PageEnable"), + L("Feature:PageEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.RatingEnable, + "true", + L("Feature:RatingEnable"), + L("Feature:RatingEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.ReactionEnable, + "true", + L("Feature:ReactionEnable"), + L("Feature:ReactionEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.TagEnable, + "true", + L("Feature:TagEnable"), + L("Feature:TagEnableDescription"), + new ToggleStringValueType()); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatures.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatures.cs new file mode 100644 index 0000000000..2988904e88 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatures.cs @@ -0,0 +1,16 @@ +namespace Volo.CmsKit.Features; +public static class CmsKitFeatures +{ + public const string GroupName = "CmsKit"; + + public const string BlogEnable = GroupName + ".BlogEnable"; + public const string BlogPostEnable = GroupName + ".BlogPostEnable"; + public const string CommentEnable = GroupName + ".CommentEnable"; + public const string GlobalResourceEnable = GroupName + ".GlobalResourceEnable"; + public const string MediaEnable = GroupName + ".MediaEnable"; + public const string MenuEnable = GroupName + ".MenuEnable"; + public const string PageEnable = GroupName + ".PageEnable"; + public const string RatingEnable = GroupName + ".RatingEnable"; + public const string ReactionEnable = GroupName + ".ReactionEnable"; + public const string TagEnable = GroupName + ".TagEnable"; +}