Index: openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl 16 Feb 2002 23:32:06 -0000 1.12 +++ openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl 26 May 2002 04:36:50 -0000 1.13 @@ -8,15 +8,36 @@ @author ported by Jerry Asher (jerry@theashergroup.com) } -ad_proc ec_search_widget { {combocategory_id ""} {search_text ""} } { creates an ecommerce search widget, using the specified category id and search text if necessary } { - return "
-Search: [ec_combocategory_widget "f" $combocategory_id] - -
-" +ad_proc ec_search_widget { + {combocategory_id ""} + {search_text ""} +} { + Creates an ecommerce search widget, using the specified category id and search text if necessary +} { + return " +
+ + + + + + +
+ Search: + [ec_combocategory_widget "f" $combocategory_id] + for + + +
+
" } -ad_proc ec_combocategory_widget { {multiple_p "f"} {default ""} } { Category widget combining categories and subcategories } { +ad_proc ec_combocategory_widget { + {multiple_p "f"} + {default ""} +} { + Category widget combining categories and subcategories +} { if { $multiple_p == "f" } { set select_tag "\n" } else { @@ -159,53 +192,81 @@ return $to_return } -ad_proc ec_column_type_widget { {default ""} } { column type widget } { +ad_proc ec_column_type_widget { + {default ""} +} { + Column type widget +} { - ### number and date types for oracle and postgresql - if [string match [db_type] "oracle"] { - set date "date" - set number "number" - set boolean "char(1)" - } elseif [string match [db_type] "postgresql"] { - set date "timestamp" - set number "numeric" - set boolean "boolean" + set database_type [db_type] + + # Set database specific types + + switch -exact $database_type { + "oracle" { + set date "date" + set number "number" + set boolean "char(1)" + } + + "postgresql" - + default { + set date "timestamp" + set number "numeric" + set boolean "boolean" + } } - # boolean will be the default unless specified otherwise - # if it's boolean, the check constraint will be added at the end so that it can be named - set to_return "\n" - - return $to_return + + return " + " } ad_proc ec_multiple_state_widget { {default_list ""} {select_name "usps_abbrev"} } "Returns a state multiple selection box" { @@ -509,24 +570,30 @@ } ad_proc ec_continue_shopping_options { } { returns continue shopping options } { - return "
-Continue Shopping for [ec_only_category_widget] - -
-" + return " +
+ Continue Shopping for [ec_only_category_widget] + +
" } -ad_proc ec_country_widget { {default ""} {select_name "country_code"} {size_subtag "size=4"}} "Just like country_widget, except it's not United States centric." { +ad_proc ec_country_widget { + {default ""} + {select_name "country_code"} + {size_subtag "size=4"} +} { + Just like country_widget, except it's not United States centric. +} { set widget_value "\n" - set footer "\n" - set defaulted_flag 0 - foreach size [list "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12"] { - if { $size == $default } { - append options " + " + set default_matched_p 1 } else { - append options " + " } } - if $defaulted_flag { - return "$header$options$footer" + if $default_matched_p { + return " + $header + $options + $footer" } else { - return "${header}" + set default_matched_p 1 } else { - append options "