Revision 40db40e8
Von Moritz Bunkus vor fast 19 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
424 | 424 |
sub parse_html_template { |
425 | 425 |
$main::lxdebug->enter_sub(); |
426 | 426 |
|
427 |
my ($self, $file) = @_; |
|
427 |
my ($self, $myconfig, $file) = @_; |
|
428 |
|
|
429 |
if (-f "templates/webpages/${file}_" . $myconfig->{"countrycode"} . |
|
430 |
".html") { |
|
431 |
$file = "templates/webpages/${file}_" . $myconfig->{"countrycode"} . |
|
432 |
".html"; |
|
433 |
} elsif (-f "templates/webpages/${file}.html") { |
|
434 |
$file = "templates/webpages/${file}.html"; |
|
435 |
} else { |
|
436 |
$self->error("Web page template '${file}' not found."); |
|
437 |
} |
|
428 | 438 |
|
429 |
my $template = HTML::Template->new("filename" => "templates/webpages/$file",
|
|
439 |
my $template = HTML::Template->new("filename" => $file,
|
|
430 | 440 |
"die_on_bad_params" => 0, |
431 | 441 |
"strict" => 0, |
432 | 442 |
"case_sensitive" => 1, |
... | ... | |
453 | 463 |
} |
454 | 464 |
|
455 | 465 |
sub show_generic_error { |
456 |
my ($self, $error, $title) = @_; |
|
466 |
my ($self, $myconfig, $error, $title) = @_;
|
|
457 | 467 |
|
458 | 468 |
$self->{"title"} = $title if ($title); |
459 | 469 |
$self->{"label_error"} = $error; |
460 | 470 |
|
461 |
print($self->parse_html_template("generic/error.html"));
|
|
471 |
print($self->parse_html_template($myconfig, "generic/error"));
|
|
462 | 472 |
} |
463 | 473 |
|
464 | 474 |
# write Trigger JavaScript-Code ($qty = quantity of Triggers) |
Auch abrufbar als: Unified diff
Vorlagen werden nun direkt lokalisiert. Die Funktion zum Parsen der Vorlagen sucht explizit zuerst nach der Vorlage fuer die ausgewaehlte Sprache.