Layout editor improvements.

- Implemented Removed element event.
- Fixed model validation in Element editor dialog.
- Extended support for placeable content.
This commit is contained in:
Sipke Schoorstra
2015-10-03 00:28:48 +02:00
parent 39a6e10c76
commit 8535644b99
6 changed files with 23 additions and 17 deletions

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.ContentManagement.FieldStorage.InfosetStorage;
using Orchard.ContentManagement.MetaData.Models;
using Orchard.Core.Contents.Settings;
using Orchard.Environment;
@@ -135,9 +134,11 @@ namespace Orchard.Layouts.Providers {
}
private IEnumerable<ContentTypeDefinition> GetPlaceableContentTypeDefinitions() {
// Select all types that have either "Placeable" set ot true or the "Widget" or "Element" stereotype.
var contentTypeDefinitionsQuery =
from contentTypeDefinition in _contentManager.Value.GetContentTypeDefinitions()
where contentTypeDefinition.Settings.GetModel<ContentTypeLayoutSettings>().Placeable
let stereotype = contentTypeDefinition.Settings.ContainsKey("Stereotype") ? contentTypeDefinition.Settings["Stereotype"] : default(string)
where contentTypeDefinition.Settings.GetModel<ContentTypeLayoutSettings>().Placeable || stereotype == "Widget" || stereotype == "Element"
select contentTypeDefinition;
return contentTypeDefinitionsQuery.ToList();