Index: openacs-4/packages/ams/tcl/ams-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-procs-postgresql.xql,v diff -u -r1.17 -r1.18 --- openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 22 Nov 2005 16:55:30 -0000 1.17 +++ openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 1 Dec 2005 11:01:07 -0000 1.18 @@ -129,7 +129,6 @@ alam.attribute_id, alam.required_p, alam.section_heading, - alam.html_options, aa.attribute_name, aa.pretty_name, aa.widget @@ -159,7 +158,6 @@ select alam.attribute_id, alam.section_heading, - alam.html_options, aa.attribute_name, aa.pretty_name, aa.widget, Index: openacs-4/packages/ams/tcl/ams-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-procs.tcl,v diff -u -r1.32 -r1.33 --- openacs-4/packages/ams/tcl/ams-procs.tcl 22 Nov 2005 16:55:30 -0000 1.32 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 1 Dec 2005 11:01:07 -0000 1.33 @@ -379,19 +379,16 @@ lappend control_list $attribute_id set required_p [lindex $attribute 1] set section_heading [lindex $attribute 2] - set html_options [lindex $attribute 3] - set attribute_name [lindex $attribute 4] - set pretty_name [lindex $attribute 5] - set widget [lindex $attribute 6] + set attribute_name [lindex $attribute 3] + set pretty_name [lindex $attribute 4] + set widget [lindex $attribute 5] set element [ams::widget \ -widget $widget \ -request "ad_form_widget" \ -attribute_name $attribute_name \ -pretty_name $pretty_name \ - -optional_p [string is false $required_p] \ - -html_options $html_options \ - -attribute_id $attribute_id] + -optional_p [string is false $required_p] -attribute_id $attribute_id] if { [exists_and_not_null section_heading] } { lappend element [list section $section_heading] @@ -477,7 +474,6 @@ if { [exists_and_not_null list_ids] } { set values [list] set heading "" - set html_opt "" # Control list to know which attributes are already in the # elements list so we don't en up with duplicates @@ -490,11 +486,10 @@ if { [string equal [lsearch $control_list $attribute_id] "-1"] } { lappend control_list $attribute_id set section_heading [lindex $attribute 1] - set html_options [lindex $attribute 2] - set attribute_name [lindex $attribute 3] - set pretty_name [lindex $attribute 4] - set widget [lindex $attribute 5] - set value [lindex $attribute 6] + set attribute_name [lindex $attribute 2] + set pretty_name [lindex $attribute 3] + set widget [lindex $attribute 4] + set value [lindex $attribute 5] set val [list] if { [regexp "\{text/.*\}" $value value_format] } { @@ -507,19 +502,14 @@ if { [exists_and_not_null section_heading] } { set heading $section_heading } - - if { [exists_and_not_null html_options] } { - set html_opt $html_options - } - if { [exists_and_not_null value] } { lappend values $heading $attribute_name $pretty_name [ams::widget \ -widget $widget \ -request "value_${format}" \ -attribute_name $attribute_name \ -attribute_id $attribute_id \ -value $value \ - -locale $locale] $html_opt + -locale $locale] ns_log Notice "$attribute_name ($attribute_id):: $value" } Index: openacs-4/packages/ams/tcl/ams-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-widget-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/ams/tcl/ams-widget-procs.tcl 22 Nov 2005 16:55:30 -0000 1.15 +++ openacs-4/packages/ams/tcl/ams-widget-procs.tcl 1 Dec 2005 11:01:07 -0000 1.16 @@ -23,7 +23,6 @@ {-value ""} {-optional_p "1"} {-locale ""} - {-html_options {}} } { This proc defers its responses to all other ams::widget::${widget} procs. @@ -79,7 +78,7 @@ } } ns_log Debug "MGEDDERT DEBUG: return ::ams::widget::${widget} -request $request -attribute_name $attribute_name -pretty_name $pretty_name -value $value -optional_p $optional_p -form_name $form_name -options $options" - return [::ams::widget::${widget} -request $request -attribute_name $attribute_name -pretty_name $pretty_name -value $value -optional_p $optional_p -form_name $form_name -options $options -html_options $html_options] + return [::ams::widget::${widget} -request $request -attribute_name $attribute_name -pretty_name $pretty_name -value $value -optional_p $optional_p -form_name $form_name -options $options] } else { # the widget requested did not exist ns_log Debug "AMS: the ams widget \"${widget}\" was requested and the associated ::ams::widget::${widget} procedure does not exist" @@ -177,44 +176,32 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { - - if { [llength $html_options] == 0 } { - set html_options [list] - } - switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element "${attribute_name}:address(address),optional" + return "${attribute_name}:address(address),optional {[list label ${pretty_name}]}" } else { - lappend element "${attribute_name}:address(address)" + return "${attribute_name}:address(address) {[list label ${pretty_name}]}" } - lappend element [list label ${pretty_name}] - lappend element [list html $html_options] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype address \ -widget address \ - -optional \ - -html $html_options + -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype address \ - -widget address \ - -html $html_options + -widget address } } form_set_value { @@ -269,41 +256,32 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { - if { [llength $html_options] == 0 } { - set html_options [list] - } + switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:telecom_number(telecom_number),optional + return "${attribute_name}:telecom_number(telecom_number),optional {[list label ${pretty_name}]}" } else { - lappend element ${attribute_name}:telecom_number(telecom_number) + return "${attribute_name}:telecom_number(telecom_number) {[list label ${pretty_name}]}" } - lappend element [list label ${pretty_name}] - lappend element [list html $html_options] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype telecom_number \ -widget telecom_number \ - -optional \ - -html $html_options + -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype telecom_number \ - -widget telecom_number \ - -html $html_options + -widget telecom_number } } form_set_value { @@ -360,27 +338,19 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { - if { [llength $html_options] == 0 } { - set html_options [list] - } switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:date(date),optional + return "${attribute_name}:date(date),optional {[list label ${pretty_name}]}" } else { - lappend element ${attribute_name}:date(date) + return "${attribute_name}:date(date) {[list label ${pretty_name}]}" } - lappend element [list label ${pretty_name}] - lappend element [list html $html_options] - return $element } template_form_widget { if { [string is true $optional_p] } { @@ -389,15 +359,13 @@ -datatype date \ -widget date \ -help \ - -optional \ - -html $html_options + -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype date \ -widget date \ - -help \ - -html $html_options + -help } } form_set_value { @@ -445,46 +413,34 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { - - if { [llength $html_options] == 0 } { - set html_options [list] - } switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { set options [concat [list [list "" ""]] $options] - lappend element ${attribute_name}:integer(select),optional + return "${attribute_name}:integer(select),optional {[list label ${pretty_name}]} {[list options $options]}" } else { set options [concat [list [list "- [_ ams.select_one] -" ""]] $options] - lappend element ${attribute_name}:integer(select) + return "${attribute_name}:integer(select) {[list label ${pretty_name}]} {[list options $options]}" } - lappend element [list label ${pretty_name}] - lappend element [list options $options] - lappend element [list html $html_options] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype integer \ -widget select \ - -optional \ - -html $html_options + -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype integer \ - -widget select \ - -html $html_options + -widget select } } form_set_value { @@ -530,43 +486,32 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { - if { [llength $html_options] == 0 } { - set html_options [list] - } - + switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:integer(radio),optional + return "${attribute_name}:integer(radio),optional {[list label ${pretty_name}]} {[list options $options]}" } else { - lappend element ${attribute_name}:integer(radio) + return "${attribute_name}:integer(radio) {[list label ${pretty_name}]} {[list options $options]}" } - lappend element [list label ${pretty_name}] - lappend element [list options $options] - lappend element [list html $html_options] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype integer \ -widget radio \ - -optional \ - -html $html_options + -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype integer \ - -widget radio \ - -html $html_options + -widget radio } } form_set_value { @@ -612,28 +557,19 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { - if { [llength $html_options] == 0 } { - set html_options [list] - } switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:integer(checkbox),multiple,optional + return "${attribute_name}:integer(checkbox),multiple,optional {[list label ${pretty_name}]} {[list options $options]}" } else { - lappend element ${attribute_name}:integer(checkbox),multiple + return "${attribute_name}:integer(checkbox),multiple {[list label ${pretty_name}]} {[list options $options]}" } - lappend element [list label ${pretty_name}] - lappend element [list options $options] - lappend element [list html $html_options] - return $element } template_form_widget { if { [string is true $optional_p] } { @@ -642,15 +578,13 @@ -datatype integer \ -widget checkbox \ -multiple \ - -optional \ - -html $html_options + -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype integer \ -widget checkbox \ - -multiple \ - -html $html_options + -multiple } } form_set_value { @@ -696,28 +630,19 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { - if { [llength $html_options] == 0} { - set html_options [list] - } - + switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element {attribute_name}:integer(multiselect),multiple,optional + return "${attribute_name}:integer(multiselect),multiple,optional {[list label ${pretty_name}]} {[list options $options]}" } else { - lappend element ${attribute_name}:integer(multiselect),multiple + return "${attribute_name}:integer(multiselect),multiple {[list label ${pretty_name}]} {[list options $options]}" } - lappend element [list label ${pretty_name}] - lappend element [list options $options] - lappend element [list html $html_options] - return $element } template_form_widget { if { [string is true $optional_p] } { @@ -726,15 +651,13 @@ -datatype integer \ -widget multiselect \ -multiple \ - -optional \ - -html $html_options + -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype integer \ -widget multiselect \ - -multiple \ - -html $html_options + -multiple } } form_set_value { @@ -782,42 +705,34 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { - if { [llength $html_options] == 0 } { - set html_options [list size 6] - } - + switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:integer(text),optional + return "${attribute_name}:integer(text),optional {html {size 6}} {[list label ${pretty_name}]}" } else { - lappend element ${aettribute_name}:integer(text) + return "${attribute_name}:integer(text) {html {size 6}} {[list label ${pretty_name}]}" } - lappend element [list html $html_options] - lappend element [list label ${pretty_name}] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype integer \ -widget text \ - -html $html_options \ + -html {size 6} \ -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype integer \ -widget text \ - -html $html_options + -html {size 6} } } form_set_value { @@ -863,7 +778,6 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @@ -876,35 +790,28 @@ regsub -all {[\]\[\{\}\"\\$]} $value {\\&} value set value_format [lindex $value 0] set value [lrange $value 1 end] - if { [llength $html_options] == 0 } { - set html_options [list size 30] - } switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element "${attribute_name}:text(text),optional" + return "${attribute_name}:text(text),optional {html {size 30}} {[list label ${pretty_name}]}" } else { - lappend element "${attribute_name}:text(text)" + return "${attribute_name}:text(text) {html {size 30}} {[list label ${pretty_name}]}" } - lappend element [list html $html_options] - lappend element [list label ${pretty_name}] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype text \ -widget text \ - -html $html_options \ + -html {size 30} \ -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype text \ -widget text \ - -html $html_options + -html {size 30} } } form_set_value { @@ -954,7 +861,6 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @@ -967,37 +873,28 @@ regsub -all {[\]\[\{\}\"\\$]} $value {\\&} value set value_format [lindex $value 0] set value [lrange $value 1 end] - - if { [llength $html_options] == 0 } { - set html_options [list cols 60 rows 6] - } - switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:text(textarea),optional + return "${attribute_name}:text(textarea),optional {html {cols 60 rows 6}} {[list label ${pretty_name}]}" } else { - lappend element ${attribute_name}:text(textarea) + return "${attribute_name}:text(textarea) {html {cols 60 rows 10}} {[list label ${pretty_name}]}" } - lappend element [list html $html_options] - lappend element [list label ${pretty_name}] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype text \ -widget textarea \ - -html $html_options \ + -html {cols 60 rows 10} \ -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype text \ -widget textarea \ - -html $html_options + -html {cols 60 rows 10} } } form_set_value { @@ -1048,45 +945,35 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { set value_format [lindex $value 0] set value [lrange $value 1 end] - - if { [llength $html_options] == 0 } { - set html_options [list cols 60 rows 14] - } - switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:richtext(richtext),optional + return "${attribute_name}:richtext(richtext),optional {html {cols 60 rows 14}} {[list label ${pretty_name}]}" } else { - lappend element ${attribute_name}:richtext(richtext) + return "${attribute_name}:richtext(richtext) {html {cols 60 rows 14}} {[list label ${pretty_name}]}" } - lappend element [list html $html_options] - lappend element [list label ${pretty_name}] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype richtext \ -widget richtext \ - -html $html_options \ + -html {cols 60 rows 14} \ -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype richtext \ -widget richtext \ - -html $html_options + -html {cols 60 rows 14} } } form_set_value { @@ -1135,45 +1022,35 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { set value_format [lindex $value 0] set value [lrange $value 1 end] - - if { [llength $html_options] == 0 } { - set html_options [list size 30] - } - switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:email(text),optional + return "${attribute_name}:email(text),optional {html {size 30}} {[list label ${pretty_name}]}" } else { - lappend element ${attribute_name}:email(text) + return "${attribute_name}:email(text) {html {size 30}} {[list label ${pretty_name}]}" } - lappend element [list html $html_options] - lappend element [list label ${pretty_name}] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype email \ -widget text \ - -html $html_options \ + -html {size 30} \ -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype email \ -widget text \ - -html $html_options + -html {size 30} } } form_set_value { @@ -1219,45 +1096,35 @@ -value:required -optional_p:required -options:required - -html_options:required } { This proc responds to the ams::widget procs. @see ams::widget } { set value_format [lindex $value 0] set value [lrange $value 1 end] - - if { [llength $html_options] == 0 } { - set html_options [list size 30] - } - switch $request { ad_form_widget { - set element [list] if { [string is true $optional_p] } { - lappend element ${attribute_name}:url(text),optional + return "${attribute_name}:url(text),optional {html {size 30}} {[list label ${pretty_name}]}" } else { - lappend element ${attribute_name}:url(text) + return "${attribute_name}:url(text) {html {size 30}} {[list label ${pretty_name}]}" } - lappend element [list html $html_options] - lappend element [list label ${pretty_name}] - return $element } template_form_widget { if { [string is true $optional_p] } { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype url \ -widget text \ - -html $html_options \ + -html {size 30} \ -optional } else { ::template::element::create ${form_name} ${attribute_name} \ -label ${pretty_name} \ -datatype url \ -widget text \ - -html $html_options + -html {size 30} } } form_set_value {