]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
fix call-time pass-by-reference
authorAndrey Kutejko <andy128k@gmail.com>
Thu, 20 Oct 2011 11:05:11 +0000 (13:05 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Thu, 20 Oct 2011 11:05:11 +0000 (13:05 +0200)
ipf/orm/pager/layoutarrows.php

index 9e03d00c176891967ce57b99ab7aea1a1ec5416c..57c54d094960b32d452048b72804ed5b3e87a53d 100644 (file)
@@ -9,41 +9,51 @@ class IPF_ORM_Pager_LayoutArrows extends IPF_ORM_Pager_Layout
 
         $range = $this->getPagerRange()->rangeAroundPage();
 
-               if ($pager->getFirstPage()!=$pager->getLastPage()){
-
-               $this->removeMaskReplacement('page');
-
-               if ($range[0]>1){
-
-                       $options['page_number'] = 1;
-                       $str .= $this->processPage($options);
-
-                               if ($range[0]>2){
-                               $options['page_number'] = 2;
-                               $str .= $this->processPage($options);
-                               }
-                               if ($range[0]>3)
-                               $str .= ' ... ';
-               }
-
-               // Pages listing
-               $str .= parent::display(&$options, true);
-               $last_range = $options['page_number'];
-               if (($last_range)<$pager->getLastPage()){
-
-                       if (($last_range+2)<$pager->getLastPage()){
-                               $str .= ' ... ';
-                       }
-                       if (($last_range+1)<$pager->getLastPage()){
-                               $options['page_number'] = $pager->getLastPage()-1;
-                               $str .= $this->processPage($options);
-                       }
-                       if (($last_range)<$pager->getLastPage()){
-                               $options['page_number'] = $pager->getLastPage();
-                               $str .= $this->processPage($options);
-                       }
-               }
-               }
+        if ($pager->getFirstPage() != $pager->getLastPage())
+        {
+            $this->removeMaskReplacement('page');
+
+            if ($range[0] > 1)
+            {
+                $options['page_number'] = 1;
+                $str .= $this->processPage($options);
+
+                if ($range[0] > 2)
+                {
+                    $options['page_number'] = 2;
+                    $str .= $this->processPage($options);
+                }
+
+                if ($range[0]>3)
+                    $str .= ' ... ';
+            }
+
+            // Pages listing
+            $str .= parent::display($options, true);
+
+            $range = $this->getPagerRange()->rangeAroundPage();
+            $last_range = $range[count($range)-1];
+
+            if ($last_range < $pager->getLastPage())
+            {
+                if ($last_range < $pager->getLastPage() - 2)
+                {
+                    $str .= ' ... ';
+                }
+
+                if ($last_range < $pager->getLastPage() - 1)
+                {
+                    $options['page_number'] = $pager->getLastPage() - 1;
+                    $str .= $this->processPage($options);
+                }
+
+                if ($last_range < $pager->getLastPage())
+                {
+                    $options['page_number'] = $pager->getLastPage();
+                    $str .= $this->processPage($options);
+                }
+            }
+        }
 
         if ($return)
             return $str;
@@ -51,3 +61,4 @@ class IPF_ORM_Pager_LayoutArrows extends IPF_ORM_Pager_Layout
         echo $str;
     }
 }
+