country_widget (public, deprecated)

 country_widget [ default ] [ select_name ] [ size_subtag ]

Defined in packages/acs-tcl/tcl/widgets-procs.tcl

Deprecated. Invoking this procedure generates a warning.

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.

Parameters:
default (optional)
select_name (optional, defaults to "country_code")
size_subtag (optional, defaults to "size='4'")
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_conn ad_conn (public) ad_log_deprecated ad_log_deprecated (public) db_foreach db_foreach (public) parameter::get parameter::get (public) country_widget country_widget country_widget->ad_conn country_widget->ad_log_deprecated country_widget->db_foreach country_widget->parameter::get

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc country_widget
    set widget_value "<select name=\"$select_name\" $size_subtag>\n"
    if { $default eq "" } {
        if { [parameter::get -parameter SomeAmericanReadersP -package_id [ad_conn subsite_id] -default 0] } {
            append widget_value "<option value=\"\">Choose a Country</option>
            <option value=\"us\" selected=\"selected\">United States</option>\n"
        } else {
            append widget_value "<option value=\"\" selected=\"selected\">Choose a Country</option>\n"
        }
    }
    db_foreach all_countries {
        select default_name, iso from countries order by default_name
    } {
        if { $default == $iso } {
            append widget_value "<option value=\"$iso\" selected=\"selected\">$default_name</option>\n"
        } else {
            append widget_value "<option value=\"$iso\">$default_name</option>\n"
        }
    }
    append widget_value "</select>\n"
    return $widget_value
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/widgets-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: