]> git.joonet.de Git - adminer.git/commitdiff
Move pagination to fieldset
authorJakub Vrana <jakub@vrana.cz>
Tue, 13 Feb 2018 21:17:59 +0000 (22:17 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 13 Feb 2018 21:17:59 +0000 (22:17 +0100)
adminer/select.inc.php

index 2f2ad0e97cbbe9ef9ea6480d33985a6de20814d2..eeb994f015617d06a602ed592a2f49ceb787e504 100644 (file)
@@ -478,15 +478,28 @@ if (!$columns && support("table")) {
                                        }
                                }
 
-                               if ($limit != "" && ($found_rows === false || $found_rows > $limit || $page)) {
-                                       echo "<p>\n";
+                               $pagination = ($limit != "" && ($found_rows === false || $found_rows > $limit || $page));
+                               if ($pagination) {
+                                       echo (($found_rows === false ? count($rows) + 1 : $found_rows - $page * $limit) > $limit
+                                               ? '<p><a href="' . h(remove_from_uri("page") . "&page=" . ($page + 1)) . '" class="loadmore">' . lang('Load more data') . '</a>'
+                                                       . script("qsl('a').onclick = partial(selectLoadMore, " . (+$limit) . ", '" . lang('Loading') . "...');", "")
+                                               : ''
+                                       );
+                                       echo "\n";
+                               }
+                       }
+                       
+                       echo "<div class='footer'><div>\n";
+                       if ($rows || $page) {
+                               if ($pagination) {
                                        // display first, previous 4, next 4 and last page
                                        $max_page = ($found_rows === false
                                                ? $page + (count($rows) >= $limit ? 2 : 1)
                                                : floor(($found_rows - 1) / $limit)
                                        );
+                                       echo "<fieldset>";
                                        if ($jush != "simpledb") {
-                                               echo '<a href="' . h(remove_from_uri("page")) . '">' . lang('Page') . "</a>:";
+                                               echo "<legend><a href='" . h(remove_from_uri("page")) . "'>" . lang('Page') . "</a></legend>";
                                                echo script("qsl('a').onclick = function () { pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "')); return false; };");
                                                echo pagination(0, $page) . ($page > 5 ? " ..." : "");
                                                for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
@@ -499,23 +512,15 @@ if (!$columns && support("table")) {
                                                                : " <a href='" . h(remove_from_uri("page") . "&page=last") . "' title='~$max_page'>" . lang('last') . "</a>"
                                                        );
                                                }
-                                               echo (($found_rows === false ? count($rows) + 1 : $found_rows - $page * $limit) > $limit
-                                                       ? ' <a href="' . h(remove_from_uri("page") . "&page=" . ($page + 1)) . '" class="loadmore">' . lang('Load more data') . '</a>'
-                                                               . script("qsl('a').onclick = partial(selectLoadMore, " . (+$limit) . ", '" . lang('Loading') . "...');", "")
-                                                       : ''
-                                               );
                                        } else {
-                                               echo lang('Page') . ":";
+                                               echo "<legend>" . lang('Page') . "</legend>";
                                                echo pagination(0, $page) . ($page > 1 ? " ..." : "");
                                                echo ($page ? pagination($page, $page) : "");
                                                echo ($max_page > $page ? pagination($page + 1, $page) . ($max_page > $page + 1 ? " ..." : "") : "");
                                        }
-                                       echo "\n";
+                                       echo "</fieldset>\n";
                                }
-                       }
-                       
-                       echo "<div class='footer'><div>\n";
-                       if ($rows || $page) {
+                               
                                echo "<fieldset>";
                                echo "<legend>" . lang('Whole result') . "</legend>";
                                $display_rows = ($exact_count ? "" : "~ ") . $found_rows;