summaryrefslogtreecommitdiff
path: root/LedgerSMB/Template
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-19 23:44:32 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-19 23:44:32 +0000
commitf0a253060d90d33a849673caaf686ac3f46fda27 (patch)
treedba640da21d95ef956ecf67b0744f6ae5628c336 /LedgerSMB/Template
parentc838b396b1564f574234781b19463566a95e9404 (diff)
Templating fixes and tests
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1218 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Template')
-rwxr-xr-xLedgerSMB/Template/HTML.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/LedgerSMB/Template/HTML.pm b/LedgerSMB/Template/HTML.pm
index 9f1ae252..d052319d 100755
--- a/LedgerSMB/Template/HTML.pm
+++ b/LedgerSMB/Template/HTML.pm
@@ -9,6 +9,8 @@ LedgerSMB::Template::HTML Template support module for LedgerSMB
=item get_template ()
+Returns the appropriate template filename for this format.
+
=item preprocess ($vars)
This method returns a reference to a hash that contains a copy of the passed
@@ -16,6 +18,8 @@ hashref's data with HTML entities converted to escapes.
=item postprocess ()
+Currently does nothing.
+
=back
=head1 Copyright (C) 2007, The LedgerSMB core team.
@@ -29,11 +33,11 @@ including contact information of contributors, maintainers, and copyright
holders, see the CONTRIBUTORS file.
=cut
+package LedgerSMB::Template::HTML;
+
use Error qw(:try);
use CGI;
-package LedgerSMB::Template::HTML;
-
sub get_template {
my $name = shift;
return "${name}.html";
@@ -46,15 +50,19 @@ sub preprocess {
#XXX fix escaping function
if ( $type eq 'ARRAY' ) {
+ for (@{$rawvars}) {
+ push @{$vars}, preprocess( $_ );
+ }
}
elsif ( $type eq 'HASH' ) {
for ( keys %{$rawvars} ) {
- $vars->{$_} = preprocess( $rawvars[$_] );
+ $vars->{$_} = preprocess( $rawvars->{$_} );
}
}
else {
return CGI::escapeHTML($rawvars);
}
+ return $vars;
}
sub postprocess {