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 -r1.14 -r1.15 --- openacs-4/packages/acs-templating/tcl/widget-procs.tcl 15 Sep 2002 20:48:59 -0000 1.14 +++ openacs-4/packages/acs-templating/tcl/widget-procs.tcl 2 Jan 2003 17:11:09 -0000 1.15 @@ -38,31 +38,39 @@ upvar $element_reference element - if { [info exists element(html)] } { - array set attributes $element(html) - } - - array set attributes $tag_attributes - - set output "" } - - append output ">" - - if { [info exists element(value)] } { - # As per scottwseago's request - append output [ad_quotehtml $element(value)] - } - - append output "" - + return $output } @@ -94,22 +102,43 @@ set attributes(id) "$element(form_id):elements:$element(name):$element(value)" } - set output "" + # This is ugly, but it works: Only export the value when we're on a selected option + append output "\[ad_decode \$checked \"checked\" \"\" \"\"\]" + } + default { + if { [info exists element(value)] } { + append output [ad_quotehtml $element(value)] + append output "" + } + } + } + } else { + set output "" } - append output " />" - return $output } @@ -180,41 +209,59 @@ } ad_proc -public template::widget::menu { widget_name options_list values_list \ - attribute_reference } { + attribute_reference {mode edit} } { upvar $attribute_reference attributes - - set output "\n" + + foreach option $options_list { + + set label [lindex $option 0] + set value [lindex $option 1] + + append output " \n" + } + + append output "" } - append output "" - return $output } @@ -229,7 +276,7 @@ array set attributes $tag_attributes return [template::widget::menu \ - $element(name) $element(options) $element(values) attributes] + $element(name) $element(options) $element(values) attributes $element(mode)] } ad_proc -public template::widget::multiselect { element_reference tag_attributes } { @@ -255,7 +302,7 @@ } return [template::widget::menu \ - $element(name) $element(options) $element(values) attributes] + $element(name) $element(options) $element(values) attributes $element(mode)] } ad_proc -public template::data::transform::search { element_ref } { @@ -330,38 +377,6 @@ return [list $value] } - - -ad_proc -public template::widget::textarea { element_reference tag_attributes } { - - upvar $element_reference element - - if { [info exists element(html)] } { - array set attributes $element(html) - } - - array set attributes $tag_attributes - - set output "" - return $output -} - ad_proc -public template::widget::comment { element_reference tag_attributes } { upvar $element_reference element @@ -382,25 +397,8 @@ append output "

$element(header)

" } - append output "" - return $output }