diff --git a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs index 1722eecf79..629cf0b7be 100644 --- a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using AutoMapper; using Umbraco.Core; @@ -28,7 +29,7 @@ namespace Umbraco.Web.Models.Mapping public TabsAndPropertiesResolver(ILocalizedTextService localizedTextService, IEnumerable ignoreProperties) : this(localizedTextService) - { + { if (ignoreProperties == null) throw new ArgumentNullException("ignoreProperties"); IgnoreProperties = ignoreProperties; } @@ -84,7 +85,7 @@ namespace Umbraco.Web.Models.Mapping Alias = string.Format("{0}createdate", Constants.PropertyEditors.InternalGenericPropertiesPrefix), Label = localizedTextService.Localize("content/createDate"), Description = localizedTextService.Localize("content/createDateDesc"), - Value = display.CreateDate.ToIsoString(), + Value = display.CreateDate.ToString(CultureInfo.CurrentCulture), View = labelEditor }, new ContentPropertyDisplay @@ -92,7 +93,7 @@ namespace Umbraco.Web.Models.Mapping Alias = string.Format("{0}updatedate", Constants.PropertyEditors.InternalGenericPropertiesPrefix), Label = localizedTextService.Localize("content/updateDate"), Description = localizedTextService.Localize("content/updateDateDesc"), - Value = display.UpdateDate.ToIsoString(), + Value = display.UpdateDate.ToString(CultureInfo.CurrentCulture), View = labelEditor } }; @@ -132,8 +133,8 @@ namespace Umbraco.Web.Models.Mapping switch (entityType) { case "content": - dtdId = Constants.System.DefaultContentListViewDataTypeId; - + dtdId = Constants.System.DefaultContentListViewDataTypeId; + break; case "media": dtdId = Constants.System.DefaultMediaListViewDataTypeId; @@ -146,7 +147,7 @@ namespace Umbraco.Web.Models.Mapping } //first try to get the custom one if there is one - var dt = dataTypeService.GetDataTypeDefinitionByName(customDtdName) + var dt = dataTypeService.GetDataTypeDefinitionByName(customDtdName) ?? dataTypeService.GetDataTypeDefinitionById(dtdId); if (dt == null) @@ -170,15 +171,15 @@ namespace Umbraco.Web.Models.Mapping var listViewConfig = editor.PreValueEditor.ConvertDbToEditor(editor.DefaultPreValues, preVals); //add the entity type to the config - listViewConfig["entityType"] = entityType; - + listViewConfig["entityType"] = entityType; + //Override Tab Label if tabName is provided if (listViewConfig.ContainsKey("tabName")) { var configTabName = listViewConfig["tabName"]; if (configTabName != null && string.IsNullOrWhiteSpace(configTabName.ToString()) == false) listViewTab.Label = configTabName.ToString(); - } + } var listViewProperties = new List(); listViewProperties.Add(new ContentPropertyDisplay @@ -195,9 +196,9 @@ namespace Umbraco.Web.Models.Mapping SetChildItemsTabPosition(display, listViewConfig, listViewTab); } - private static void SetChildItemsTabPosition(TabbedContentItem display, + private static void SetChildItemsTabPosition(TabbedContentItem display, IDictionary listViewConfig, - Tab listViewTab) + Tab listViewTab) where TPersisted : IContentBase { // Find position of tab from config @@ -237,9 +238,9 @@ namespace Umbraco.Web.Models.Mapping var groupsGroupsByName = content.PropertyGroups.OrderBy(x => x.SortOrder).GroupBy(x => x.Name); foreach (var groupsByName in groupsGroupsByName) { - var properties = new List(); - - // merge properties for groups with the same name + var properties = new List(); + + // merge properties for groups with the same name foreach (var group in groupsByName) { var groupProperties = content.GetPropertiesForGroup(group) @@ -281,8 +282,8 @@ namespace Umbraco.Web.Models.Mapping tabs.Add(new Tab { - Id = 0, - Label = _localizedTextService.Localize("general/properties"), + Id = 0, + Label = _localizedTextService.Localize("general/properties"), Alias = "Generic properties", Properties = genericproperties });