summaryrefslogtreecommitdiff
path: root/LedgerSMB/Template/HTML.pm
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB/Template/HTML.pm')
-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 {