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.38 -r1.39 --- openacs-4/packages/acs-templating/tcl/widget-procs.tcl 3 May 2005 10:26:04 -0000 1.38 +++ openacs-4/packages/acs-templating/tcl/widget-procs.tcl 3 May 2005 21:23:37 -0000 1.39 @@ -437,16 +437,17 @@ values_list attribute_reference {mode edit} + {widget_type select} } { upvar $attribute_reference attributes # Create an array for easier testing of selected values template::util::list_to_lookup $values_list values + set output {} if { ![string equal $mode "edit"] } { set selected_list [list] - set output {} foreach option $options_list { @@ -461,32 +462,52 @@ append output [join $selected_list ", "] } else { + switch -exact -- $widget_type { + checkbox - + radio { + if {[info exists attributes(multiple)]} { + set widget_type radio + } + foreach option $options_list { - - set output "\n" - set label [lindex $option 0] - set value [lindex $option 1] + foreach option $options_list { - append output " \n" + append output " \n" + } + append output "" + } } - append output "" } return $output @@ -547,8 +568,8 @@ if { [info exists element(options)] } { unset element(options) } - template::element::set_error $element(form_id) $element_id " - Please enter a search string." + template::element::set_error $element(form_id) $element_id \ + "Please enter a search string." return [list] } @@ -574,9 +595,8 @@ unset element(options) } - template::element::set_error $element(form_id) $element_id " - No matches were found for \"$value\".
Please - try again." + template::element::set_error $element(form_id) $element_id \ + "No matches were found for \"$value\".
Please\ntry again." } elseif { $option_count == 1 } { @@ -587,9 +607,8 @@ # 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 - choose one from the list." + template::element::set_error $element(form_id) $element_id \ + "More than one match was found for \"$value\".
Please\nchoose one from the list." set value [lindex [lindex $options 0] 1] } @@ -691,8 +710,8 @@ } incr count } + return "$output
" - } Index: openacs-4/packages/categories/tcl/widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/widget-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/categories/tcl/widget-procs.tcl 10 Mar 2005 23:49:05 -0000 1.14 +++ openacs-4/packages/categories/tcl/widget-procs.tcl 3 May 2005 21:23:37 -0000 1.15 @@ -23,10 +23,17 @@ array set attributes $element(html) array set ms_attributes $element(html) } + array set attributes $tag_attributes array set ms_attributes $tag_attributes + + if { ![info exists element(display_widget)] } { + set display_widget select + } else { + set display_widget $element(display_widget) + } set ms_attributes(multiple) {} - + set all_single_p [info exists attributes(single)] # Determine the size automatically for a multiselect @@ -116,10 +123,10 @@ if { $require_category_p == "f" } { set one_tree [concat [list [list "" ""]] $one_tree] } - append output [template::widget::menu $element(name) $one_tree $mapped_categories attributes $element(mode)] + append output [template::widget::menu $element(name) $one_tree $mapped_categories attributes $element(mode) $display_widget] } else { # multiselect widget (if user didn't override with single option) - append output [template::widget::menu $element(name) $one_tree $mapped_categories ms_attributes $element(mode)] + append output [template::widget::menu $element(name) $one_tree $mapped_categories ms_attributes $element(mode) $display_widget] } if { [llength $mapped_trees] > 1 } { append output ""