summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/JWebmail/Plugin/Helper.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/JWebmail/Plugin/Helper.pm b/lib/JWebmail/Plugin/Helper.pm
index c00ef0e..ed2c31b 100644
--- a/lib/JWebmail/Plugin/Helper.pm
+++ b/lib/JWebmail/Plugin/Helper.pm
@@ -244,7 +244,7 @@ sub _paginate {
[_clamp(0, $page_*$page_size, $total_items-1), _clamp(0, ($page_+1)*$page_size, $total_items)]
};
- my %ret = (
+ my $ret = {
total_items => $total_items,
page_size => $page_size,
@@ -256,14 +256,14 @@ sub _paginate {
this_page => $page->($current_page),
next_page => $page->($current_page+1),
last_page => $page->($total_pages-1),
- );
+ };
if ($total_items) {
- $ret{first_item} = $first_item;
- $ret{last_item} = _clamp($first_item, $first_item+$page_size-1, $total_items-1);
+ $ret->{first_item} = $first_item;
+ $ret->{last_item} = _clamp($first_item, $first_item+$page_size-1, $total_items-1);
}
- return %ret;
+ return $ret;
}
sub paginate {
@@ -277,7 +277,7 @@ sub paginate {
$start = _clamp(0, $start, max($count-1, 0));
my $end = _clamp($start, $start+$psize, max($count, 0));
- $c->stash(_paginate(
+ $c->stash(pgn => _paginate(
first_item => int($start/$psize)*$psize,
page_size => $psize,
total_items => $count,