From: Moritz Bunkus Date: Thu, 30 Dec 2010 14:47:26 +0000 (+0100) Subject: Flash-Funktionen in eigenes Package verschoben X-Git-Tag: release-2.6.2beta1~17^2~6^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=39294de3fcf40d987865ff17ddab1de070c29f63;p=kivitendo-erp.git Flash-Funktionen in eigenes Package verschoben --- diff --git a/SL/Helper/Flash.pm b/SL/Helper/Flash.pm new file mode 100644 index 000000000..80742328d --- /dev/null +++ b/SL/Helper/Flash.pm @@ -0,0 +1,22 @@ +package SL::Helper::Flash; + +use strict; + +require Exporter; +our @ISA = qw(Exporter); +our @EXPORT = qw(flash render_flash); + +sub flash { + my $category = shift; + $category = 'info' if $category eq 'information'; + + $::form->{FLASH} ||= { }; + $::form->{FLASH}->{ $category } ||= [ ]; + push @{ $::form->{FLASH}->{ $category } }, @_; +} + +sub render_flash { + return $::form->parse_html_template('common/flash'); +} + +1; diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index c889bc100..143551f74 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -14,6 +14,7 @@ use SL::Common; use SL::DBUtils; use SL::Form; use SL::MoreCommon; +use SL::Helper::Flash; use strict; @@ -727,19 +728,6 @@ sub gl_transaction { $main::lxdebug->leave_sub(); } -sub flash { - my $category = shift; - $category = 'info' if $category eq 'information'; - - $::form->{FLASH} ||= { }; - $::form->{FLASH}->{ $category } ||= [ ]; - push @{ $::form->{FLASH}->{ $category } }, @_; -} - -sub render_flash { - return $::form->parse_html_template('common/flash'); -} - if ($::use_rdbo) { eval { require SL::DB::Helpers::Mappings;