summaryrefslogtreecommitdiff
path: root/LedgerSMB/Template.pm
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-10 21:13:14 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-10 21:13:14 +0000
commit59b539628096d57bc8803682bb9990939d5e9178 (patch)
tree8165aeba946e1a329d5579d5c0b7ab34ad65907a /LedgerSMB/Template.pm
parenta5577e8f380ef6301e1a976780c7636da32e0a9f (diff)
Initial templating of the GL report.
Adding CSV output git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1555 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Template.pm')
-rwxr-xr-xLedgerSMB/Template.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/LedgerSMB/Template.pm b/LedgerSMB/Template.pm
index 2432b5f1..de0fa797 100755
--- a/LedgerSMB/Template.pm
+++ b/LedgerSMB/Template.pm
@@ -11,7 +11,7 @@ This module renders templates.
=over
-=item new(user => \%myconfig, template => $string, format => 'HTML', [language => $string,] [include_path => $path], [no_auto_output => $bool], [method => $string] );
+=item new(user => \%myconfig, template => $string, format => 'HTML', [language => $string,] [include_path => $path], [no_auto_output => $bool], [method => $string], [no_escape => $bool]] );
This command instantiates a new template:
template is the file name of the template to be processed.
@@ -19,6 +19,7 @@ format is the type of format to be used. Currently only HTML is supported
language (optional) specifies the language for template selection.
include_path allows one to override the template directory and use this with user interface templates.
no_auto_output disables the automatic output of rendered templates.
+no_escape disables escaping on the template variables.
method is the output method to use, defaults to HTTP
media is a synonym for method
@@ -62,6 +63,7 @@ sub new {
$self->{format} = $args{format};
$self->{format} = 'PS' if lc $self->{format} eq 'postscript';
$self->{language} = $args{language};
+ $self->{no_escape} = $args{no_escape};
if ($args{outputfile}) {
$self->{outputfile} =
"${LedgerSMB::Sysconfig::tempdir}/$args{outputfile}";
@@ -112,7 +114,12 @@ sub render {
throw Error::Simple $@;
}
- my $cleanvars = $format->can('preprocess')->($vars);
+ my $cleanvars;
+ if ($self->{no_escape}) {
+ $cleanvars = $vars;
+ } else {
+ $cleanvars = $format->can('preprocess')->($vars);
+ }
if (UNIVERSAL::isa($self->{locale}, 'LedgerSMB::Locale')){
$cleanvars->{text} = sub { return $self->{locale}->text(@_)};