From 39294de3fcf40d987865ff17ddab1de070c29f63 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 30 Dec 2010 15:47:26 +0100 Subject: [PATCH] Flash-Funktionen in eigenes Package verschoben --- SL/Helper/Flash.pm | 22 ++++++++++++++++++++++ bin/mozilla/common.pl | 14 +------------- 2 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 SL/Helper/Flash.pm 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; -- 2.20.1