From e4fb6339c9cbdea46f72479b7278b032124b0529 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 3 Sep 2012 08:52:17 +0200 Subject: [PATCH] =?utf8?q?Kosmetik:=20Einr=C3=BCckung?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/Helper/Paginated.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/SL/DB/Helper/Paginated.pm b/SL/DB/Helper/Paginated.pm index a24d4d7e0..a0ad02cb8 100644 --- a/SL/DB/Helper/Paginated.pm +++ b/SL/DB/Helper/Paginated.pm @@ -9,18 +9,18 @@ our @EXPORT = qw(paginate disable_paginating); use List::MoreUtils qw(any); sub paginate { - my ($self, %params) = @_; - my $page = $params{page} || 1; - my %args = %{ $params{args} || {} }; - - my $ret = { }; - - $ret->{per_page} = per_page($self, %params); - $ret->{max} = ceil($self->get_all_count(%args), $ret->{per_page}) || 1; - $ret->{cur} = $page < 1 ? 1 - : $page > $ret->{max} ? $ret->{max} - : $page; - $ret->{common} = make_common_pages($ret->{cur}, $ret->{max}); + my ($self, %params) = @_; + my $page = $params{page} || 1; + my %args = %{ $params{args} || {} }; + + my $ret = { }; + + $ret->{per_page} = per_page($self, %params); + $ret->{max} = ceil($self->get_all_count(%args), $ret->{per_page}) || 1; + $ret->{cur} = $page < 1 ? 1 + : $page > $ret->{max} ? $ret->{max} + : $page; + $ret->{common} = make_common_pages($ret->{cur}, $ret->{max}); $params{args}{page} = $ret->{cur}; $params{args}{per_page} = $ret->{per_page}; -- 2.20.1