From bfa1a35ab8b449de5047bbbf7a85cbd0cc4e20a1 Mon Sep 17 00:00:00 2001 From: tetragon Date: Fri, 22 Jun 2007 19:04:24 +0000 Subject: Template handling adjustments git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1308 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Template/HTML.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'LedgerSMB/Template/HTML.pm') diff --git a/LedgerSMB/Template/HTML.pm b/LedgerSMB/Template/HTML.pm index d02000a9..0ca82bcc 100755 --- a/LedgerSMB/Template/HTML.pm +++ b/LedgerSMB/Template/HTML.pm @@ -42,6 +42,7 @@ package LedgerSMB::Template::HTML; use Error qw(:try); use CGI; use Template; +use LedgerSMB::Template::TTI18N; sub get_template { my $name = shift; @@ -54,6 +55,7 @@ sub preprocess { my $type = ref $rawvars; #XXX fix escaping function + return $rawvars if $type =~ /^LedgerSMB::Locale/; if ( $type eq 'ARRAY' ) { for (@{$rawvars}) { push @{$vars}, preprocess( $_ ); @@ -83,7 +85,9 @@ sub process { }) || throw Error::Simple Template->error(); if (not $template->process( get_template($parent->{template}), - $cleanvars, "$parent->{outputfile}.html", binmode => ':utf8')) { + {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs, + 'escape' => \&preprocess}, + "$parent->{outputfile}.html", binmode => ':utf8')) { throw Error::Simple $template->error(); } $parent->{mimetype} = 'text/html'; -- cgit v1.2.3