mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Converting widgets to new shape API.
--HG-- branch : dev
This commit is contained in:
@@ -9,10 +9,8 @@ namespace Orchard.Widgets.Drivers {
|
||||
public class LayerPartDriver : ContentPartDriver<LayerPart> {
|
||||
|
||||
protected override DriverResult Editor(LayerPart layerPart, dynamic shapeHelper) {
|
||||
|
||||
// TODO: andrerod convert to new shape API. Location code kept for reference.
|
||||
// ContentLocation location = layerPart.GetLocation("Editor");
|
||||
return ContentPartTemplate(layerPart, "Parts/Widgets.LayerPart"); //.Location(location);
|
||||
return ContentShape("Parts_Widgets_LayerPart",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: "Parts/Widgets.LayerPart", Model: layerPart));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(LayerPart layerPart, IUpdateModel updater, dynamic shapeHelper) {
|
||||
|
@@ -5,12 +5,9 @@ using Orchard.Widgets.Models;
|
||||
namespace Orchard.Widgets.Drivers {
|
||||
[UsedImplicitly]
|
||||
public class WidgetBagPartDriver : ContentPartDriver<WidgetBagPart> {
|
||||
private const string TemplateName = "Parts/Widgets.WidgetBagPart";
|
||||
|
||||
protected override DriverResult Editor(WidgetBagPart part, dynamic shapeHelper) {
|
||||
//var location = part.GetLocation("Editor");
|
||||
// TODO: andrerod convert to new shape API. Location code kept for reference.
|
||||
return ContentPartTemplate("", TemplateName, Prefix); //.Location(location);
|
||||
return ContentShape("Parts_Widgets_WidegetBagPart",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: "Parts/Widgets.WidgetBagPart", Model: part));
|
||||
}
|
||||
}
|
||||
}
|
@@ -17,9 +17,8 @@ namespace Orchard.Widgets.Drivers {
|
||||
protected override DriverResult Editor(WidgetPart widgetPart, dynamic shapeHelper) {
|
||||
widgetPart.AvailableZones = _widgetsService.GetZones();
|
||||
|
||||
// TODO: andrerod convert to new shape API. Location code kept for reference.
|
||||
//ContentLocation location = widgetPart.GetLocation("Editor");
|
||||
return ContentPartTemplate(widgetPart, "Parts/Widgets.WidgetPart"); //.Location(location);
|
||||
return ContentShape("Parts_Widgets_WidgetPart",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: "Parts/Widgets.WidgetPart", Model: widgetPart));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(WidgetPart widgetPart, IUpdateModel updater, dynamic shapeHelper) {
|
||||
|
@@ -64,26 +64,6 @@ namespace Orchard.Widgets {
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
ContentDefinitionManager.AlterPartDefinition(typeof(LayerPart).Name,
|
||||
cfg => cfg
|
||||
.WithLocation(new Dictionary<string, ContentLocation> {
|
||||
{"Editor", new ContentLocation { Zone = "Primary", Position = "1" }}
|
||||
})
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition(typeof(WidgetPart).Name,
|
||||
cfg => cfg
|
||||
.WithLocation(new Dictionary<string, ContentLocation> {
|
||||
{"Editor", new ContentLocation { Zone = "Primary", Position = "1" }}
|
||||
})
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition(typeof(WidgetBagPart).Name,
|
||||
cfg => cfg
|
||||
.WithLocation(new Dictionary<string, ContentLocation> {
|
||||
{"Editor", new ContentLocation {Zone = "Primary", Position = "5"}}
|
||||
})
|
||||
);
|
||||
ContentDefinitionManager.AlterTypeDefinition("WidgetPage",
|
||||
cfg => cfg
|
||||
.WithPart("CommonPart")
|
||||
|
@@ -97,7 +97,9 @@
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<None Include="Placement.info" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
|
5
src/Orchard.Web/Modules/Orchard.Widgets/Placement.info
Normal file
5
src/Orchard.Web/Modules/Orchard.Widgets/Placement.info
Normal file
@@ -0,0 +1,5 @@
|
||||
<Placement>
|
||||
<Place Parts_Widgets_LayerPart="Primary:1"/>
|
||||
<Place Parts_Widgets_WidgetPart="Primary:1"/>
|
||||
<Place Parts_Widgets_WidegetBagPart="Primary:5"/>
|
||||
</Placement>
|
Reference in New Issue
Block a user