Making it so multiple warning messages don't appear when creating a new container enabled content item (messages which appear when there are no containable enabled content types in the system)

work item: 16905

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-12-01 23:59:10 -08:00
parent a134940305
commit fd6dc8b92b

View File

@@ -35,16 +35,16 @@ namespace Orchard.Core.Containers.Drivers {
}
protected override DriverResult Editor(ContainerPart part, dynamic shapeHelper) {
return Editor(part, null, shapeHelper);
}
protected override DriverResult Editor(ContainerPart part, IUpdateModel updater, dynamic shapeHelper) {
// if there are no containable items then show a nice little warning
if (!_contentDefinitionManager.ListTypeDefinitions()
.Where(typeDefinition => typeDefinition.Parts.Any(partDefinition => partDefinition.PartDefinition.Name == "ContainablePart")).Any()) {
Services.Notifier.Warning(T("There are no content types in the system with a Containable part attached. Consider adding a Containable part to some content type, existing or new, in order to relate items to this (Container enabled) item."));
}
return Editor(part, null, shapeHelper);
}
protected override DriverResult Editor(ContainerPart part, IUpdateModel updater, dynamic shapeHelper) {
return ContentShape(
"Parts_Container_Edit",
() => {