Revision 76a39ab4
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/ReportGenerator.pm | ||
---|---|---|
415 | 415 |
return $variables; |
416 | 416 |
} |
417 | 417 |
|
418 |
sub setup_action_bar {
|
|
419 |
my ($self, $action_bar, $variables) = @_;
|
|
418 |
sub create_action_bar_actions {
|
|
419 |
my ($self, $variables) = @_; |
|
420 | 420 |
|
421 | 421 |
my @actions; |
422 | 422 |
foreach my $type (qw(pdf csv)) { |
... | ... | |
441 | 441 |
); |
442 | 442 |
} |
443 | 443 |
|
444 |
$action_bar = ($::request->layout->get('actionbar'))[0] unless blessed($action_bar); |
|
445 |
$action_bar->add(@actions) if @actions; |
|
444 |
return @actions; |
|
445 |
} |
|
446 |
|
|
447 |
sub setup_action_bar { |
|
448 |
my ($self, $variables, %params) = @_; |
|
449 |
|
|
450 |
my @actions = $self->create_action_bar_actions($variables); |
|
451 |
|
|
452 |
if ($params{action_bar_setup_hook}) { |
|
453 |
$params{action_bar_setup_hook}->(@actions); |
|
454 |
|
|
455 |
} elsif (@actions) { |
|
456 |
my $action_bar = blessed($params{action_bar}) ? $params{action_bar} : ($::request->layout->get('actionbar'))[0]; |
|
457 |
$action_bar->add(@actions); |
|
458 |
} |
|
446 | 459 |
} |
447 | 460 |
|
448 | 461 |
sub generate_html_content { |
... | ... | |
452 | 465 |
|
453 | 466 |
my $variables = $self->prepare_html_content(%params); |
454 | 467 |
|
455 |
$self->setup_action_bar($params{action_bar}, $variables) if $params{action_bar};
|
|
468 |
$self->setup_action_bar($variables, %params) if $params{action_bar};
|
|
456 | 469 |
|
457 | 470 |
my $stuff = $self->{form}->parse_html_template($self->{options}->{html_template}, $variables); |
458 | 471 |
return $stuff; |
Auch abrufbar als: Unified diff
ReportGenerator: Action-Bar-Actions über Hook-Funktion ausgeben lassen können
Damit ist es möglich, dass die Actions vom Report-Generator zwischen
den Actions der Hauptmaske eingefügt werden.