using System; using System.Collections.Generic; using System.Configuration; namespace Umbraco.Core.Configuration.UmbracoSettings { internal class ContentElement : ConfigurationElement, IContentSection { [ConfigurationProperty("imaging")] internal ContentImagingElement Imaging { get { return (ContentImagingElement)this["imaging"]; } } [ConfigurationProperty("scripteditor")] internal ContentScriptEditorElement ScriptEditor { get { return (ContentScriptEditorElement)this["scripteditor"]; } } [ConfigurationProperty("ResolveUrlsFromTextString")] internal InnerTextConfigurationElement ResolveUrlsFromTextString { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["ResolveUrlsFromTextString"], //set the default false); } } [ConfigurationProperty("UploadAllowDirectories")] internal InnerTextConfigurationElement UploadAllowDirectories { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["UploadAllowDirectories"], //set the default true); } } public IEnumerable Error404Collection { get { return Errors.Error404Collection; } } [ConfigurationProperty("errors", IsRequired = true)] internal ContentErrorsElement Errors { get { return (ContentErrorsElement) base["errors"]; } } [ConfigurationProperty("notifications", IsRequired = true)] internal NotificationsElement Notifications { get { return (NotificationsElement)base["notifications"]; } } [ConfigurationProperty("ensureUniqueNaming")] internal InnerTextConfigurationElement EnsureUniqueNaming { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["ensureUniqueNaming"], //set the default true); } } [ConfigurationProperty("TidyEditorContent")] internal InnerTextConfigurationElement TidyEditorContent { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["TidyEditorContent"], //set the default false); } } [ConfigurationProperty("TidyCharEncoding")] internal InnerTextConfigurationElement TidyCharEncoding { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["TidyCharEncoding"], //set the default "UTF8"); } } [ConfigurationProperty("XmlCacheEnabled")] internal InnerTextConfigurationElement XmlCacheEnabled { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["XmlCacheEnabled"], //set the default true); } } [ConfigurationProperty("ContinouslyUpdateXmlDiskCache")] internal InnerTextConfigurationElement ContinouslyUpdateXmlDiskCache { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["ContinouslyUpdateXmlDiskCache"], //set the default true); } } [ConfigurationProperty("XmlContentCheckForDiskChanges")] internal InnerTextConfigurationElement XmlContentCheckForDiskChanges { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["XmlContentCheckForDiskChanges"], //set the default false); } } [ConfigurationProperty("EnableSplashWhileLoading")] internal InnerTextConfigurationElement EnableSplashWhileLoading { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["EnableSplashWhileLoading"], //set the default false); } } [ConfigurationProperty("PropertyContextHelpOption")] internal InnerTextConfigurationElement PropertyContextHelpOption { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["PropertyContextHelpOption"], //set the default "text"); } } [ConfigurationProperty("UseLegacyXmlSchema")] internal InnerTextConfigurationElement UseLegacyXmlSchema { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["UseLegacyXmlSchema"], //set the default false); } } [ConfigurationProperty("ForceSafeAliases")] internal InnerTextConfigurationElement ForceSafeAliases { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["ForceSafeAliases"], //set the default true); } } [ConfigurationProperty("PreviewBadge")] internal InnerTextConfigurationElement PreviewBadge { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["PreviewBadge"], //set the default @"In Preview Mode - click to end"); } } [ConfigurationProperty("UmbracoLibraryCacheDuration")] internal InnerTextConfigurationElement UmbracoLibraryCacheDuration { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["UmbracoLibraryCacheDuration"], //set the default 1800); } } [ConfigurationProperty("MacroErrors")] internal InnerTextConfigurationElement MacroErrors { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["MacroErrors"], //set the default MacroErrorBehaviour.Inline); } } [Obsolete("This is here so that if this config element exists we won't get a YSOD, it is not used whatsoever and will be removed in future versions")] [ConfigurationProperty("DocumentTypeIconList")] internal InnerTextConfigurationElement DocumentTypeIconList { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["DocumentTypeIconList"], //set the default IconPickerBehaviour.HideFileDuplicates); } } [ConfigurationProperty("disallowedUploadFiles")] internal CommaDelimitedConfigurationElement DisallowedUploadFiles { get { return new OptionalCommaDelimitedConfigurationElement( (CommaDelimitedConfigurationElement)this["disallowedUploadFiles"], //set the default new[] { "ashx", "aspx", "ascx", "config", "cshtml", "vbhtml", "asmx", "air", "axd" }); } } [ConfigurationProperty("cloneXmlContent")] internal InnerTextConfigurationElement CloneXmlContent { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["cloneXmlContent"], //set the default true); } } [ConfigurationProperty("GlobalPreviewStorageEnabled")] internal InnerTextConfigurationElement GlobalPreviewStorageEnabled { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["GlobalPreviewStorageEnabled"], //set the default false); } } [ConfigurationProperty("defaultDocumentTypeProperty")] internal InnerTextConfigurationElement DefaultDocumentTypeProperty { get { return new OptionalInnerTextConfigurationElement( (InnerTextConfigurationElement)this["defaultDocumentTypeProperty"], //set the default "Textstring"); } } IImagingCrops IContentSection.ImageCrops { get { return Imaging.Crops; } } string IContentSection.NotificationEmailAddress { get { return Notifications.NotificationEmailAddress; } } bool IContentSection.DisableHtmlEmail { get { return Notifications.DisableHtmlEmail; } } IEnumerable IContentSection.ImageFileTypes { get { return Imaging.ImageFileTypes; } } IEnumerable IContentSection.ImageTagAllowedAttributes { get { return Imaging.ImageTagAllowedAttributes; } } IEnumerable IContentSection.ImageAutoFillProperties { get { return Imaging.ImageAutoFillProperties; } } bool IContentSection.ScriptEditorDisable { get { return ScriptEditor.ScriptEditorDisable; } } string IContentSection.ScriptFolderPath { get { return ScriptEditor.ScriptFolderPath; } } IEnumerable IContentSection.ScriptFileTypes { get { return ScriptEditor.ScriptFileTypes; } } bool IContentSection.ResolveUrlsFromTextString { get { return ResolveUrlsFromTextString; } } bool IContentSection.UploadAllowDirectories { get { return UploadAllowDirectories; } } bool IContentSection.EnsureUniqueNaming { get { return EnsureUniqueNaming; } } bool IContentSection.TidyEditorContent { get { return TidyEditorContent; } } string IContentSection.TidyCharEncoding { get { return TidyCharEncoding; } } bool IContentSection.XmlCacheEnabled { get { return XmlCacheEnabled; } } bool IContentSection.ContinouslyUpdateXmlDiskCache { get { return ContinouslyUpdateXmlDiskCache; } } bool IContentSection.XmlContentCheckForDiskChanges { get { return XmlContentCheckForDiskChanges; } } bool IContentSection.EnableSplashWhileLoading { get { return EnableSplashWhileLoading; } } string IContentSection.PropertyContextHelpOption { get { return PropertyContextHelpOption; } } bool IContentSection.UseLegacyXmlSchema { get { return UseLegacyXmlSchema; } } bool IContentSection.ForceSafeAliases { get { return ForceSafeAliases; } } string IContentSection.PreviewBadge { get { return PreviewBadge; } } int IContentSection.UmbracoLibraryCacheDuration { get { return UmbracoLibraryCacheDuration; } } MacroErrorBehaviour IContentSection.MacroErrorBehaviour { get { return MacroErrors; } } IEnumerable IContentSection.DisallowedUploadFiles { get { return DisallowedUploadFiles; } } bool IContentSection.CloneXmlContent { get { return CloneXmlContent; } } bool IContentSection.GlobalPreviewStorageEnabled { get { return GlobalPreviewStorageEnabled; } } string IContentSection.DefaultDocumentTypeProperty { get { return DefaultDocumentTypeProperty; } } } }