From d56c9b0850c73bceeeadc534836c8164928cff71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 2 Oct 2015 14:08:33 +0200 Subject: [PATCH] Druck: Bei template-toolkit auch die globals setzen --- SL/Form.pm | 11 +++++++++++ SL/Template/LaTeX.pm | 2 ++ 2 files changed, 13 insertions(+) diff --git a/SL/Form.pm b/SL/Form.pm index 9c6a3a8f1..28e50a2c7 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -584,6 +584,17 @@ sub set_standard_title { $::lxdebug->leave_sub; } +sub prepare_global_vars { + my ($self) = @_; + + $self->{AUTH} = $::auth; + $self->{INSTANCE_CONF} = $::instance_conf; + $self->{LOCALE} = $::locale; + $self->{LXCONFIG} = $::lx_office_conf; + $self->{LXDEBUG} = $::lxdebug; + $self->{MYCONFIG} = \%::myconfig; +} + sub _prepare_html_template { $main::lxdebug->enter_sub(); diff --git a/SL/Template/LaTeX.pm b/SL/Template/LaTeX.pm index 31cb28fb3..6ec4d96a3 100644 --- a/SL/Template/LaTeX.pm +++ b/SL/Template/LaTeX.pm @@ -437,6 +437,8 @@ sub parse { $contents = "[% TAGS $self->{tag_start} $self->{tag_end} %]\n" . $contents; } + $form->prepare_global_vars; + $::form->init_template->process(\$contents, $form, \$new_contents) || die $::form->template->error; } else { $new_contents = $self->parse_block($contents); -- 2.20.1