The branch, master has been updated via 979209c4cc290349e4d0d850f542bad2a6faaf58 (commit) via 7cd68942577c1c6ad8403be72d6be24f7eeba036 (commit) from c6d007ed3ed73e7ce7ebc39f80cbfe2b0ce1f647 (commit)
- Log ----------------------------------------------------------------- commit 979209c4cc290349e4d0d850f542bad2a6faaf58 Author: Marc Delisle marc@infomarc.info Date: Sat Nov 12 10:18:35 2011 -0500
Code cleanup
commit 7cd68942577c1c6ad8403be72d6be24f7eeba036 Author: Thomas Hergenhahn thomas.hergenhahn@web.de Date: Sat Nov 12 10:15:12 2011 -0500
patch #3432835 [interface] Add useful intermediate pages to pageselector
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + libraries/common.lib.php | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog index b58121f..ee926f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,6 +58,7 @@ phpMyAdmin - ChangeLog - bug #3302419 [navi] Tabs break when squeezing page + rfe #3406797 [navi] Stick table tools to top of page on scroll + rfe #1632106 [interface] Improved error handling ++ patch #3432835 [interface] Add useful intermediate pages to pageselector
3.4.8.0 (not yet released) - bug #3425230 [interface] enum data split at space char (more space to edit) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index c1463bb..bb5c6e1 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2359,6 +2359,41 @@ function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1, } }
+/* + Add page numbers with "geometrically increasing" distances. + + This helps me a lot when navigating through giant tables. + + Test case: table with 2.28 million sets, 76190 pages. Page of interest is + between 72376 and 76190. + Selecting page 72376. + Now, old version enumerated only +/- 10 pages around 72376 and the + percentage increment produced steps of about 3000. + + The following code adds page numbers +/- 2,4,8,16,32,64,128,256 etc. + around the current page. +*/ + + $i = $pageNow; + $dist = 1; + while ($i < $x) { + $dist = 2 * $dist; + $i = $pageNow + $dist; + if ($i > 0 && $i <= $x) { + $pages[] = $i; + } + } + + $i = $pageNow; + $dist = 1; + while ($i >0) { + $dist = 2 * $dist; + $i = $pageNow - $dist; + if ($i > 0 && $i <= $x) { + $pages[] = $i; + } + } + // Since because of ellipsing of the current page some numbers may be double, // we unify our array: sort($pages);
hooks/post-receive