X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5494f687372570c9d1c5eb5c6aad73767e50820a..d6dbee343cd1feeab87638092ae5f8aaec2bfadb:/SL/Controller/Base.pm diff --git a/SL/Controller/Base.pm b/SL/Controller/Base.pm index 6d9434742..285bfcee4 100644 --- a/SL/Controller/Base.pm +++ b/SL/Controller/Base.pm @@ -30,6 +30,11 @@ sub redirect_to { my $self = shift; my $url = $self->url_for(@_); + if ($self->delay_flash_on_redirect) { + require SL::Helper::Flash; + SL::Helper::Flash::delay_flash(); + } + print $::request->{cgi}->redirect($url); } @@ -152,6 +157,14 @@ sub _run_hooks { } } +# +# behaviour. override these +# + +sub delay_flash_on_redirect { + 0; +} + # # private functions -- for use in Base only # @@ -482,6 +495,12 @@ action. The hook's return values are discarded. +=item delay_flash_on_redirect + +May be overridden by a controller. If this method returns true, redirect_to +will delay all flash messages for the current request. Defaults to false for +compatibility reasons. + =back =head2 PRIVATE FUNCTIONS