From 9676374e31f0319297599ac0cddabab995ce13c1 Mon Sep 17 00:00:00 2001 From: Per Djurner Date: Sun, 14 May 2017 17:55:11 +0200 Subject: [PATCH] Encoding for form helpers. --- wheels/events/onapplicationstart.cfm | 8 ++++---- wheels/view/forms.cfm | 27 +++++++++++++++++---------- wheels/view/formsobject.cfm | 6 ++++-- wheels/view/formsplain.cfm | 4 +++- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/wheels/events/onapplicationstart.cfm b/wheels/events/onapplicationstart.cfm index d0d9e554d..f9d1d8b60 100644 --- a/wheels/events/onapplicationstart.cfm +++ b/wheels/events/onapplicationstart.cfm @@ -281,7 +281,7 @@ public void function onApplicationStart() { application.$wheels.functions.average = {distinct=false, parameterize=true, ifNull=""}; application.$wheels.functions.belongsTo = {joinType="inner"}; application.$wheels.functions.buttonTo = {onlyPath=true, host="", protocol="", port=0, text="", image=""}; - application.$wheels.functions.buttonTag = {type="submit", value="save", content="Save changes", image="", prepend="", append=""}; + application.$wheels.functions.buttonTag = {type="submit", value="save", content="Save changes", image="", prepend="", append="", encode=false}; application.$wheels.functions.caches = {time=60, static=false}; application.$wheels.functions.checkBox = {label="useDefaultLabel", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel="", errorElement="span", errorClass="fieldWithErrors", checkedValue=1, unCheckedValue=0}; application.$wheels.functions.checkBoxTag = {label="", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel="", value=1}; @@ -345,12 +345,12 @@ public void function onApplicationStart() { application.$wheels.functions.simpleFormat = {wrap=true}; application.$wheels.functions.startFormTag = {onlyPath=true, host="", protocol="", port=0, method="post", multipart=false, prepend="", append=""}; application.$wheels.functions.styleSheetLinkTag = {type="text/css", media="all", head=false, encode=false}; - application.$wheels.functions.submitTag = {value="Save changes", image="", prepend="", append=""}; + application.$wheels.functions.submitTag = {value="Save changes", image="", prepend="", append="", encode=false}; application.$wheels.functions.sum = {distinct=false, parameterize=true, ifNull=""}; application.$wheels.functions.textArea = {label="useDefaultLabel", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel="", errorElement="span", errorClass="fieldWithErrors"}; application.$wheels.functions.textAreaTag = {label="", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel=""}; - application.$wheels.functions.textField = {label="useDefaultLabel", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel="", errorElement="span", errorClass="fieldWithErrors"}; - application.$wheels.functions.textFieldTag = {label="", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel=""}; + application.$wheels.functions.textField = {label="useDefaultLabel", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel="", errorElement="span", errorClass="fieldWithErrors", encode=false}; + application.$wheels.functions.textFieldTag = {label="", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel="", encode=false}; application.$wheels.functions.timeAgoInWords = {includeSeconds=false}; application.$wheels.functions.timeSelect = {label=false, labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel="", errorElement="span", errorClass="fieldWithErrors", includeBlank=false, order="hour,minute,second", separator=":", minuteStep=1, secondStep=1, twelveHour=false}; application.$wheels.functions.timeSelectTags = {label="", labelPlacement="around", prepend="", append="", prependToLabel="", appendToLabel="", includeBlank=false, order="hour,minute,second", separator=":", minuteStep=1, secondStep=1, twelveHour=false}; diff --git a/wheels/view/forms.cfm b/wheels/view/forms.cfm index 468b9c53c..9ed73a2c5 100644 --- a/wheels/view/forms.cfm +++ b/wheels/view/forms.cfm @@ -138,12 +138,14 @@ public string function startFormTag( * @image File name of the image file to use in the button form control. * @prepend [see:textField] * @append [see:textField] + * @encode [see:styleSheetLinkTag]. */ public string function submitTag( string value, string image, string prepend, - string append + string append, + boolean encode ) { $args(name="submitTag", reserved="type,src", args=arguments); local.rv = arguments.prepend; @@ -160,7 +162,7 @@ public string function submitTag( local.rv = Replace(local.rv, "