Index: openacs-4/packages/acs-subsite/www/shared/parameters.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/parameters.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/acs-subsite/www/shared/parameters.tcl 3 Apr 2010 23:13:47 -0000 1.19 +++ openacs-4/packages/acs-subsite/www/shared/parameters.tcl 4 Apr 2010 14:51:47 -0000 1.20 @@ -5,7 +5,7 @@ @creation-date 2003-06-13 @cvs-id $Id$ } { - package_id:optional,naturalnum + {package_id:naturalnum "[ad_conn package_id]"} package_key:optional {scope "instance"} {return_url:optional "[ad_conn url]?[ad_conn query]"} @@ -21,9 +21,6 @@ set page_title "$instance_name Global Parameters" set context [list [list $package_url "Site-Wide Administration"] $page_title] } else { - if { ![info exists package_id] } { - set package_id [ad_conn package_id] - } permission::require_permission -object_id $package_id -privilege admin db_1row select_instance_name {} @@ -59,7 +56,7 @@ array set sections {} -db_foreach select_${scope}_params {} { +db_foreach select_params {} { if { $section_name eq "" } { set section_name "main" set section_pretty "Main" @@ -117,23 +114,19 @@ set $name $param($name) } } -on_submit { - if { $scope eq "instance" } { - db_foreach select_instance_params_set {} { - if { [info exists $c__parameter_name] } { + db_foreach select_params_set {} { + if { [info exists $c__parameter_name] } { + if { $scope eq "instance" } { parameter::set_value \ -package_id $package_id \ -parameter $c__parameter_name \ -value [set $c__parameter_name] callback subsite::parameter_changed -package_id $package_id -parameter $c__parameter_name -value [set $c__parameter_name] - } - } - } else { - db_foreach select_global_params_set {} { - if { [info exists $c__parameter_name] } { + } else { parameter::set_global_value \ - -package_key $package_key \ - -parameter $c__parameter_name \ - -value [set $c__parameter_name] + -package_key $package_key \ + -parameter $c__parameter_name \ + -value [set $c__parameter_name] callback subsite::global_parameter_changed -package_key $package_key -parameter $c__parameter_name -value [set $c__parameter_name] } } Index: openacs-4/packages/acs-subsite/www/shared/parameters.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/parameters.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/shared/parameters.xql 3 Apr 2010 23:13:47 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/shared/parameters.xql 4 Apr 2010 14:51:47 -0000 1.4 @@ -24,7 +24,7 @@ - + select p.parameter_name, coalesce(p.description, 'No Description') as description, @@ -34,61 +34,28 @@ from apm_parameters p left outer join (select v.parameter_id, v.attr_value from apm_parameter_values v - where v.package_id = :package_id) v + where (v.package_id = :package_id or v.package_id is null)) v on p.parameter_id = v.parameter_id where p.package_key = :package_key - and p.scope = 'instance' + and p.scope = :scope $section_where_clause order by section_name, parameter_name - + - select p.parameter_name, - coalesce(p.description, 'No Description') as description, - v.attr_value, - coalesce(p.section_name, '') as section_name, - p.datatype - from apm_parameters p left outer join - (select v.parameter_id, v.attr_value - from apm_parameter_values v - where v.package_id is null) v - on p.parameter_id = v.parameter_id - where p.package_key = :package_key - and p.scope = 'global' - $section_where_clause - order by section_name, parameter_name - - - - - select p.parameter_name as c__parameter_name from apm_parameters p left outer join (select v.parameter_id, v.attr_value from apm_parameter_values v - where v.package_id = :package_id) v + where (v.package_id = :package_id or v.package_id is null)) v on p.parameter_id = v.parameter_id where p.package_key = :package_key - and p.scope = 'instance' + and p.scope = :scope $section_where_clause - - - select p.parameter_name as c__parameter_name - from apm_parameters p left outer join - (select v.parameter_id, v.attr_value - from apm_parameter_values v - where v.package_id is null) v - on p.parameter_id = v.parameter_id - where p.package_key = :package_key - and p.scope = 'global' - $section_where_clause - - -