diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-15 22:22:41 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-15 22:22:41 +0000 |
commit | 46347e4974eb30c4bc212e802b6b45d3163468d1 (patch) | |
tree | 8bb104afa59e5113303d947716a5fcc30aec89ca /LedgerSMB/Template/HTML.pm | |
parent | 57dfea7df5e73799e43da21263887ac57aa6383e (diff) |
Adjust templating to allow for no output file.
Due to their nature of the modules, PDF and PS will supply one if needed.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1612 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Template/HTML.pm')
-rwxr-xr-x | LedgerSMB/Template/HTML.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/LedgerSMB/Template/HTML.pm b/LedgerSMB/Template/HTML.pm index 3eb442c8..da9d2e00 100755 --- a/LedgerSMB/Template/HTML.pm +++ b/LedgerSMB/Template/HTML.pm @@ -75,7 +75,13 @@ sub process { my $parent = shift; my $cleanvars = shift; my $template; + my $output; + if ($parent->{outputfile}) { + $output = "$parent->{outputfile}.html"; + } else { + $output = \$parent->{output}; + } $template = Template->new({ INCLUDE_PATH => $parent->{include_path}, START_TAG => quotemeta('<?lsmb'), @@ -89,7 +95,7 @@ sub process { get_template($parent->{template}), {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs, 'escape' => \&preprocess}, - "$parent->{outputfile}.html", binmode => ':utf8')) { + $output, binmode => ':utf8')) { throw Error::Simple $template->error(); } $parent->{mimetype} = 'text/html'; @@ -97,8 +103,8 @@ sub process { sub postprocess { my $parent = shift; - $parent->{rendered} = "$parent->{outputfile}.html"; - return "$parent->{outputfile}.html"; + $parent->{rendered} = "$parent->{outputfile}.html" if $parent->{outputfile}; + return $parent->{rendered}; } 1; |