mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-23 13:22:08 +08:00
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045007
34 lines
1.4 KiB
C#
34 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using JetBrains.Annotations;
|
|
using Orchard.Core.Common.Models;
|
|
using Orchard.Data;
|
|
using Orchard.ContentManagement;
|
|
using Orchard.ContentManagement.Handlers;
|
|
using Orchard.Sandbox.Controllers;
|
|
|
|
namespace Orchard.Sandbox.Models {
|
|
[UsedImplicitly]
|
|
public class SandboxContentHandler : ContentHandler {
|
|
|
|
public SandboxContentHandler(
|
|
IRepository<SandboxPageRecord> pageRepository,
|
|
IRepository<SandboxSettingsRecord> settingsRepository) {
|
|
|
|
// define the "sandboxpage" content type
|
|
Filters.Add(new ActivatingFilter<SandboxPage>(SandboxPageDriver.ContentType.Name));
|
|
Filters.Add(new ActivatingFilter<CommonAspect>(SandboxPageDriver.ContentType.Name));
|
|
Filters.Add(new ActivatingFilter<RoutableAspect>(SandboxPageDriver.ContentType.Name));
|
|
Filters.Add(new ActivatingFilter<BodyAspect>(SandboxPageDriver.ContentType.Name));
|
|
Filters.Add(new StorageFilter<SandboxPageRecord>(pageRepository) );
|
|
|
|
|
|
|
|
// add settings to site, and simple record-template gui
|
|
Filters.Add(new ActivatingFilter<ContentPart<SandboxSettingsRecord>>("site"));
|
|
Filters.Add(new StorageFilter<SandboxSettingsRecord>(settingsRepository));
|
|
Filters.Add(new TemplateFilterForRecord<SandboxSettingsRecord>("SandboxSettings", "Parts/Sandbox.SiteSettings"));
|
|
|
|
}
|
|
}
|
|
}
|