mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-06-28 15:34:39 +08:00
Updated various input elements using NoEncode.
This prevents HTML characters from being encoded when using the tokenizer on element labels.
This commit is contained in:
parent
e29fb90298
commit
68b3fe56d0
@ -38,7 +38,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
protected override void OnDisplaying(Button element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedText = _tokenizer.Replace(element.Text, context.GetTokenData());
|
||||
context.ElementShape.ProcessedText = _tokenizer.Replace(element.Text, context.GetTokenData(), new ReplaceOptions {Encoding = ReplaceOptions.NoEncode});
|
||||
}
|
||||
}
|
||||
}
|
@ -67,7 +67,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
protected override void OnDisplaying(CheckBox element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
context.ElementShape.ProcessedValue = _tokenizer.Replace(element.Value, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
protected override void OnDisplaying(EmailField element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
context.ElementShape.ProcessedValue = element.RuntimeValue;
|
||||
}
|
||||
}
|
||||
|
@ -84,8 +84,8 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
var tokenData = context.GetTokenData();
|
||||
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData);
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData);
|
||||
context.ElementShape.ProcessedOptions = _tokenizer.Replace(element.Options, tokenData).ToArray();
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
context.ElementShape.ProcessedOptions = _tokenizer.Replace(element.Options, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode }).ToArray();
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}__{1}", typeName, element.InputType));
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}_{1}__{2}", typeName, displayType, element.InputType));
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(Fieldset element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedLegend = _tokenizer.Replace(element.Legend, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLegend = _tokenizer.Replace(element.Legend, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
}
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
protected override void OnDisplaying(HiddenField element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedValue = element.Value;
|
||||
context.ElementShape.ProcessedValue = element.RuntimeValue;
|
||||
}
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(Label element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedText = _tokenizer.Replace(element.Text, context.GetTokenData());
|
||||
context.ElementShape.ProcessedText = _tokenizer.Replace(element.Text, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
context.ElementShape.ProcessedFor = _tokenizer.Replace(element.For, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
protected override void OnDisplaying(PasswordField element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
}
|
||||
}
|
||||
}
|
@ -149,7 +149,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
foreach (var contentItem in contentItems) {
|
||||
var data = new {Content = contentItem};
|
||||
var value = _tokenizer.Replace(valueExpression, data);
|
||||
var text = _tokenizer.Replace(textExpression, data);
|
||||
var text = _tokenizer.Replace(textExpression, data, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
|
||||
yield return new SelectListItem {
|
||||
Text = text,
|
||||
|
@ -42,7 +42,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
protected override void OnDisplaying(RadioButton element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
context.ElementShape.ProcessedValue = _tokenizer.Replace(element.Value, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
var tokenData = context.GetTokenData();
|
||||
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData);
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData);
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData, new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
context.ElementShape.TermOptions = GetTermOptions(element, context.DisplayType, taxonomyId, tokenData).ToArray();
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}__{1}", typeName, element.InputType));
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}_{1}__{2}", typeName, displayType, element.InputType));
|
||||
|
@ -90,7 +90,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
protected override void OnDisplaying(TextArea element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
context.ElementShape.ProcessedValue = element.RuntimeValue;
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
protected override void OnDisplaying(UrlField element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData(), new ReplaceOptions { Encoding = ReplaceOptions.NoEncode });
|
||||
context.ElementShape.ProcessedValue = element.RuntimeValue;
|
||||
}
|
||||
}
|
||||
|
@ -5,9 +5,9 @@ using Orchard.Tokens;
|
||||
|
||||
namespace Orchard.DynamicForms.Helpers {
|
||||
public static class TokenizerExtensions {
|
||||
public static IEnumerable<SelectListItem> Replace(this ITokenizer tokenizer, IEnumerable<SelectListItem> items, IDictionary<string, object> data) {
|
||||
public static IEnumerable<SelectListItem> Replace(this ITokenizer tokenizer, IEnumerable<SelectListItem> items, IDictionary<string, object> data, ReplaceOptions options) {
|
||||
return items.Select(item => new SelectListItem {
|
||||
Text = tokenizer.Replace(item.Text, data),
|
||||
Text = tokenizer.Replace(item.Text, data, options),
|
||||
Value = item.Value,
|
||||
Disabled = item.Disabled,
|
||||
Group = item.Group,
|
||||
|
Loading…
Reference in New Issue
Block a user