Fixes bounds display on multipage view.
authorStéphane Jacob <sj@m4x.org>
Mon, 1 Mar 2010 15:03:52 +0000 (16:03 +0100)
committerStéphane Jacob <sj@m4x.org>
Mon, 1 Mar 2010 15:05:06 +0000 (16:05 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/plset.php

index d0a7f8e..b838fc9 100644 (file)
@@ -312,14 +312,15 @@ abstract class MultipageView implements PlView
         $res = $this->set->get($this->limit());
 
         $show_bounds = $this->bounds();
-        $end         = end($res);
+        $start = current($res);
+        $end   = end($res);
         if ($show_bounds) {
             if ($show_bounds == 1) {
-                $first = $this->getBoundValue($res[0]);
+                $first = $this->getBoundValue($start);
                 $last  = $this->getBoundValue($end);
             } elseif ($show_bounds == -1) {
                 $first = $this->getBoundValue($end);
-                $last  = $this->getBoundValue($res[0]);
+                $last  = $this->getBoundValue($start);
             }
             $page->assign('first', $first);
             $page->assign('last', $last);