Files
Umbraco-CMS/src/Umbraco.Web/PropertyEditors/NestedContentController.cs
2017-06-05 09:28:52 +02:00

28 lines
820 B
C#

using System.Collections.Generic;
using System.Linq;
using Umbraco.Web.Editors;
using Umbraco.Web.Mvc;
namespace Umbraco.Web.PropertyEditors
{
[PluginController("UmbracoApi")]
public class NestedContentController : UmbracoAuthorizedJsonController
{
[System.Web.Http.HttpGet]
public IEnumerable<object> GetContentTypes()
{
return Services.ContentTypeService.GetAllContentTypes()
.OrderBy(x => x.SortOrder)
.Select(x => new
{
id = x.Id,
guid = x.Key,
name = x.Name,
alias = x.Alias,
icon = x.Icon,
tabs = x.CompositionPropertyGroups.Select(y => y.Name).Distinct()
});
}
}
}