X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate.pm;h=6da93d9b396806a0f6270c0f5054217dc3ddde36;hb=2868feee8fb33457e7562f02778186b5b5c1a2b6;hp=3439f52a30571d283c0f033269a0f306d213cac6;hpb=e032c24a937948634c0a93c656c083760a136585;p=kivitendo-erp.git diff --git a/SL/Template.pm b/SL/Template.pm index 3439f52a3..6da93d9b3 100644 --- a/SL/Template.pm +++ b/SL/Template.pm @@ -99,38 +99,7 @@ sub format_string { my ($self, $variable) = @_; my $form = $self->{"form"}; - my %replace = - ('order' => [quotemeta("\\"), - '', - '&', quotemeta("\n"), - '"', '\$', '%', '_', '#', quotemeta('^'), - '{', '}', '<', '>', '£', "\r", '±', '\xe1', - '²', '³', - - ], - quotemeta("\\") => '\\textbackslash ', - '' => '', - '"' => "''", - '&' => '\&', - '\$' => '\$', - '%' => '\%', - '_' => '\_', - '#' => '\#', - '{' => '\{', - '}' => '\}', - '<' => '$<$', - '>' => '$>$', - '£' => '\pounds ', - "\r" => "", - '±' => '$\pm$', - '\xe1' => '$\bullet$', - quotemeta('^') => '\^\\', - quotemeta("\n") => '\newline ', - '²' => '$^2$', - '³' => '$^3$', - ); - - map({ $variable =~ s/$_/$replace{$_}/g; } @{ $replace{"order"} }); + $variable = $main::locale->quote_special_chars('Template/LaTeX', $variable); # Allow some HTML markup to be converted into the output format's # corresponding markup code, e.g. bold or italic. @@ -400,6 +369,77 @@ sub parse_first_line { return 1; } +sub _parse_config_option { + my $self = shift; + my $line = shift; + + $line =~ s/^\s*//; + $line =~ s/\s*$//; + + my ($key, $value) = split m/\s*=\s*/, $line, 2; + + if ($key eq 'tag-style') { + $self->set_tag_style(split(m/\s+/, $value, 2)); + } +} + +sub _parse_config_lines { + my $self = shift; + my $lines = shift; + + my ($comment_start, $comment_end) = ("", ""); + + if (ref $self eq 'LaTeXTemplate') { + $comment_start = '\s*%'; + } elsif (ref $self eq 'HTMLTemplate') { + $comment_start = '\s*