Index: openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 23 Jun 2015 08:23:55 -0000 1.23 +++ openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 7 Aug 2017 23:48:01 -0000 1.24 @@ -1,16 +1,20 @@ -# Interface to the ACS for the ArsDigita Templating System -# Procedures in this file only make sense if you use the template system -# together with the ArsDigita Community System +ad_library { + Interface to the ACS for the ArsDigita Templating System + Procedures in this file only make sense if you use the template system + together with the ArsDigita Community System + + @author Christian Brechbuehler + + @cvs-id $Id$ +} # Copyright (C) 1999-2000 ArsDigita Corporation -# Authors: Christian Brechbuehler file '[file rootname [ad_conn file]]'" template::reset_request_vars - set parsed_template [template::adp_parse [file rootname [ad_conn file]] {}] + # + # [ad_conn file] is always an absolute name, remove the + # acs::rootdir, compute the template and add the acs::rootdir + # again. + # + set absolute_file [ad_conn file] + set relative_name [string range $absolute_file [string length $::acs::rootdir] end] + set themed_template $::acs::rootdir/[template::themed_template [file rootname $relative_name]] + set parsed_template [template::adp_parse $themed_template {}] if {$parsed_template ne ""} { @@ -107,15 +124,15 @@ set apm_package_url [apm_package_url_from_key "acs-lang"] # Attempt to move all message keys outside of tags - while { [regsub -all {(<[^>]*)(\x002\(\x001[^\x001]*\x001\)\x002)([^>]*>)} $parsed_template {\2\1\3} parsed_template] } {} + while { [regsub -all {(<[^>]*)(\x02\(\x01[^\x01]*\x01\)\x02)([^>]*>)} $parsed_template {\2\1\3} parsed_template] } {} # Attempt to move all message keys outside of statements - regsub -all -nocase {(]*>[^<]*)(\x002\(\x001[^\x001]*\x001\)\x002)([^<]*]*>)} $parsed_template {\2\1\3} parsed_template + regsub -all -nocase {(]*>[^<]*)(\x02\(\x01[^\x01]*\x01\)\x02)([^<]*]*>)} $parsed_template {\2\1\3} parsed_template - while { [regsub -all -nocase {(]*>[^<]*)(\x002\(\x001[^\x001]*\x001\)\x002)} $parsed_template {\2\1} parsed_template] } {} + while { [regsub -all -nocase {(]*>[^<]*)(\x02\(\x01[^\x01]*\x01\)\x02)} $parsed_template {\2\1} parsed_template] } {} set start 0 - while { [regexp -nocase -indices -start $start {(... - while { [regexp -indices {\x002\(\x001([^\x001]*)\x001\)\x002} $parsed_template indices key] } { + while { [regexp -indices {\x02\(\x01([^\x01]*)\x01\)\x02} $parsed_template indices key] } { set before [string range $parsed_template 0 [lindex $indices 0]-1] set after [string range $parsed_template [lindex $indices 1]+1 end]