Index: openacs-4/packages/acs-tcl/tcl/install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/install-procs.tcl,v diff -u -r1.37 -r1.38 --- openacs-4/packages/acs-tcl/tcl/install-procs.tcl 12 Feb 2019 17:28:59 -0000 1.37 +++ openacs-4/packages/acs-tcl/tcl/install-procs.tcl 3 Sep 2024 15:37:34 -0000 1.38 @@ -21,7 +21,7 @@ } ad_proc -private ::install::xml::action::source { node } { - Source an install.xml file, sql file or Tcl script during execution of + Source an install.xml file, SQL file or Tcl script during execution of the current install.xml. If no type attribute is specified then this tag will attempt to guess @@ -113,7 +113,7 @@ set out [list] # Remove double slashes - regsub -all {//} $mount_point "/" mount_point + regsub -all -- {//} $mount_point "/" mount_point set mount_point [string trim $mount_point " /"] if {[string is space $mount_point] || $mount_point eq "/"} { @@ -173,7 +173,7 @@ -package_name $instance_name \ -package_key $package_key] - if {![template::util::is_true $security_inherit_p]} { + if {![string is true -strict $security_inherit_p]} { permission::set_not_inherit -object_id $package_id } @@ -197,7 +197,7 @@ set out [list] # Remove double slashes - regsub -all {//} $mount_point "/" mount_point + regsub -all -- {//} $mount_point "/" mount_point set mount_point [string trim $mount_point " /"] if {[string is space $mount_point] || $mount_point eq "/"} { @@ -300,7 +300,7 @@ -package_key $package_key \ -context_id $context_id] - if {![template::util::is_true $security_inherit_p]} { + if {![string is true -strict $security_inherit_p]} { permission::set_not_inherit -object_id $package_id } @@ -437,7 +437,7 @@ ad_proc -public install::xml::action::unset-permission { node } { Revokes a permissions on an object - has no effect if the permission is not granted directly - (ie does not act as negative permissions). + (i.e. does not act as negative permissions).
<unset-permissions grantee="party" privilege="package-key />
} { @@ -477,12 +477,8 @@ foreach object $objects { set group_id [apm_invoke_install_proc -type object_id -node $object] - - group::get -group_id $group_id -array group - set group(join_policy) $join_policy - group::update -group_id $group_id -array group + group::update -group_id $group_id [list join_policy $join_policy] } - return } ad_proc -public install::xml::action::create-user { node } { @@ -507,7 +503,7 @@ set site_wide_admin_p [apm_attribute_value -default "" $node site-wide-admin] set local_p [apm_attribute_value -default 0 $node local-p] - set local_p [template::util::is_true $local_p] + set local_p [string is true -strict $local_p] if {$salt ne ""} { set salt_password $password @@ -532,18 +528,23 @@ # Need to find out which username was set set username $result(username) - array set result [auth::local::registration::Register \ - {} \ - $username \ - [auth::authority::local] \ - $first_names \ - $last_name \ - $screen_name \ - $email \ - $url \ - $password \ - $secret_question \ - $secret_answer] + set call_args [list \ + {} \ + $username \ + [auth::authority::local] \ + $first_names \ + $last_name \ + $screen_name \ + $email \ + $url \ + $password \ + $secret_question \ + $secret_answer] + array set result [acs_sc::invoke \ + -contract "auth_registration" \ + -operation "Register" \ + -impl local \ + -call_args $call_args] } } else { array set result [auth::create_user -email $email \ @@ -561,7 +562,7 @@ } if {$result(creation_status) eq "ok"} { - if {[template::util::is_true $site_wide_admin_p]} { + if {[string is true -strict $site_wide_admin_p]} { permission::grant -object_id [acs_magic_object "security_context_root"] \ -party_id $result(user_id) -privilege "admin" } @@ -750,7 +751,7 @@ set view [install::xml::util::get_id $view] } - set directory_p [template::util::is_true $directory_p] + set directory_p [string is true -strict $directory_p] set location_id [location::create -parent_id $parent \ -name $name \ @@ -773,7 +774,7 @@ set type [apm_attribute_value -default literal $child type] set subtree_p [apm_attribute_value -default f $child subtree-p] - set subtree_p [template::util::is_true $subtree_p] + set subtree_p [string is true -strict $subtree_p] if {$type eq "id"} { set value [install::xml::util::get_id $value] @@ -790,7 +791,7 @@ set exports [apm_attribute_value -default "" $child exports] set subtree_p [apm_attribute_value -default f $child subtree-p] - set subtree_p [template::util::is_true $subtree_p] + set subtree_p [string is true -strict $subtree_p] location::parameter::create -location_id $location_id \ -name "forward::$name" \ @@ -900,7 +901,7 @@ set directory_p [apm_attribute_value -default f $step directory-p] xml_node_set_attribute $step directory-p \ - [template::util::is_true $directory_p] + [string is true -strict $directory_p] set step_id [::install::xml::action::location $step] @@ -1042,7 +1043,7 @@ } # Remove double slashes - regsub -all {//} $url "/" url + regsub -all -- {//} $url "/" url if { $package_key ne "" && $url ne "" } { error "set-parameter: Can't specify both package and url for $url and $package_key" @@ -1112,12 +1113,14 @@ } ad_proc -public install::xml::object_id::member-group { node } { + @return an object_id for a member group of a given package. } { set package_id [::install::xml::object_id::package $node] return [subsite::get_member_group -package_id $package_id] } ad_proc -public install::xml::object_id::admin-group { node } { + @return an object_id for an admin group of a given package. } { set package_id [::install::xml::object_id::package $node] return [subsite::get_admin_group -package_id $package_id] @@ -1147,6 +1150,28 @@ set ids($name) $value } +ad_proc -public install::xml::action::set-theme { node } { + + Sets a theme for a subsite. If no subsite is specified it defaults + to the main subsite "/". Valid themes are e.g. "openacs_bootstrap5", + "openacs_bootstrap3", "default_plain", or default "tabbed". + +<set-theme theme="theme" [ package="subsite ]
+} { + variable ::install::xml::ids + + set theme [apm_required_attribute_value $node theme] + set subsite [apm_attribute_value -default "/" $node subsite] + + # + # Get subsite_id from "subsite" path + # + set subsite_id [site_node::get_object_id \ + -node_id [site_node::get_node_id -url $subsite]] + subsite::set_theme -subsite_id $subsite_id -theme $theme + +} + ad_proc -public install::xml::util::get_id { id } { Returns an id from the global ids variable if it exists and attempts to find an acs_magic_object if not.