mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00
Separate driver for lists
--HG-- branch : 1.x extra : rebase_source : 11fd73323325581ec561f1043de916e8c4737b49
This commit is contained in:
@@ -46,8 +46,7 @@ namespace Orchard.Core.Containers.Drivers {
|
|||||||
if (!part.ItemsShown)
|
if (!part.ItemsShown)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return Combined(
|
return ContentShape("Parts_Container_Contained",
|
||||||
ContentShape("Parts_Container_Contained",
|
|
||||||
() => {
|
() => {
|
||||||
var container = part.ContentItem;
|
var container = part.ContentItem;
|
||||||
|
|
||||||
@@ -79,10 +78,7 @@ namespace Orchard.Core.Containers.Drivers {
|
|||||||
List: listShape,
|
List: listShape,
|
||||||
Pager: pagerShape
|
Pager: pagerShape
|
||||||
);
|
);
|
||||||
}),
|
});
|
||||||
ContentShape("Parts_Container_Contained_SummaryAdmin",
|
|
||||||
() => shapeHelper.Parts_Container_Contained_SummaryAdmin(ContentPart: part))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(ContainerPart part, dynamic shapeHelper) {
|
protected override DriverResult Editor(ContainerPart part, dynamic shapeHelper) {
|
||||||
|
@@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using Orchard.ContentManagement.Drivers;
|
||||||
|
using Orchard.Core.Containers.Models;
|
||||||
|
using Orchard.ContentManagement.MetaData;
|
||||||
|
using Orchard.Settings;
|
||||||
|
using Orchard.Core.Feeds;
|
||||||
|
|
||||||
|
namespace Orchard.Lists.Drivers {
|
||||||
|
public class ContainerPartDriver : Orchard.Core.Containers.Drivers.ContainerPartDriver {
|
||||||
|
public ContainerPartDriver(
|
||||||
|
IContentDefinitionManager contentDefinitionManager,
|
||||||
|
IOrchardServices orchardServices,
|
||||||
|
ISiteService siteService,
|
||||||
|
IFeedManager feedManager)
|
||||||
|
: base(contentDefinitionManager, orchardServices, siteService, feedManager)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override DriverResult Display(ContainerPart part, string displayType, dynamic shapeHelper) {
|
||||||
|
var shape = base.Display(part, displayType, (object)shapeHelper); // shapeHelper casting to avoid compiler error
|
||||||
|
|
||||||
|
if (shape == null) return null;
|
||||||
|
|
||||||
|
return Combined(
|
||||||
|
shape,
|
||||||
|
ContentShape("Parts_Container_Contained_SummaryAdmin",
|
||||||
|
() => shapeHelper.Parts_Container_Contained_SummaryAdmin(ContentPart: part))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -49,6 +49,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AdminMenu.cs" />
|
<Compile Include="AdminMenu.cs" />
|
||||||
|
<Compile Include="Drivers\ContainerPartDriver.cs" />
|
||||||
<Compile Include="Handlers\ContainerPartHandler.cs" />
|
<Compile Include="Handlers\ContainerPartHandler.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Routes.cs" />
|
<Compile Include="Routes.cs" />
|
||||||
@@ -105,6 +106,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Admin\Choose.cshtml" />
|
<Content Include="Views\Admin\Choose.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Reference in New Issue
Block a user