diff options
Diffstat (limited to 'LedgerSMB/Template/TXT.pm')
-rwxr-xr-x | LedgerSMB/Template/TXT.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/LedgerSMB/Template/TXT.pm b/LedgerSMB/Template/TXT.pm index 2d902a39..d6fa3e4b 100755 --- a/LedgerSMB/Template/TXT.pm +++ b/LedgerSMB/Template/TXT.pm @@ -56,6 +56,7 @@ sub process { my $parent = shift; my $cleanvars = shift; my $template; + my $source; my $output; if ($parent->{outputfile}) { @@ -63,6 +64,13 @@ sub process { } else { $output = \$parent->{output}; } + if (ref $parent->{template} eq 'SCALAR') { + $source = $parent->{template}; + } elsif (ref $parent->{template} eq 'ARRAY') { + $source = join "\n", @{$parent->{template}}; + } else { + $source = get_template($parent->{template}); + } $template = Template->new({ INCLUDE_PATH => $parent->{include_path}, START_TAG => quotemeta('<?lsmb'), @@ -73,7 +81,7 @@ sub process { }) || throw Error::Simple Template->error(); if (not $template->process( - get_template($parent->{template}), + $source, {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs, 'escape' => \&preprocess}, $output, binmode => ':utf8')) { |