Index: openacs-4/packages/acs-admin/www/apm/package-load-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/package-load-2.tcl,v
diff -u -N -r1.5.2.1 -r1.5.2.2
--- openacs-4/packages/acs-admin/www/apm/package-load-2.tcl 10 Sep 2015 08:21:02 -0000 1.5.2.1
+++ openacs-4/packages/acs-admin/www/apm/package-load-2.tcl 12 Sep 2015 16:47:24 -0000 1.5.2.2
@@ -29,9 +29,11 @@
set title "Contents of Loaded Package"
set context [list [list "." "Package Manager"] [list "package-load" "Load a New Package"] $title]
-set template [parameter::get -package_id [ad_conn subsite_id] -parameter StreamingHead]
-ad_return_top_of_page [ad_parse_template -params [list context title] $template]
+ad_return_top_of_page [ad_parse_template \
+ -params [list context title] \
+ [template::streaming_template]]
+
if {$file_path eq ""} {
#
# delete potential leading "http://"
Index: openacs-4/packages/acs-admin/www/apm/packages-install-4.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/packages-install-4.tcl,v
diff -u -N -r1.19.2.2 -r1.19.2.3
--- openacs-4/packages/acs-admin/www/apm/packages-install-4.tcl 10 Sep 2015 08:21:02 -0000 1.19.2.2
+++ openacs-4/packages/acs-admin/www/apm/packages-install-4.tcl 12 Sep 2015 16:47:24 -0000 1.19.2.3
@@ -17,11 +17,10 @@
set title "Package Installation"
set context [list [list "/acs-admin/apm/" "Package Manager"] $title]
-set template [parameter::get -package_id [ad_conn subsite_id] \
- -parameter StreamingHead \
- -default /packages/openacs-default-theme/lib/plain-streaming-head]
-ad_return_top_of_page [ad_parse_template -params [list context title] $template]
+ad_return_top_of_page [ad_parse_template \
+ -params [list context title] \
+ [template::streaming_template]]
ns_write {
Installing packages...
Index: openacs-4/packages/acs-admin/www/apm/write-all-specs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/write-all-specs.tcl,v
diff -u -N -r1.7.2.1 -r1.7.2.2
--- openacs-4/packages/acs-admin/www/apm/write-all-specs.tcl 10 Sep 2015 08:21:06 -0000 1.7.2.1
+++ openacs-4/packages/acs-admin/www/apm/write-all-specs.tcl 12 Sep 2015 16:47:24 -0000 1.7.2.2
@@ -8,9 +8,10 @@
set title "Generate Package Specifications"
set context [list [list "." "Package Manager"] $title]
-set template [parameter::get -package_id [ad_conn subsite_id] -parameter StreamingHead]
-ad_return_top_of_page [ad_parse_template -params [list context title] $template]
+ad_return_top_of_page [ad_parse_template \
+ -params [list context title] \
+ [template::streaming_template]]
ns_write {
Regenerating all package specifications for locally maintained packages.
Index: openacs-4/packages/acs-templating/tcl/list-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/list-procs.tcl,v
diff -u -N -r1.60.2.5 -r1.60.2.6
--- openacs-4/packages/acs-templating/tcl/list-procs.tcl 3 Sep 2015 19:56:23 -0000 1.60.2.5
+++ openacs-4/packages/acs-templating/tcl/list-procs.tcl 12 Sep 2015 16:47:24 -0000 1.60.2.6
@@ -353,8 +353,10 @@
-list_name $name \
-element_name $checkbox_name \
-spec {
- label {}
- display_template {}
+ label {}
+ display_template {}
sub_class {narrow}
html { align center }
}
@@ -2246,7 +2248,8 @@
if { $link_url ne "" } {
set old_output $output
- set output [subst {$old_output$old_output}]
+ set output [subst {$old_output$old_output}]
}
return $output
Index: openacs-4/packages/acs-templating/tcl/parse-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/parse-procs.tcl,v
diff -u -N -r1.55 -r1.55.2.1
--- openacs-4/packages/acs-templating/tcl/parse-procs.tcl 27 Jul 2015 12:19:14 -0000 1.55
+++ openacs-4/packages/acs-templating/tcl/parse-procs.tcl 12 Sep 2015 16:47:24 -0000 1.55.2.1
@@ -478,25 +478,28 @@
return $formatted_message
}
-ad_proc -public template::adp_compile { source_type source } {
+ad_proc -public template::adp_compile { {-file ""} {-string ""} } {
Converts an ADP template into a chunk of Tcl code. Caching this code
avoids the need to reparse the ADP template with each request.
- @param source_type Indicates the source of the Tcl code to compile.
- Valid options are -string or -file
- @param source A string containing either the template itself
- (for -string) or the path to the file containing the template (for -file)
-
+ @param file The file name of the source
+ @param string string to be compliled
@return The compiled code.
+
+ Valid options are either -string or -file
} {
variable parse_list
# initialize the compiled code
set parse_list [list "set __adp_output {}; set __ad_conn_locale \[ad_conn locale\]"]
- switch -exact -- $source_type {
- -file { set chunk [template::util::read_file $source] }
- -string { set chunk $source }
- default { error "Source type must be -string or -file" }
+ if {($file ne "" && $string ne "")
+ || ($file eq "" && $string eq "")
+ } {
+ error "you must specify either -file or -string"
+ } elseif {$file ne ""} {
+ set chunk [template::util::read_file $file]
+ } else {
+ set chunk $string
}
# substitute <% ... %> blocks with registered tags so they can be handled
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.28.2.4 -r1.28.2.5
--- openacs-4/packages/acs-templating/tcl/util-procs.tcl 10 Sep 2015 08:22:08 -0000 1.28.2.4
+++ openacs-4/packages/acs-templating/tcl/util-procs.tcl 12 Sep 2015 16:47:24 -0000 1.28.2.5
@@ -809,6 +809,20 @@
return $path
}
+ad_proc -public template::streaming_template {
+ -subsite_id
+} {
+ Return the path of the streaming template
+ @param subsite_id id of the subsite. Defaults to [ad_conn subsite_id]
+ @return path to themed template
+} {
+ if { ![info exists subsite_id] } {
+ set subsite_id [ad_conn subsite_id]
+ }
+ set template [parameter::get -package_id $subsite_id -parameter StreamingHead]
+ return [template::resource_path -type master -style $template -relative]
+}
+
ad_proc -public template::resource_path {
-type:required
-style:required
Index: openacs-4/packages/dotlrn/www/admin/users-bulk-approve.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-bulk-approve.tcl,v
diff -u -N -r1.6.2.1 -r1.6.2.2
--- openacs-4/packages/dotlrn/www/admin/users-bulk-approve.tcl 11 Sep 2015 11:40:53 -0000 1.6.2.1
+++ openacs-4/packages/dotlrn/www/admin/users-bulk-approve.tcl 12 Sep 2015 16:47:24 -0000 1.6.2.2
@@ -45,9 +45,10 @@
set title [_ dotlrn.Bulk_Approving]
set context $context_bar
- set template [parameter::get -package_id [ad_conn subsite_id] -parameter StreamingHead]
- ad_return_top_of_page [ad_parse_template -params [list context title] $template]
+ ad_return_top_of_page [ad_parse_template \
+ -params [list context title] \
+ [template::streaming_template]]
set subject "Your [ad_system_name] membership has been approved"
set message "Your [ad_system_name] membership has been approved. Please return to [ad_url] to log into [ad_system_name]."