Reverting comments filters changes

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2013-07-10 17:07:46 -07:00
parent 6f7bc1b87a
commit 7d19c8de7a
18 changed files with 54 additions and 135 deletions

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using JetBrains.Annotations;
@@ -38,13 +37,12 @@ namespace Orchard.Core.Common.Drivers {
return Combined(
ContentShape("Parts_Common_Body",
() => {
var flavor = GetFlavor(part);
var bodyText = _htmlFilters.Where(x => x.GetType().Name.Equals(flavor + "filter", StringComparison.OrdinalIgnoreCase)).Aggregate(part.Text, (text, filter) => filter.ProcessContent(text));
var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(part)));
return shapeHelper.Parts_Common_Body(Html: new HtmlString(bodyText));
}),
ContentShape("Parts_Common_Body_Summary",
() => {
var bodyText = _htmlFilters.Where(x => x.GetType().Name.Equals(GetFlavor(part) + "filter", StringComparison.OrdinalIgnoreCase)).Aggregate(part.Text, (text, filter) => filter.ProcessContent(text));
var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(part)));
return shapeHelper.Parts_Common_Body_Summary(Html: new HtmlString(bodyText));
})
);

View File

@@ -39,7 +39,7 @@ namespace Orchard.Core.Common.Drivers {
() => {
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
object fieldValue = new HtmlString(_htmlFilters.Where(x => x.GetType().Name.Equals(settings.Flavor + "filter", StringComparison.OrdinalIgnoreCase)).Aggregate(field.Value, (text, filter) => filter.ProcessContent(text)));
object fieldValue = new HtmlString(_htmlFilters.Aggregate(field.Value, (text, filter) => filter.ProcessContent(text, settings.Flavor)));
return shapeHelper.Fields_Common_Text(Name: field.Name, Value: fieldValue);
});
}

View File

@@ -6,7 +6,7 @@ using Orchard.Services;
namespace Orchard.Core.Common.Services {
public class BbcodeFilter : IHtmlFilter {
public string ProcessContent(string text) {
public string ProcessContent(string text, string flavor) {
return BbcodeReplace(text);
}

View File

@@ -50,7 +50,7 @@ namespace Orchard.Core.Feeds.StandardBuilders {
public string Description {
get {
if (_body != null && !string.IsNullOrEmpty(_body.Text)) {
return _htmlFilters.Where(x => x.GetType().Name.Equals(GetFlavor(_body) + "filter", StringComparison.OrdinalIgnoreCase)).Aggregate(_body.Text, (text, filter) => filter.ProcessContent(text));
return _htmlFilters.Aggregate(_body.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(_body)));
}
return Title;
}