Index: openacs-4/packages/acs-templating/tcl/tag-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tag-init.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/acs-templating/tcl/tag-init.tcl 27 Oct 2014 16:40:12 -0000 1.36 +++ openacs-4/packages/acs-templating/tcl/tag-init.tcl 10 Jun 2015 12:09:58 -0000 1.37 @@ -20,7 +20,7 @@ template_tag tcl { chunk params } { # if the chunk begins with = then add our own append - if { [string index $chunk 0] == "=" } { + if { [string index $chunk 0] eq "=" } { template::adp_append_code "append __adp_output [string range $chunk 1 end]" } else { template::adp_append_code $chunk @@ -36,9 +36,11 @@ set name [ns_set iget $params name] # quote dollar signs, square bracket and quotes - regsub -all {[\]\[""\\$]} $chunk {\\&} quoted_chunk + regsub -all {[\]\[\"\\$]} $chunk {\\&} quoted_chunk + regsub -all {} $quoted_chunk {<%} quoted_chunk + regsub -all {} $quoted_chunk {%>} quoted_chunk - template::adp_append_code "set __adp_properties($name) \"$quoted_chunk\"" + template::adp_append_code "set __adp_properties($name) \[ns_adp_parse -string \"$quoted_chunk\"\]" } # Set the master template. Index: openacs-4/packages/acs-templating/tcl/widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/widget-procs.tcl,v diff -u -r1.51 -r1.52 --- openacs-4/packages/acs-templating/tcl/widget-procs.tcl 27 Oct 2014 16:40:13 -0000 1.51 +++ openacs-4/packages/acs-templating/tcl/widget-procs.tcl 10 Jun 2015 12:09:58 -0000 1.52 @@ -926,7 +926,7 @@ foreach option $options { if {$count == 0} { # answer descriptions in a list: {{desc1 no_of_answers} {desc2 no_of_answers} ...} - append output "" + append output "" foreach answer_desc $option { set answer_description [lindex $answer_desc 0] set no_of_answers [lindex $answer_desc 1] @@ -1168,7 +1168,7 @@ set output {} # edit mode - set radio_text " Simple variable substitution -View -View -View -View +View +View +View +View Using bind variables in your query -View -View -View -View +View +View +View +View A plain Tcl page that returns its own output -View -None -None -View +View +None +None +View Conditional Expressions - View - View - View - View + View + View + View + View Comments - + None - View - View - View + View + View + View @@ -89,49 +89,49 @@ Include a template within another template -View -include
+View +include
included -include
+include
included -View +View Wrap a page within a master template -None -Slave
+None +Slave
Master -Slave
+Slave
Master -View +View Using the default master -None +None -View -View -View +View +View +View Include with master and recursion.
Remember Fibonacci from pset 1, exercise 1? -Start
+Start
Included
Master -Start
+Start
Included
Master -Start
+Start
Included
Master -View +View @@ -151,34 +151,34 @@ Tcl escape with implicit output -View -View -View -View +View +View +View +View Tcl escape with explicit output -None +None -View -View -View +View +View +View Template chunks within escaped Tcl code blocks -View -View -View -View +View +View +View +View Puts (if you absolutely must) - View - View - View - View + View + View + View + View @@ -202,55 +202,55 @@ Repeating template chunks for each row of a query result -View -View -View -View +View +View +View +View Generating the multirow datasource in TCL -View -View -View -View +View +View +View +View Repeating template chunks for each row of a query result, with custom manipulation of data -View -View -View -View +View +View +View +View Repeating template chunks with grouping -View -View -View -View +View +View +View +View Repeating template chunks as cells of a grid -View -View -View -View +View +View +View +View Repeating template chunks for each element of a list -View -View -View -View +View +View +View +View @@ -269,34 +269,34 @@ Apply different skins to the same data -View -Plain
+View +Plain
Fancy -Plain
+Plain
Fancy -Plain
+Plain
Fancy
Absolute Passing a multirow datasource to an included page -View -Outer
+View +Outer
Included -Outer
+Outer
Included -View +View Processing a template from a string (not file) - View - View - View - View + View + View + View + View @@ -314,20 +314,20 @@ Simplest (single-column) list, no features - + View .tcl
postgres query
oracle query - + No master
W/ master - + No master
W/ master - + No master
W/ master @@ -336,132 +336,132 @@ Add some columns - + View .tcl
postgres query
oracle query - View - View - View + View + View + View Add the ability to sort by any column - + View .tcl
postgres query
oracle query - View - View - View + View + View + View Link the title to a one-note detail page - + index
detail - + index
detail - + index
detail - View + View Add a bulk action to delete all checked notes - + index
delete
postgres query
oracle query - + index - + index - View + View Add a single/non-bulk action to create a note - + index
add-edit - + index
add-edit - + index
add-edit - View + View Add a filter - + index
postgres query
oracle query - + index
- + index
- View + View Add pagination with no page group cache - + index
postgres query
oracle query - + index
- + index
- View + View Add page group caching to pagination (no looks difference) - + index
add-edit
delete
- + index
- + index
- View + View @@ -478,27 +478,27 @@ Using ad_page_contract -Target +Target -Form
+Form
Target
Error Page -Form
+Form
Target
Error Page -Form
+Form
Target
  Report an error related to a request. -View -View -Plain -View +View +View +Plain +View @@ -518,104 +518,104 @@ A simple form -View -View +View +View -View -View +View +View A form with button groups -View -Simple
+View +Simple
Gridded -Simple
+Simple
Gridded -Simple
+Simple
Gridded A form with Select widgets -View -View +View +View -View -View +View +View -Custom validation of a request +Custom validation of a request -View -View +View +View -View - +View + Inline Error Message - + Sitewide Error Page - Valid + Valid Request A form with the Date widget -View -View -View -View +View +View +View +View Editing: several pages in one -View -View -View -View +View +View +View +View A form with a custom confirmation page -View -Submit
+View +Submit
Confirm -Submit
+Submit
Confirm -View +View A form with display/edit modes -View -View -View -View +View +View +View +View A form with multiple submit buttons -View -View -View -View +View +View +View +View Index: openacs-4/packages/acs-templating/www/doc/demo/pay.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/pay.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/doc/demo/pay.tcl 27 Oct 2014 16:40:19 -0000 1.3 +++ openacs-4/packages/acs-templating/www/doc/demo/pay.tcl 10 Jun 2015 12:09:59 -0000 1.4 @@ -25,7 +25,7 @@ set confirm_data [form export] # add the form:confirm element - append confirm_data "" + append confirm_data "" template::set_file "[file dirname $__adp_stub]/pay-confirm" } Index: openacs-4/packages/acs-templating/www/doc/demo/string.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/string.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/demo/string.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/demo/string.tcl 10 Jun 2015 12:09:59 -0000 1.2 @@ -1,7 +1,7 @@ # suppose this template was obtained from a database query set template " @name@ ordered - " + " set code [adp_compile -string $template]; # compile the template Index: openacs-4/packages/acs-templating/www/doc/exercise/form-sample-revised.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/exercise/form-sample-revised.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/doc/exercise/form-sample-revised.tcl 27 Apr 2001 02:27:09 -0000 1.2 +++ openacs-4/packages/acs-templating/www/doc/exercise/form-sample-revised.tcl 10 Jun 2015 12:09:59 -0000 1.3 @@ -8,7 +8,7 @@ address -html { size 40 } -label "Address" -optional -datatype text city -html { size 30 } -label "City" -optional -datatype text state -html { size 3 maxlength 2 } -label "State" -optional -datatype keyword \ - -validate { {expr [string length $value ] ==2 } {Entry for tate must be two characters in length } } + -validate { {expr [string length $value ] == 2 } {Entry for tate must be two characters in length } } zip -html { size 10 } -label "Zip" -optional -datatype text country -html { size 30 } -label "Country" -optional -datatype text email -html { size 30 } -label "Email" -optional -datatype text Index: openacs-4/packages/acs-templating/www/doc/exercise/form-sample.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/exercise/form-sample.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/doc/exercise/form-sample.tcl 10 Jan 2007 21:22:13 -0000 1.4 +++ openacs-4/packages/acs-templating/www/doc/exercise/form-sample.tcl 10 Jun 2015 12:09:59 -0000 1.5 @@ -73,7 +73,7 @@ address -html { size 40 } -label "Address" -optional -datatype text city -html { size 30 } -label "City" -optional -datatype text state -html { size 3 maxlength 2 } -label "State" -optional -datatype keyword \ - -validate { {expr [string length $value ] ==2 } {Entry for tate must be two characters in length } } + -validate { {expr [string length $value ] == 2 } {Entry for tate must be two characters in length } } zip -html { size 10 } -label "Zip" -optional -datatype text country -html { size 30 } -label "Country" -optional -datatype text email -html { size 30 } -label "Email" -optional -datatype text Index: openacs-4/packages/acs-templating/www/doc/gen/proc-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/gen/proc-template.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/gen/proc-template.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/gen/proc-template.tcl 10 Jun 2015 12:09:59 -0000 1.2 @@ -51,7 +51,7 @@ util::list_to_multirow see [lindex $data 3] -set required_marker "*" +set required_marker "*" Index: openacs-4/packages/acs-templating/www/doc/guide/composite.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/guide/composite.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/guide/composite.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/guide/composite.html 10 Jun 2015 12:09:59 -0000 1.2 @@ -17,11 +17,11 @@ may have the following structure.

- +
master - +
top @@ -31,8 +31,8 @@ root (main)

-   -
+   +
widget
@@ -57,109 +57,109 @@

The parts are - put together with the <<include> tag (in the diagram below, black links going right) and - the <<master> tag (brown link going left); and the concept is similar to a procedure call. The structure of the composite page looks like this as a graph.

- +
- + - + - + - - - - - - + + + + + + - - - - + + + + - - - + - + - + - + - + - + - - - - - - + + + + + + + - - + + - + - - + + - + - + - + - + - + - +
root root
 code   template 
- - + +
- - + +
- + + - + +
master  code   template   code   template  widget
- - - - + + + +
-
 code   template   code   template 
topbottomtopbottom
@@ -188,27 +188,27 @@

- - + + - - - - + + + + - - - + + + - + - + - + - +
root.tcl
root.adp
root.tcl
root.adp (beginning and middle)
 widget.tcl
widget.adp
root.adp
 widget.tcl
widget.adp
root.adp (end)
 master.tcl
master.adp
 master.tcl
master.adp (beginning)
 
  top.tcl
top.adp
master.adp
master.adp (middle, containing <slave> tag)
 
  bottom.tcl
bottom.adp
master.adp
master.adp (end)
@@ -239,25 +239,25 @@ set_file again, we get the following picure.

- +
- + - + - - - + + + @@ -267,7 +267,7 @@

This assumes page "A" was originally wanted. An arrow () exits from code + src="down.gif" width="7" height="15" align="top">) exits from code which calls template::set_file (directly or through ad_return_template). All scripts and the template are executed in the same scope, i.e., they share @@ -279,11 +279,11 @@ possibilities.

-
code A (template A ignored)
code B (template B ignored)
...
...
code Z
+
- + - + Index: openacs-4/packages/acs-templating/www/scripts/xinha/file-selector.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/scripts/xinha/file-selector.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/scripts/xinha/file-selector.tcl 27 Oct 2014 16:40:53 -0000 1.3 +++ openacs-4/packages/acs-templating/www/scripts/xinha/file-selector.tcl 10 Jun 2015 12:09:59 -0000 1.4 @@ -169,7 +169,7 @@ - #file-storage.@contents.type@#onclick="selectImage('@contents.object_id@','@contents.file_url@','@contents.type@');return false;">@contents.name@ }
a)a) code template