Revision d2799b10
Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt
SL/Controller/Helper/Paginated.pm | ||
---|---|---|
7 | 7 |
|
8 | 8 |
use constant PRIV => '__paginatedhelper_priv'; |
9 | 9 |
|
10 |
use List::Util qw(min); |
|
11 |
|
|
10 | 12 |
my %controller_paginate_spec; |
11 | 13 |
|
12 | 14 |
sub make_paginated { |
... | ... | |
60 | 62 |
: (); |
61 | 63 |
my $calculated_params = "SL::DB::Manager::$spec->{MODEL}"->paginate(%paginate_params, args => \%paginate_args); |
62 | 64 |
%paginate_params = ( |
63 |
%paginate_params, |
|
65 |
page => min($paginate_params{page}, $calculated_params->{max}), |
|
66 |
per_page => $paginate_params{per_page}, |
|
64 | 67 |
num_pages => $calculated_params->{max}, |
65 | 68 |
common_pages => $calculated_params->{common}, |
66 | 69 |
); |
Auch abrufbar als: Unified diff
Controller-Paginate-Helfer: 'aktuelle Seite' auf maximale Seitenanzahl begrenzen
Fixt #2069.