Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -N -r1.203 -r1.204 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 16 May 2018 15:23:55 -0000 1.203 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 17 May 2018 15:23:05 -0000 1.204 @@ -52,13 +52,9 @@ } { Lists the datasources available to a portal or in general } { - if {$portal_id eq ""} { - # List all applets - return [db_list select_all_datasources {}] - } else { - # List from the DB - return [db_list select_datasources {}] - } + return [expr {$portal_id eq "" ? \ + [db_list select_all_datasources {}] : \ + [db_list select_datasources {}]}] } ad_proc -public portal::datasource_dispatch { @@ -69,7 +65,7 @@ Dispatch an operation to every datasource } { foreach datasource [list_datasources $portal_id] { - # Callback on datasource + # Callback on datasource datasource_call $datasource $op $list_args } } @@ -80,48 +76,49 @@ # The management is not responsible for the results of multi-mounting -ad_proc -private portal::package_key {} { +set ::portal::package_key "new-portal" +ad_proc -deprecated -private portal::package_key {} { Returns the package_key + DEPRECATED: use threaded cache directly } { - return "new-portal" + return $::portal::package_key } -ad_proc -public portal::get_package_id {} { +set ::portal::get_package_id [apm_package_id_from_key $::portal::package_key] +ad_proc -deprecated -public portal::get_package_id {} { returns the package ID + DEPRECATED: use threaded cache directly } { - return [apm_package_id_from_key [package_key]] + return $::portal::get_package_id } # Work around for template::util::url_to_file -ad_proc -private portal::www_path {} { +set ::portal::www_path /packages/${::portal::package_key}/www +ad_proc -deprecated -private portal::www_path {} { Returns the path of the www dir of the portal package. We need this for stupid template tricks. + DEPRECATED: use threaded cache directly } { - return "/packages/[package_key]/www" + return $::portal::www_path } -ad_proc -private portal::mount_point_no_cache {} { - Returns the mount point of the portal package. - Sometimes we need to know this for like ing - templates from Tcl +set ::portal::mount_point [site_node::get_url_from_object_id \ + -object_id $::portal::get_package_id] +ad_proc -deprecated -public portal::mount_point {} { + caches the mount point + DEPRECATED: use threaded cache directly } { - return [site_node::get_url_from_object_id -object_id [get_package_id]] + return $::portal::mount_point } -ad_proc -public portal::mount_point {} { - caches the mount point +set ::portal::automount_point "portal" +ad_proc -deprecated -public portal::automount_point {} { + packages such as dotlrn can automount the portal here + DEPRECATED: use threaded cache directly } { - set key ::portal::mount_point - if {[info exists $key]} { - return [set $key] - } - return [set $key [portal::mount_point_no_cache]] + return $::portal::automount_point } -ad_proc -public portal::automount_point {} { - packages such as dotlrn can automount the portal here -} { return "portal" } - # # Main portal procs # @@ -184,7 +181,7 @@ # get the default theme name from param, if no theme given if {$theme_name eq ""} { - set theme_name [parameter::get -package_id [get_package_id] -parameter default_theme_name] + set theme_name [parameter::get -package_id $::portal::get_package_id -parameter default_theme_name] } set theme_id [get_theme_id_from_name -theme_name $theme_name] @@ -290,7 +287,7 @@ set template " @portal.name@" if { $element_list ne "" } { - set element_src "[www_path]/render_styles/${render_style}/render-element" + set element_src "${::portal::www_path}/render_styles/${render_style}/render-element" append template [subst { }] - set __adp_stub "[acs_root_dir][www_path]/." + set __adp_stub "[acs_root_dir]${::portal::www_path}/." set {master_template} \"master\" set code [template::adp_compile -string $template]