Revision 39294de3
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/Helper/Flash.pm | ||
---|---|---|
1 |
package SL::Helper::Flash; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
require Exporter; |
|
6 |
our @ISA = qw(Exporter); |
|
7 |
our @EXPORT = qw(flash render_flash); |
|
8 |
|
|
9 |
sub flash { |
|
10 |
my $category = shift; |
|
11 |
$category = 'info' if $category eq 'information'; |
|
12 |
|
|
13 |
$::form->{FLASH} ||= { }; |
|
14 |
$::form->{FLASH}->{ $category } ||= [ ]; |
|
15 |
push @{ $::form->{FLASH}->{ $category } }, @_; |
|
16 |
} |
|
17 |
|
|
18 |
sub render_flash { |
|
19 |
return $::form->parse_html_template('common/flash'); |
|
20 |
} |
|
21 |
|
|
22 |
1; |
bin/mozilla/common.pl | ||
---|---|---|
14 | 14 |
use SL::DBUtils; |
15 | 15 |
use SL::Form; |
16 | 16 |
use SL::MoreCommon; |
17 |
use SL::Helper::Flash; |
|
17 | 18 |
|
18 | 19 |
use strict; |
19 | 20 |
|
... | ... | |
727 | 728 |
$main::lxdebug->leave_sub(); |
728 | 729 |
} |
729 | 730 |
|
730 |
sub flash { |
|
731 |
my $category = shift; |
|
732 |
$category = 'info' if $category eq 'information'; |
|
733 |
|
|
734 |
$::form->{FLASH} ||= { }; |
|
735 |
$::form->{FLASH}->{ $category } ||= [ ]; |
|
736 |
push @{ $::form->{FLASH}->{ $category } }, @_; |
|
737 |
} |
|
738 |
|
|
739 |
sub render_flash { |
|
740 |
return $::form->parse_html_template('common/flash'); |
|
741 |
} |
|
742 |
|
|
743 | 731 |
if ($::use_rdbo) { |
744 | 732 |
eval { |
745 | 733 |
require SL::DB::Helpers::Mappings; |
Auch abrufbar als: Unified diff
Flash-Funktionen in eigenes Package verschoben