Fixes: U4-662 Most icon for document type can't be shown in 4.8.1.
This commit is contained in:
@@ -1251,6 +1251,41 @@ namespace Umbraco.Core.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
private static IconPickerBehaviour? _iconPickerBehaviour;
|
||||
|
||||
/// <summary>
|
||||
/// This configuration setting defines how to show icons in the document type editor.
|
||||
/// - ShowDuplicates - Show duplicates in files and sprites. (default and current Umbraco 'normal' behaviour)
|
||||
/// - HideSpriteDuplicates - Show files on disk and hide duplicates from the sprite
|
||||
/// - HideFileDuplicates - Show files in the sprite and hide duplicates on disk
|
||||
/// </summary>
|
||||
/// <value>MacroErrorBehaviour enum defining how to show icons in the document type editor.</value>
|
||||
public static IconPickerBehaviour IconPickerBehaviour
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_iconPickerBehaviour == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var behaviour = IconPickerBehaviour.ShowDuplicates;
|
||||
var value = GetKey("/settings/content/DocumentTypeIconList");
|
||||
if (value != null)
|
||||
{
|
||||
Enum<IconPickerBehaviour>.TryParse(value, true, out behaviour);
|
||||
}
|
||||
_iconPickerBehaviour = behaviour;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<UmbracoSettings>("Could not load /settings/content/DocumentTypeIconList from umbracosettings.config", ex);
|
||||
_iconPickerBehaviour = IconPickerBehaviour.ShowDuplicates;
|
||||
}
|
||||
}
|
||||
return _iconPickerBehaviour.Value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configuration regarding webservices
|
||||
/// </summary>
|
||||
|
||||
24
src/Umbraco.Core/IconPickerBehaviour.cs
Normal file
24
src/Umbraco.Core/IconPickerBehaviour.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public enum IconPickerBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Default umbraco behavior - show duplicates in files and sprites
|
||||
/// </summary>
|
||||
ShowDuplicates,
|
||||
|
||||
/// <summary>
|
||||
/// If a file exists on disk with the same name as one in the sprite
|
||||
/// then the file on disk overrules the one in the sprite, the
|
||||
/// sprite icon will not be shown
|
||||
/// </summary>
|
||||
HideSpriteDuplicates,
|
||||
|
||||
/// <summary>
|
||||
/// If a file exists on disk with the same name as one in the sprite
|
||||
/// then the file in the sprite overrules the one on disk, the file
|
||||
/// on disk will be shown
|
||||
/// </summary>
|
||||
HideFileDuplicates
|
||||
}
|
||||
}
|
||||
@@ -112,6 +112,7 @@
|
||||
<Compile Include="Configuration\FileSystemProviderElementCollection.cs" />
|
||||
<Compile Include="Configuration\FileSystemProvidersSection.cs" />
|
||||
<Compile Include="Configuration\UmbracoVersion.cs" />
|
||||
<Compile Include="IconPickerBehaviour.cs" />
|
||||
<Compile Include="CoreBootManager.cs" />
|
||||
<Compile Include="DatabaseContext.cs" />
|
||||
<Compile Include="DataTableExtensions.cs" />
|
||||
|
||||
Reference in New Issue
Block a user