parameter::get_global_value (public)

 parameter::get_global_value [ -localize ] [ -boolean ] \
    -package_key package_key -parameter parameter [ -default default ]

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

Get the value of a global package parameter.

Switches:
-localize (optional, boolean)
should we attempt to localize the parameter
-boolean (optional, boolean)
ensure boolean parameters are normalized to 0 or 1
-package_key (required)
identifies the package to which the global param belongs
-parameter (required)
which parameter's value to get
-default (optional)
what to return if we don't find a value. Defaults to returning the empty string.
Returns:
The string trimmed (leading and trailing spaces removed) parameter value
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_parameter__check_procs parameter__check_procs (test acs-tcl) parameter::get_global_value parameter::get_global_value test_parameter__check_procs->parameter::get_global_value test_parameter_register_test parameter_register_test (test acs-tcl) test_parameter_register_test->parameter::get_global_value ad_parameter_cache ad_parameter_cache (public) parameter::get_global_value->ad_parameter_cache ad_parameter_from_configuration_file ad_parameter_from_configuration_file (public) parameter::get_global_value->ad_parameter_from_configuration_file lang::util::localize lang::util::localize (public) parameter::get_global_value->lang::util::localize Object ::template::CSS Object ::template::CSS (public) Object ::template::CSS->parameter::get_global_value boomerang::resource_info boomerang::resource_info (public) boomerang::resource_info->parameter::get_global_value bootstrap_icons::resource_info bootstrap_icons::resource_info (public) bootstrap_icons::resource_info->parameter::get_global_value cookieconsent::resource_info cookieconsent::resource_info (public) cookieconsent::resource_info->parameter::get_global_value fa_icons::resource_info fa_icons::resource_info (public) fa_icons::resource_info->parameter::get_global_value

Testcases:
parameter_register_test, parameter__check_procs
Source code:

    # Is there a parameter by this name in the parameter file?  If so, it takes precedence.
    # Note that this makes *far* more sense for global parameters than for package instance
    # parameters.

    # 1. use the parameter file
    set value [ad_parameter_from_configuration_file $parameter $package_key]

    # 2. check the parameter cache
    if {$value eq ""} {
        set value [ad_parameter_cache -global $package_key $parameter]
    }
    # 3. use the default value
    if {$value eq ""} {
        set value $default
    }

    if { $localize_p } {
        # Replace message keys in hash marks with localized texts
        set value [lang::util::localize $value]
    }

    # Trimming the value as people may have accidentally put in trailing spaces
    set value [string trim $value]

    # Special parsing for boolean parameters, true and false can be written
    # in many different ways
    if { $boolean_p } {
        set value [string is true -strict $value]
    }

    return $value
Generic XQL file:
packages/acs-tcl/tcl/parameter-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/parameter-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/parameter-procs-oracle.xql

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