Index: openacs-4/packages/acs-templating/resources/forms/standard.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/standard.adp,v diff -u -r1.17.6.2 -r1.17.6.3 --- openacs-4/packages/acs-templating/resources/forms/standard.adp 16 Feb 2007 11:21:09 -0000 1.17.6.2 +++ openacs-4/packages/acs-templating/resources/forms/standard.adp 26 Feb 2007 18:22:05 -0000 1.17.6.3 @@ -20,6 +20,12 @@
+ +
+ + @elements.legendtext@ + + @@ -74,16 +80,12 @@ -
- optional legend (@elements.widget@)- Need to code for this - \@formgroup.widget;noquote@
-
@@ -110,6 +112,9 @@
+ + +
Index: openacs-4/packages/acs-templating/tcl/element-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/element-procs.tcl,v diff -u -r1.25 -r1.25.6.1 --- openacs-4/packages/acs-templating/tcl/element-procs.tcl 20 Apr 2004 21:13:07 -0000 1.25 +++ openacs-4/packages/acs-templating/tcl/element-procs.tcl 26 Feb 2007 18:22:06 -0000 1.25.6.1 @@ -84,6 +84,15 @@ two-element lists in the form { {label value} {label value} {label value} ...} + @option fieldset A list of name-value attribute pairs to include in + the HTML tag for checkboxes and radio FIELDSET. + + @option legend A list of name-value attribute pairs to include in + the HTML tag for checkboxes and radio LEGEND. + + @option legendtext A text for the LEGEND tag to include in + the checkboxes and radio FIELDSET block + @option value The default value of the element @option values The default values of the element, where multiple values @@ -183,6 +192,49 @@ if { ! [info exists opts(label)] } { set opts(label) $opts(value) } } + # If the widget is a checkbox or radio widget, set attributes + if { [string equal $opts(widget) radio] || \ + [string equal $opts(widget) checkbox] } { + + # set fieldset attributes + if { ![info exists opts(fieldset)] } { + set opts(fieldset) {class $opts(widget)} + } + + array set attributes $opts(fieldset) + if { ![info exists attributes(class)] } { + set attributes(class) $opts(widget) + } + + set options "" + foreach name [array names attributes] { + if { [string equal $attributes($name) {}] } { + append options " $name" + } else { + append options " $name=\"$attributes($name)\"" + } + } + set opts(fieldset) $options + + # set legend attributes + if { ![info exists opts(legendtext)] } { + set opts(legendtext) "" + } + if { ![info exists opts(legend)] } { + set opts(legend) {} + } + array set attributes $opts(legend) + set options "" + foreach name [array names attributes] { + if { [string equal $attributes($name) {}] } { + append options " $name" + } else { + append options " $name=\"$attributes($name)\"" + } + } + set opts(legend) $options + } + # Remember that the element has not been rendered yet set opts(is_rendered) f