Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 86be28e9

Von Moritz Bunkus vor mehr als 18 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
424 424
sub parse_html_template {
425 425
  $main::lxdebug->enter_sub();
426 426

  
427
  my ($self, $myconfig, $file) = @_;
427
  my ($self, $myconfig, $file, $additional_params) = @_;
428 428

  
429 429
  if (-f "templates/webpages/${file}_" . $myconfig->{"countrycode"} .
430 430
      ".html") {
......
442 442
                                     "case_sensitive" => 1,
443 443
                                     "loop_context_vars" => 1,
444 444
                                     "global_vars" => 1);
445
  my @params = $template->param();
446 445

  
447
  if (grep("DEBUG", @params) && $self->{"DEBUG"}) {
448
    $template->param("DEBUG" => "<br><em>DEBUG INFORMATION:</em><pre>" .
449
                     $self->{"DEBUG"} . "</pre>");
446
  $additional_params = {} unless ($additional_params);
447
  if ($self->{"DEBUG"}) {
448
    $additional_params->{"DEBUG"} = $self->{"DEBUG"};
450 449
  }
451 450

  
452
  foreach my $key (keys(%{$self})) {
453
    if (("DEBUG" ne $key) && grep(${key}, @params)) {
451
  if ($additional_params->{"DEBUG"}) {
452
    $additional_params->{"DEBUG"} =
453
      "<br><em>DEBUG INFORMATION:</em><pre>" . $additional_params->{"DEBUG"} . "</pre>";
454
  }
455

  
456
  my @additional_param_names = keys(%{$additional_params});
457

  
458
  foreach my $key ($template->param()) {
459
    if (grep(/^${key}$/, @additional_param_names)) {
460
      $template->param($key => $additional_params->{$key});
461
    } else {
454 462
      $template->param($key => $self->{$key});
455 463
    }
456 464
  }
......
465 473
sub show_generic_error {
466 474
  my ($self, $myconfig, $error, $title) = @_;
467 475

  
468
  $self->{"title"} = $title if ($title);
476
  my $add_params = {};
477
  $add_params->{"title"} = $title if ($title);
469 478
  $self->{"label_error"} = $error;
470 479

  
471
  print($self->parse_html_template($myconfig, "generic/error"));
480
  print($self->parse_html_template($myconfig, "generic/error", $add_params));
472 481
}
473 482

  
474 483
# write Trigger JavaScript-Code ($qty = quantity of Triggers)

Auch abrufbar als: Unified diff