Index: openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl,v diff -u -r1.20.2.1 -r1.20.2.2 --- openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl 17 Aug 2015 15:20:40 -0000 1.20.2.1 +++ openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl 4 Sep 2015 09:32:29 -0000 1.20.2.2 @@ -251,6 +251,9 @@ set exclude_package_list {} + set channel_index_template [template::themed_template /packages/acs-admin/www/apm/repository-channel-index] + set index_template [template::themed_template /packages/acs-admin/www/apm/repository-index] + #---------------------------------------------------------------------- # Prepare output #---------------------------------------------------------------------- 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 -r1.28.2.2 -r1.28.2.3 --- openacs-4/packages/acs-templating/tcl/util-procs.tcl 2 Sep 2015 09:43:58 -0000 1.28.2.2 +++ openacs-4/packages/acs-templating/tcl/util-procs.tcl 4 Sep 2015 09:32:29 -0000 1.28.2.3 @@ -784,6 +784,31 @@ return \"[file dirname [file dirname [info script]]]/resources\" " +ad_proc -public template::themed_template { + path +} { + + Given a path like /packages/acs-admin/www/index pointing to an + .adp file, this function tries to locate this path in the + ResourceDir of the subsite (determined by the theme). If found the + themed template is returned, otherwse the passed template path. + + @param path absolute path within the open acs tree (without extension) + @return path to themed template or input value (without extension) + +} { + if {[string index $path 0] eq "/"} { + set style [string range $path 1 end] + } else { + set style $path + } + set stub [template::resource_path -type templates -style $style -relative] + if {[file readable $::acs::rootdir/$stub.adp]} { + return $stub + } + return $path +} + ad_proc -public template::resource_path { -type:required -style:required