Index: openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl 18 Sep 2018 18:28:55 -0000 1.23 +++ openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl 3 Sep 2024 15:37:34 -0000 1.24 @@ -4,38 +4,60 @@ @cvs-id $Id$ } -ad_proc us_state_widget { - {default ""} - {select_name "usps_abbrev"} +ad_proc -deprecated us_state_widget { + {default ""} + {select_name "usps_abbrev"} } { - Returns a state selection box. - This widget depends on the ref-us-states package. + Returns a state selection box. + This widget depends on the ref-us-states package. + + DEPRECATED for various reasons: doesn't comply with OpenACS naming + convention, difficult to style, no good separation of Tcl and + HTML, 'select_name' is prone to code injection and the proc + depends on an external package. A better alternative would be + e.g. implementing this using the templating system. + + @see template::widget::select + @see template::widget::multiselect + @see template::multirow + } { - set widget_value "\n" + if { $default eq "" } { + append widget_value "\n" + } - db_foreach all_states { - select state_name, abbrev from states order by state_name - } { - if { $default == $abbrev } { - append widget_value "\n" - } else { - append widget_value "\n" - } - } - append widget_value "\n" - return $widget_value + db_foreach all_states { + select state_name, abbrev from us_states order by state_name + } { + if { $default == $abbrev } { + append widget_value "\n" + } else { + append widget_value "\n" + } + } + append widget_value "\n" + return $widget_value } -ad_proc country_widget { +ad_proc -deprecated country_widget { {default ""} {select_name "country_code"} {size_subtag "size='4'"} } { Returns a country selection box. This widget depends on the ref-countries package. + + DEPRECATED for various reasons: doesn't comply with OpenACS naming + convention, difficult to style, no good separation of Tcl and + HTML, 'size_subtag' is just implemented code injection and + furthermore, default value might depend on a parameter designed + just for "american readers". A better alternative would be + e.g. implementing this using the templating system. + + @see template::widget::select + @see template::widget::multiselect + @see template::multirow } { set widget_value "