Revision ccacef74
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/Controller/Helper/Paginated.pm | ||
---|---|---|
7 | 7 |
|
8 | 8 |
use constant PRIV => '__paginatedhelper_priv'; |
9 | 9 |
|
10 |
my $controller_paginate_spec;
|
|
10 |
my %controller_paginate_spec;
|
|
11 | 11 |
|
12 | 12 |
sub make_paginated { |
13 | 13 |
my ($class, %specs) = @_; |
... | ... | |
20 | 20 |
$specs{ONLY} = [ $specs{ONLY} ] if !ref $specs{ONLY}; |
21 | 21 |
$specs{ONLY_MAP} = @{ $specs{ONLY} } ? { map { ($_ => 1) } @{ $specs{ONLY} } } : { '__ALL__' => 1 }; |
22 | 22 |
|
23 |
$controller_paginate_spec = \%specs; |
|
23 |
$controller_paginate_spec{$class} = \%specs;
|
|
24 | 24 |
|
25 | 25 |
my %hook_params = @{ $specs{ONLY} } ? ( only => $specs{ONLY} ) : (); |
26 | 26 |
$class->run_before('_save_current_paginate_params', %hook_params); |
... | ... | |
38 | 38 |
sub get_paginate_spec { |
39 | 39 |
my ($class_or_self) = @_; |
40 | 40 |
|
41 |
return $controller_paginate_spec; |
|
41 |
return $controller_paginate_spec{ref($class_or_self) || $class_or_self};
|
|
42 | 42 |
} |
43 | 43 |
|
44 | 44 |
sub get_current_paginate_params { |
Auch abrufbar als: Unified diff
Paginated-Controller-Helfer: Sortier-Spec nicht auf Klassenebene cachen