Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v diff -u -N -r1.147 -r1.148 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 1 Nov 2018 14:16:18 -0000 1.147 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 19 Nov 2018 18:19:12 -0000 1.148 @@ -468,14 +468,17 @@ ad_proc -private rp_resources_filter { why } { - This filter runs on all URLs of the form /resources/*. The acs-resources package - mounts itself at /resources but we short circuit references here in order to - maximize throughput for resource files. We just ns_returnfile the file, no - permissions are checked, the ad_conn structure is not initialized, etc. + This filter runs on all URLs of the form /resources/*. We just + ns_returnfile the file, no permissions are checked, the ad_conn + structure is not initialized, etc in order to maximize throughput + for resource files. There are three mapping possibilities: - /resources/package-key/* maps to root/packages/package-key/www/resources/* + /resources/package-key/* maps to + root/packages/package-key/www/resources/*. This mapping is theme + aware and will be therefore overridden by + root/packages//resources/templates/packages/package-key/www/resources. If that fails, we map to root/packages/acs-subsite/www/resources/* If that fails, we map to root/www/resources/* @@ -492,7 +495,18 @@ } ad_conn -set untrusted_user_id 0 - set path "[acs_package_root_dir [lindex [ns_conn urlv] 1]]/www/resources/[join [lrange [ns_conn urlv] 2 end] /]" + + set urlv [ns_conn urlv] + set package_key [lindex $urlv 1] + set resource [join [lrange $urlv 2 end] /] + + set path "packages/$package_key/www/resources/$resource" + set themed_path [template::resource_path -type templates -style $path] + if { [file isfile $themed_path] } { + return [rp_serve_resource_file $themed_path] + } + + set path "[acs_package_root_dir $package_key]/www/resources/$resource" if { [file isfile $path] } { return [rp_serve_resource_file $path] } Index: openacs-4/packages/acs-templating/tcl/util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/util-procs.tcl,v diff -u -N -r1.41 -r1.42 --- openacs-4/packages/acs-templating/tcl/util-procs.tcl 3 Nov 2018 19:52:29 -0000 1.41 +++ openacs-4/packages/acs-templating/tcl/util-procs.tcl 19 Nov 2018 18:19:12 -0000 1.42 @@ -705,7 +705,8 @@ if {$theme_dir ne ""} { set path $theme_dir/$type/$style - if {![file exists $::acs::rootdir/$path.adp]} { + set lookup_path [expr {[file extension $path] eq "" ? "${path}.adp" : $path}] + if {![file exists $::acs::rootdir/$lookup_path]} { unset path } } Index: openacs-4/packages/xowiki/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/chat-procs.tcl,v diff -u -N -r1.40 -r1.41 --- openacs-4/packages/xowiki/tcl/chat-procs.tcl 19 Nov 2018 16:35:12 -0000 1.40 +++ openacs-4/packages/xowiki/tcl/chat-procs.tcl 19 Nov 2018 18:19:12 -0000 1.41 @@ -387,10 +387,11 @@ set context id=$chat_id&s=$session_id set base_url ${path}ajax/chat?${context} - # This will point to chat/resources/chat.css for a chat instance - # and to /resources.chat.css for a plain xowiki - # chat - template::head::add_css -href ${path}resources/chat.css + # Get the css from resources folder in the right package depending + # on chat implementation (chat or xowiki package). Request + # processor will serve the proper themed css when available. + set package_key [apm_package_key_from_id $package_id] + template::head::add_css -href /resources/${package_key}/chat.css if {$mode eq ""} { #