Druck: Bei template-toolkit auch die globals setzen
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 2 Oct 2015 12:08:33 +0000 (14:08 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 2 Oct 2015 12:08:33 +0000 (14:08 +0200)
SL/Form.pm
SL/Template/LaTeX.pm

index 9c6a3a8..28e50a2 100644 (file)
@@ -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();
 
index 31cb28f..6ec4d96 100644 (file)
@@ -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);