Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 86be28e9

Von Moritz Bunkus vor etwa 19 Jahren hinzugefügt

  • ID 86be28e9b1744d86e2db534c3d2b005eb5f144f5
  • Vorgänger 40db40e8
  • Nachfolger 2787b39a

Erlaube die Uebergabe von weiteren Parametern direkt an die HTML-Vorlage unter Umgehung von $form.

Unterschiede anzeigen:

SL/Form.pm
sub parse_html_template {
$main::lxdebug->enter_sub();
my ($self, $myconfig, $file) = @_;
my ($self, $myconfig, $file, $additional_params) = @_;
if (-f "templates/webpages/${file}_" . $myconfig->{"countrycode"} .
".html") {
......
"case_sensitive" => 1,
"loop_context_vars" => 1,
"global_vars" => 1);
my @params = $template->param();
if (grep("DEBUG", @params) && $self->{"DEBUG"}) {
$template->param("DEBUG" => "<br><em>DEBUG INFORMATION:</em><pre>" .
$self->{"DEBUG"} . "</pre>");
$additional_params = {} unless ($additional_params);
if ($self->{"DEBUG"}) {
$additional_params->{"DEBUG"} = $self->{"DEBUG"};
}
foreach my $key (keys(%{$self})) {
if (("DEBUG" ne $key) && grep(${key}, @params)) {
if ($additional_params->{"DEBUG"}) {
$additional_params->{"DEBUG"} =
"<br><em>DEBUG INFORMATION:</em><pre>" . $additional_params->{"DEBUG"} . "</pre>";
}
my @additional_param_names = keys(%{$additional_params});
foreach my $key ($template->param()) {
if (grep(/^${key}$/, @additional_param_names)) {
$template->param($key => $additional_params->{$key});
} else {
$template->param($key => $self->{$key});
}
}
......
sub show_generic_error {
my ($self, $myconfig, $error, $title) = @_;
$self->{"title"} = $title if ($title);
my $add_params = {};
$add_params->{"title"} = $title if ($title);
$self->{"label_error"} = $error;
print($self->parse_html_template($myconfig, "generic/error"));
print($self->parse_html_template($myconfig, "generic/error", $add_params));
}
# write Trigger JavaScript-Code ($qty = quantity of Triggers)

Auch abrufbar als: Unified diff