Files
Orchard/src/Orchard.Web/Modules/Orchard.Widgets/Drivers/WidgetPartDriver.cs
Andre Rodrigues 140f4d22cc Renamed widget editor template files.
--HG--
branch : dev
2010-10-11 10:26:23 -07:00

30 lines
1.1 KiB
C#

using JetBrains.Annotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.Core.ContentsLocation.Models;
using Orchard.Widgets.Models;
using Orchard.Widgets.Services;
namespace Orchard.Widgets.Drivers {
[UsedImplicitly]
public class WidgetPartDriver : ContentPartDriver<WidgetPart> {
private readonly IWidgetsService _widgetsService;
public WidgetPartDriver(IWidgetsService widgetsService) {
_widgetsService = widgetsService;
}
protected override DriverResult Editor(WidgetPart widgetPart, dynamic shapeHelper) {
widgetPart.AvailableZones = _widgetsService.GetZones();
ContentLocation location = widgetPart.GetLocation("Editor");
return ContentPartTemplate(widgetPart, "Parts/Widgets.WidgetPart").Location(location);
}
protected override DriverResult Editor(WidgetPart widgetPart, IUpdateModel updater, dynamic shapeHelper) {
updater.TryUpdateModel(widgetPart, Prefix, null, null);
return Editor(widgetPart, shapeHelper);
}
}
}