Index: openacs-4/packages/acs-templating/tcl/list-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/list-procs.tcl,v diff -u -N -r1.79 -r1.80 --- openacs-4/packages/acs-templating/tcl/list-procs.tcl 30 Apr 2018 12:45:00 -0000 1.79 +++ openacs-4/packages/acs-templating/tcl/list-procs.tcl 1 May 2018 08:23:06 -0000 1.80 @@ -3206,7 +3206,7 @@ set filter_key_filters {} set filter_exclude_from_key [list orderby groupby format page __list_view] if {[llength $filter_exclude_from_key_extra]} { - set filter_exclude_from_key [concat $filter_exclude_from_key $filter_exclude_from_key_extra] + lappend filter_exclude_from_key {*}$filter_exclude_from_key_extra } set filter_hidden_filters_url_vars {} # loop through all the filters in this list Index: openacs-4/packages/acs-templating/tcl/widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/widget-procs.tcl,v diff -u -N -r1.60 -r1.61 --- openacs-4/packages/acs-templating/tcl/widget-procs.tcl 25 Apr 2018 19:23:26 -0000 1.60 +++ openacs-4/packages/acs-templating/tcl/widget-procs.tcl 1 May 2018 08:23:06 -0000 1.61 @@ -166,9 +166,9 @@ unset -nocomplain element(options) - template::element::set_error $element(form_id) $element_id " - No matches were found for \"$search_string\".
Please - try again." + template::element::set_error $element(form_id) $element_id [subst { + No matches were found for "[ns_quotehtml $search_string]".
Please try again. + }] } else { # we need to return a select list @@ -177,11 +177,10 @@ if { [llength $persons] > 0 } { set options $persons - set options [concat $options [list [list "---" ""]]] + lappend options [list "---" ""] } if { [llength $groups_relsegs] > 0 } { - set options [concat $options $groups_relsegs] - set options [concat $options [list [list "---" ""]]] + lappend options {*}$groups_relsegs [list "---" ""] } set element(options) [concat $options { { "Search again..." ":search:" } }] if { ![info exists value] } { @@ -194,8 +193,8 @@ } } - if { [info exists element(result_datatype)] && - [ns_queryexists $element_id:select] } { + if { [info exists element(result_datatype)] + && [ns_queryexists $element_id:select] } { set element(datatype) $element(result_datatype) } @@ -246,9 +245,10 @@ # include an extra hidden element to indicate that the # value is being selected as opposed to entered - set output "\n" - append output [select element $tag_attributes] - + set output "" + append output \ + [subst {\n}] \ + [select element $tag_attributes] } @@ -329,7 +329,7 @@ if { $value ne "" } { append output \ [ns_quotehtml $value] \ - "" + [subst {}] } } else { if {$tag ne "textarea"} { @@ -388,15 +388,19 @@ array set attributes $tag_attributes - if { ( $type eq "checkbox" || $type eq "radio" ) && [info exists element(value)] } { + if { ( $type eq "checkbox" || $type eq "radio" ) + && [info exists element(value)] + } { # This can be used in the form template in a tag. set attributes(id) "$element(form_id):elements:$element(name):$element(value)" } elseif { $type in {"password" "text" "button" "file" }} { set attributes(id) "$element(name)" } # Handle display mode of visible normal form elements, i.e. not hidden, not submit, not button, not clear - if { $element(mode) ne "edit" && $type ni { hidden submit button clear checkbox radio } } { + if { $element(mode) ne "edit" + && $type ni { hidden submit button clear checkbox radio } + } { set output "" if { [info exists element(value)] } { append output [ns_quotehtml $element(value)] @@ -405,7 +409,9 @@ } else { set output [subst {[_ acs-templating.Spellcheck]: [menu "$element(id).spellcheck" [nsv_get spellchecker lang_options] $spellcheck(selected_option) {}]" } else { @@ -514,7 +522,9 @@ # were ignored, preventing the export of multiple values by hidden formfields. # I changed this by saying that field is multiple whenever element(values) # exists and is not null. - if { [info exists element(values)] && $element(values) ne "" } { + if { [info exists element(values)] + && $element(values) ne "" + } { #ns_log notice "hidden form element with multiple values: <$element(values)>" set output {} set count 0 @@ -686,7 +696,7 @@ append output [subst { [ns_quotehtml $label]
\n}] @@ -835,7 +845,7 @@ } template::element::set_error $element(form_id) $element_id \ - "No matches were found for \"$value\".
Please\ntry again." + [subst {No matches were found for "[ns_quotehtml $value]".
Please\ntry again.}] } elseif { $option_count == 1 } { @@ -847,14 +857,15 @@ # need to return a select list set element(options) [concat $options { { "Search again..." ":search:" } }] template::element::set_error $element(form_id) $element_id \ - "More than one match was found for \"$value\".
Please\nchoose one from the list." + [subst {More than one match was found for "[ns_quotehtml $value]".
+ Please choose one from the list.}] set value [lindex $options 0 1] } } - if { [info exists element(result_datatype)] && - [ns_queryexists $element_id:select] } { + if { [info exists element(result_datatype)] + && [ns_queryexists $element_id:select] } { set element(datatype) $element(result_datatype) } @@ -894,7 +905,9 @@ append output [textarea $element_reference $tag_attributes] - if { [info exists element(format_element)] && [info exists element(format_options)] } { + if { [info exists element(format_element)] + && [info exists element(format_options)] + } { append output "
Format: [menu $element(format_element) $element(format_options) {} {}]" } } @@ -940,19 +953,26 @@ } append output "" } elseif {$count == 1} { - append output "[lindex $option 0]" + append output \ + {} \ + {} \ + [ns_quotehtml [lindex $option 0]] \ + {} foreach answer_set [lindex $option 1] { append output "required?" foreach answer $answer_set { - append output "$answer" + append output "[ns_quotehtml $answer]" } } - append output "" + append output {} } else { append output "[lindex $option 0]" foreach question [lindex $option 1] { lassign $question name required_p - append output "[ad_decode $required_p "t" "*" " "]" + append output \ + "" \ + [ad_decode $required_p "t" "*" " "] \ + "" foreach choice [lindex $question 2] { if {$choice ni $value} { append output "" @@ -1075,11 +1095,12 @@ } else { # display mode if { [info exists element(value)] } { - append output [template::util::select_text::get_property select_value $element(value)] - append output " " - append output [template::util::select_text::get_property text_value $element(value)] - append output "" - append output "" + append output \ + [template::util::select_text::get_property select_value $element(value)] \ + " " \ + [template::util::select_text::get_property text_value $element(value)] \ + [subst {}] \ + [subst {}] } } @@ -1191,12 +1212,12 @@ append output "$radio_text value=\"$value\"" if { [info exists values($value)] } { - append output " checked=\"checked\"" + append output { checked="checked"} } if {$element(mode) ne "edit"} { append output " disabled" } - append output ">$label
" + append output ">[ns_quotehtml $label]
" } if {![info exists element(other_label)]} { set element(other_label) "[_ acs-templating.Other]" @@ -1260,7 +1281,9 @@ return [lindex $checkbox_list 1] } default { - error "Parameter supplied to util::checkbox_text::get_property 'what' must be one of: checkbox_value, text_value. You specified: '$what'." + error "Parameter supplied to util::checkbox_text::get_property\ + 'what' must be one of: checkbox_value, text_value.\ + You specified: '$what'." } } } @@ -1302,7 +1325,7 @@ foreach name [array names attributes] { if {$attributes($name) eq {}} { - append checkbox_text " $name" + append checkbox_text " [ns_quotehtml $name]" } else { append checkbox_text [subst { $name="$attributes($name)"}] } @@ -1314,19 +1337,23 @@ foreach option $element(options) { lassign $option label value - append output "$checkbox_text value=\"$value\"" + append output \ + $checkbox_text \ + [subst { value="[ns_quotehtml $value]"}] + if { [info exists values($value)] } { - append output " checked=\"checked\"" + append output { checked="checked"} } - append output ">$label
" + append output ">[ns_quotehtml $label]
" } if {![info exists element(other_label)]} { - set element(other_label) "[_ acs-templating.Other]" + set element(other_label) [_ acs-templating.Other] } - append output "$element(other_label): " set element(value) $text set element(name) $element(name)\.text - append output [template::widget::input text element $tag_attributes] + append output \ + "$element(other_label): " + [template::widget::input text element $tag_attributes] return $output }