Index: openacs-4/packages/acs-templating/tcl/tab-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tab-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/tcl/tab-procs.tcl 9 May 2001 05:15:58 -0000 1.2 +++ openacs-4/packages/acs-templating/tcl/tab-procs.tcl 15 Oct 2003 12:35:51 -0000 1.3 @@ -7,6 +7,10 @@ # A tab is just a formwidget +namespace eval template {} +namespace eval template::widget {} +namespace eval template::tabstrip {} + ad_proc -public template::widget::tab { element_reference tag_attributes } { upvar $element_reference element @@ -206,5 +210,43 @@ } +# The tabstrip tag +template_tag tabstrip { chunk params } { + set level [template::adp_level] + + set id [template::get_attribute formtemplate $params id] + + upvar #$level $id:properties form_properties + + # Create a variable called "plus" that holds the + sign + # Since the actual + character is regexped out... how lame + set tabstrip_plus "+" + + template::adp_append_code "set form:id \"$id\"" + + # Set optional attributes for the style template + template::adp_append_code " + upvar 0 \"$id:properties\" form_properties" + + # Change the default style if no style is specified + if { [string equal [ns_set iget $params style] ""] } { + ns_set update $params style tabbed-dialog + } + + # Render the template + if { [string equal [string trim $chunk] {}] } { + # generate the form body dynamically if none specified. + set style [ns_set iget $params style] + if { [template::util::is_nil style] } { + set style "tabbed-dialog" + } + template::adp_append_string "\[template::form generate $id $style\]" + } else { + # compile the static form layout specified in the template + template::adp_compile_chunk $chunk + } + +} +