-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathContentSettings.cs
More file actions
136 lines (113 loc) · 6.04 KB
/
ContentSettings.cs
File metadata and controls
136 lines (113 loc) · 6.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System.ComponentModel;
namespace Umbraco.Cms.Core.Configuration.Models;
/// <summary>
/// Typed configuration options for content settings.
/// </summary>
[UmbracoOptions(Constants.Configuration.ConfigContent)]
public class ContentSettings
{
internal const bool StaticResolveUrlsFromTextString = false;
internal const string StaticDefaultPreviewBadge = @"
<script src=""{0}/website/preview.js""></script>
<umb-website-preview path=""{0}"" url=""{1}"" unique=""{2}""></umb-website-preview>";
internal const string StaticDisallowedUploadFiles = "ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,xamlx";
internal const bool StaticShowDeprecatedPropertyEditors = false;
internal const string StaticLoginBackgroundImage = "login/login.jpg";
internal const string StaticLoginLogoImage = "login/logo_dark.svg";
internal const string StaticLoginLogoImageAlternative = "login/logo_light.svg";
internal const bool StaticHideBackOfficeLogo = false;
internal const bool StaticDisableDeleteWhenReferenced = false;
internal const bool StaticDisableUnpublishWhenReferenced = false;
internal const bool StaticAllowEditInvariantFromNonDefault = false;
internal const bool StaticShowDomainWarnings = true;
/// <summary>
/// Gets or sets a value for the content notification settings.
/// </summary>
public ContentNotificationSettings Notifications { get; set; } = new();
/// <summary>
/// Gets or sets a value for the content imaging settings.
/// </summary>
public ContentImagingSettings Imaging { get; set; } = new();
/// <summary>
/// Gets or sets a value indicating whether URLs should be resolved from text strings.
/// </summary>
[DefaultValue(StaticResolveUrlsFromTextString)]
public bool ResolveUrlsFromTextString { get; set; } = StaticResolveUrlsFromTextString;
/// <summary>
/// Gets or sets a value for the collection of error pages.
/// </summary>
public ContentErrorPage[] Error404Collection { get; set; } = Array.Empty<ContentErrorPage>();
/// <summary>
/// Gets or sets a value for the preview badge mark-up.
/// </summary>
[DefaultValue(StaticDefaultPreviewBadge)]
public string PreviewBadge { get; set; } = StaticDefaultPreviewBadge;
/// <summary>
/// Gets or sets a value indicating whether deprecated property editors should be shown.
/// </summary>
[DefaultValue(StaticShowDeprecatedPropertyEditors)]
public bool ShowDeprecatedPropertyEditors { get; set; } = StaticShowDeprecatedPropertyEditors;
/// <summary>
/// Gets or sets a value for the path to the login screen background image.
/// </summary>
[DefaultValue(StaticLoginBackgroundImage)]
public string LoginBackgroundImage { get; set; } = StaticLoginBackgroundImage;
/// <summary>
/// Gets or sets a value for the path to the login screen logo image
/// shown on top of the background image set in <see cref="LoginBackgroundImage" />.
/// </summary>
/// <remarks>The alternative version of this logo can be found at <see cref="LoginLogoImageAlternative"/>.</remarks>
[DefaultValue(StaticLoginLogoImage)]
public string LoginLogoImage { get; set; } = StaticLoginLogoImage;
/// <summary>
/// Gets or sets a value for the path to the login screen logo image when shown on top
/// of a light background (e.g. in mobile resolutions).
/// </summary>
/// <remarks>This is the alternative version to the regular logo found at <see cref="LoginLogoImage"/>.</remarks>
[DefaultValue(StaticLoginLogoImage)]
public string LoginLogoImageAlternative { get; set; } = StaticLoginLogoImage;
/// <summary>
/// Gets or sets a value indicating whether to hide the backoffice umbraco logo or not.
/// </summary>
[DefaultValue(StaticHideBackOfficeLogo)]
public bool HideBackOfficeLogo { get; set; } = StaticHideBackOfficeLogo;
/// <summary>
/// Gets or sets a value indicating whether to disable the deletion of items referenced by other items.
/// </summary>
[DefaultValue(StaticDisableDeleteWhenReferenced)]
public bool DisableDeleteWhenReferenced { get; set; } = StaticDisableDeleteWhenReferenced;
/// <summary>
/// Gets or sets a value indicating whether to disable the unpublishing of items referenced by other items.
/// </summary>
[DefaultValue(StaticDisableUnpublishWhenReferenced)]
public bool DisableUnpublishWhenReferenced { get; set; } = StaticDisableUnpublishWhenReferenced;
/// <summary>
/// Gets or sets the model representing the global content version cleanup policy
/// </summary>
public ContentVersionCleanupPolicySettings ContentVersionCleanupPolicy { get; set; } = new();
/// <summary>
/// Gets or sets a value indicating whether to allow editing invariant properties from a non-default language variation.
/// </summary>
[DefaultValue(StaticAllowEditInvariantFromNonDefault)]
public bool AllowEditInvariantFromNonDefault { get; set; } = StaticAllowEditInvariantFromNonDefault;
/// <summary>
/// Gets or sets a value for the collection of file extensions that are allowed for upload.
/// </summary>
public string[] AllowedUploadedFileExtensions { get; set; } = Array.Empty<string>();
/// <summary>
/// Gets or sets a value for the collection of file extensions that are disallowed for upload.
/// </summary>
[DefaultValue(StaticDisallowedUploadFiles)]
public string[] DisallowedUploadedFileExtensions { get; set; } = StaticDisallowedUploadFiles.Split(',');
/// <summary>
/// Gets or sets the allowed external host for media. If empty only relative paths are allowed.
/// </summary>
public string[] AllowedMediaHosts { get; set; } = Array.Empty<string>();
/// <summary>
/// Gets or sets a value indicating whether to show domain warnings.
/// </summary>
[DefaultValue(StaticShowDomainWarnings)]
public bool ShowDomainWarnings { get; set; } = StaticShowDomainWarnings;
}