mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Compilation.Razor;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
@@ -16,15 +15,12 @@ using Orchard.Utility.Extensions;
|
||||
namespace Orchard.Templates.Drivers {
|
||||
public class ShapePartDriver : ContentPartDriver<ShapePart> {
|
||||
private readonly IEnumerable<ITemplateProcessor> _processors;
|
||||
private readonly IRazorTemplateHolder _templateHolder;
|
||||
private readonly ITransactionManager _transactions;
|
||||
|
||||
public ShapePartDriver(
|
||||
IEnumerable<ITemplateProcessor> processors,
|
||||
IRazorTemplateHolder templateHolder,
|
||||
ITransactionManager transactions) {
|
||||
_processors = processors;
|
||||
_templateHolder = templateHolder;
|
||||
_transactions = transactions;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
@@ -48,7 +44,6 @@ namespace Orchard.Templates.Drivers {
|
||||
try {
|
||||
var processor = _processors.FirstOrDefault(x => String.Equals(x.Type, part.ProcessorName, StringComparison.OrdinalIgnoreCase)) ?? _processors.First();
|
||||
processor.Verify(part.Template);
|
||||
_templateHolder.Set(part.Name, part.Template);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
updater.AddModelError("", T("Template processing error: {0}", ex.Message));
|
||||
|
||||
Reference in New Issue
Block a user