Lists no longer need to specialize the entire Content.SummaryAdmin shape by using the new AdminLink metadata.

--HG--
branch : dev
This commit is contained in:
Dave Reed
2011-03-07 11:04:48 -08:00
parent c158caba49
commit 0d92ef27fa
5 changed files with 20 additions and 40 deletions

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Web.Routing;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.Handlers;
@@ -70,5 +71,20 @@ namespace Orchard.Core.Containers.Drivers {
part.Record.OrderByDirection = (int)OrderByDirection.Descending;
});
}
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var container = context.ContentItem.As<ContainerPart>();
if (container == null)
return;
// containers link to their contents in admin screens
context.Metadata.AdminRouteValues = new RouteValueDictionary {
{"Area", "Contents"},
{"Controller", "Admin"},
{"Action", "List"},
{"containerId", container.Id}
};
}
}
}