my $self = $type->SUPER::new(@_);
$self->{"rnd"} = int(rand(1000000));
- $self->{"iconv"} = SL::Iconv->new($::lx_office_conf{system}->{dbcharset}, "UTF-8");
$self->set_tag_style('<%', '%>');
$self->{quot_re} = '"';
$contents =~ s|</office:automatic-styles>|${new_styles}</office:automatic-styles>|;
$contents =~ s|[\n\r]||gm;
- my $new_contents = $self->parse_block($contents);
+ my $new_contents;
+ if ($self->{use_template_toolkit}) {
+ my $additional_params = $::form;
+
+ $::form->init_template->process(\$contents, $additional_params, \$new_contents) || die $::form->template->error;
+ } else {
+ $new_contents = $self->parse_block($contents);
+ }
if (!defined($new_contents)) {
$main::lxdebug->leave_sub();
return 0;
sub format_string {
my ($self, $variable) = @_;
my $form = $self->{"form"};
- my $iconv = $self->{"iconv"};
$variable = $main::locale->quote_special_chars('Template/OpenDocument', $variable);
$variable =~ s|\</${key}\>|</text:span>|gi;
}
- return $iconv->convert($variable);
+ return $variable;
}
sub get_mime_type() {