Flash-Funktionen in eigenes Package verschoben
[kivitendo-erp.git] / 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;