Revision 1d1b94ec
Von Moritz Bunkus vor etwa 17 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
39 | 39 |
use Data::Dumper; |
40 | 40 |
|
41 | 41 |
use Cwd; |
42 |
use HTML::Template; |
|
43 | 42 |
use Template; |
44 | 43 |
use SL::Template; |
45 | 44 |
use CGI::Ajax; |
... | ... | |
547 | 546 |
return $file; |
548 | 547 |
} |
549 | 548 |
|
550 |
sub parse_html_template { |
|
551 |
$main::lxdebug->enter_sub(); |
|
552 |
|
|
553 |
my ($self, $file, $additional_params) = @_; |
|
554 |
|
|
555 |
$additional_params ||= { }; |
|
556 |
|
|
557 |
$file = $self->_prepare_html_template($file, $additional_params); |
|
558 |
|
|
559 |
my $template = HTML::Template->new("filename" => $file, |
|
560 |
"die_on_bad_params" => 0, |
|
561 |
"strict" => 0, |
|
562 |
"case_sensitive" => 1, |
|
563 |
"loop_context_vars" => 1, |
|
564 |
"global_vars" => 1); |
|
565 |
|
|
566 |
foreach my $key ($template->param()) { |
|
567 |
my $param = $additional_params->{$key} || $self->{$key}; |
|
568 |
$param = [] if (($template->query("name" => $key) eq "LOOP") && (ref($param) ne "ARRAY")); |
|
569 |
$template->param($key => $param); |
|
570 |
} |
|
571 |
|
|
572 |
my $output = $template->output(); |
|
573 |
|
|
574 |
$output = $main::locale->{iconv}->convert($output) if ($main::locale); |
|
575 |
|
|
576 |
$main::lxdebug->leave_sub(); |
|
577 |
|
|
578 |
return $output; |
|
579 |
} |
|
580 |
|
|
581 | 549 |
sub parse_html_template2 { |
582 | 550 |
$main::lxdebug->enter_sub(); |
583 | 551 |
|
Auch abrufbar als: Unified diff
Das Modul HTML::Template wird nicht mehr benötigt.