require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(flash flash_later);
-our @EXPORT_OK = qw(render_flash);
+our @EXPORT_OK = qw(render_flash delay_flash);
my %valid_categories = (
map({$_ => 'info'} qw(information message)),
$::auth->set_session_value({ key => "FLASH", value => _store_flash($::auth->get_session_value('FLASH'), @_), auto_restore => 1 });
}
+sub delay_flash {
+ my $store = $::form->{FLASH} || { };
+ flash_later($_ => @{ $store->{$_} || [] }) for keys %$store;
+}
+
sub render_flash {
return $::form->parse_html_template('common/flash');
}
my $store = shift || { };
my $category = _check_category(+shift);
- $store ||= { };
$store->{ $category } ||= [ ];
push @{ $store->{ $category } }, @_;
This function is not exported by default.
+=item C<delay_flash>
+
+Delays flash, as if all flash messages in this request would have been
+C<flash_later>
+
+Not exported by default.
+
=back
=head1 AUTHOR