diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs index 15e6978f92..aadbc2ec5c 100644 --- a/src/Umbraco.Web/Editors/EntityController.cs +++ b/src/Umbraco.Web/Editors/EntityController.cs @@ -315,6 +315,10 @@ namespace Umbraco.Web.Editors //now we need to convert the unknown ones switch (entityType) { + case UmbracoEntityTypes.PropertyType: + + case UmbracoEntityTypes.PropertyGroup: + case UmbracoEntityTypes.Domain: case UmbracoEntityTypes.Language: @@ -364,6 +368,17 @@ namespace Umbraco.Web.Editors var filteredPropertyTypes = ExecutePostFilter(propertyTypes, postFilter, postFilterParams); return Mapper.Map, IEnumerable>(filteredPropertyTypes); + case UmbracoEntityTypes.PropertyGroup: + + //get all document types, then combine all property types into one list + var propertyGroups = Services.ContentTypeService.GetAllContentTypes().Cast() + .Concat(Services.ContentTypeService.GetAllMediaTypes()) + .ToArray() + .SelectMany(x => x.PropertyGroups) + .DistinctBy(composition => composition.Name); + var filteredpropertyGroups = ExecutePostFilter(propertyGroups, postFilter, postFilterParams); + return Mapper.Map, IEnumerable>(filteredpropertyGroups); + case UmbracoEntityTypes.User: var users = Services.UserService.GetAllUsers(); @@ -391,6 +406,8 @@ namespace Umbraco.Web.Editors switch (entityType) { case UmbracoEntityTypes.PropertyType: + + case UmbracoEntityTypes.PropertyGroup: case UmbracoEntityTypes.Domain: @@ -421,6 +438,8 @@ namespace Umbraco.Web.Editors switch (entityType) { case UmbracoEntityTypes.PropertyType: + + case UmbracoEntityTypes.PropertyGroup: case UmbracoEntityTypes.Domain: diff --git a/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs b/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs index 8743e3cbd2..617350bcd6 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs @@ -83,6 +83,11 @@ /// /// Property Type /// - PropertyType + PropertyType, + + /// + /// Property Group + /// + PropertyGroup } } \ No newline at end of file diff --git a/src/Umbraco.Web/Models/Mapping/EntityModelMapper.cs b/src/Umbraco.Web/Models/Mapping/EntityModelMapper.cs index ca8ffe6b92..0d5f0f8be4 100644 --- a/src/Umbraco.Web/Models/Mapping/EntityModelMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/EntityModelMapper.cs @@ -23,6 +23,13 @@ namespace Umbraco.Web.Models.Mapping .ForMember(basic => basic.Path, expression => expression.UseValue("")) .ForMember(basic => basic.ParentId, expression => expression.UseValue(-1)); + config.CreateMap() + .ForMember(basic => basic.Icon, expression => expression.UseValue("icon-tab")) + .ForMember(basic => basic.Path, expression => expression.UseValue("")) + .ForMember(basic => basic.ParentId, expression => expression.UseValue(-1)) + //in v6 the 'alias' is it's lower cased name so we'll stick to that. + .ForMember(basic => basic.Alias, expression => expression.MapFrom(group => group.Name.ToLowerInvariant())); + config.CreateMap() .ForMember(basic => basic.Icon, expression => expression.UseValue("icon-user")) .ForMember(basic => basic.Path, expression => expression.UseValue("")) diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs new file mode 100644 index 0000000000..473bbd034a --- /dev/null +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs @@ -0,0 +1,16 @@ +using Umbraco.Core.PropertyEditors; + +namespace Umbraco.Web.PropertyEditors.ParameterEditors +{ + [ParameterEditor("tabPickerMultiple", "Multiple Tab Picker", "entitypicker")] + public class MultiplePropertyGroupParameterEditor : ParameterEditor + { + public MultiplePropertyGroupParameterEditor() + { + Configuration.Add("multiple", "1"); + Configuration.Add("entityType", "PropertyGroup"); + //don't publish the id for a property group, publish it's alias (which is actually just it's lower cased name) + Configuration.Add("publishBy", "alias"); + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs new file mode 100644 index 0000000000..1e6b4e73d9 --- /dev/null +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs @@ -0,0 +1,16 @@ +using Umbraco.Core.PropertyEditors; + +namespace Umbraco.Web.PropertyEditors.ParameterEditors +{ + [ParameterEditor("tabPicker", "Tab Picker", "entitypicker")] + public class PropertyGroupParameterEditor : ParameterEditor + { + public PropertyGroupParameterEditor() + { + Configuration.Add("multiple", "0"); + Configuration.Add("entityType", "PropertyGroup"); + //don't publish the id for a property group, publish it's alias (which is actually just it's lower cased name) + Configuration.Add("publishBy", "alias"); + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 13f28eb131..6b756d6139 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -348,7 +348,9 @@ + +