Index: openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl,v diff -u -r1.32 -r1.32.2.1 --- openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 12 Mar 2004 13:45:04 -0000 1.32 +++ openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 18 Mar 2004 09:07:46 -0000 1.32.2.1 @@ -445,20 +445,40 @@ Convert ADP variables to percentage_signs - the notation used to interpolate variable values into acs-lang messages. -

- We don't currently support having noquote vars in messages (i.e. we don't - substitute @var_name;noquote@). -

- @author Peter Marklund } { # substitute array variable references # loop to handle the case of adjacent variable references, like @a@@b@ while {[regsub -all [template::adp_array_variable_regexp] $text {\1%\2.\3%} text]} {} + while {[regsub -all [template::adp_array_variable_regexp_noquote] $text {\1%\2.\3;noquote%} text]} {} # substitute simple variable references while {[regsub -all [template::adp_variable_regexp] $text {\1%\2%} text]} {} + while {[regsub -all [template::adp_variable_regexp_noquote] $text {\1%\2;noquote%} text]} {} + return $text +} + +ad_proc -private lang::util::convert_percentage_signs_to_adp_variables { text } { + Convert percentage_signs message vars to adp var syntax. + + @see lang::util::convert_adp_variables_to_percentage_signs + + @author Peter Marklund +} { + # substitute array variable references + # loop to handle the case of adjacent variable references, like @a@@b@ + regsub -all {@} [template::adp_array_variable_regexp] {%} pattern + while {[regsub -all $pattern $text {\1@\2.\3@} text]} {} + regsub -all {@} [template::adp_array_variable_regexp_noquote] {%} pattern + while {[regsub -all $pattern $text {\1@\2.\3;noquote@} text]} {} + + # substitute simple variable references + regsub -all {@} [template::adp_variable_regexp] {%} pattern + while {[regsub -all $pattern $text {\1@\2@} text]} {} + regsub -all {@} [template::adp_variable_regexp_noquote] {%} pattern + while {[regsub -all $pattern $text {\1@\2;noquote@} text]} {} + return $text }