Some work on the Containers front end. Creating a default page size site setting for containers.

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-09 16:00:51 -08:00
parent 9bf3368b25
commit 48f803b082
9 changed files with 88 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.Handlers;
using Orchard.Core.Containers.Models;
using Orchard.Data;
@@ -21,8 +22,12 @@ namespace Orchard.Core.Containers.Drivers {
}
public class ContainerPartHandler : ContentHandler {
public ContainerPartHandler(IRepository<ContainerPartRecord> repository) {
public ContainerPartHandler(IRepository<ContainerPartRecord> repository, IOrchardServices orchardServices) {
Filters.Add(StorageFilter.For(repository));
OnInitializing<ContainerPart>((context, part) => {
var containerSiteSettings = orchardServices.WorkContext.CurrentSite.As<ContainerSettingsPart>().Record;
part.Record.PageSize = containerSiteSettings.DefaultPageSize;
});
}
}
}