Let pagination function return
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@830 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
791ea4ff61
commit
c565c5453c
|
@ -134,8 +134,8 @@ function remove_from_uri($param = "") {
|
||||||
return preg_replace("~\\?$param=[^&]*&~", '?', preg_replace("~\\?$param=[^&]*\$|&$param=[^&]*~", '', $_SERVER["REQUEST_URI"]));
|
return preg_replace("~\\?$param=[^&]*&~", '?', preg_replace("~\\?$param=[^&]*\$|&$param=[^&]*~", '', $_SERVER["REQUEST_URI"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
function print_pagination($page) {
|
function pagination($page) {
|
||||||
echo " " . ($page == $_GET["page"] ? $page + 1 : '<a href="' . htmlspecialchars(remove_from_uri("page") . ($page ? "&page=$page" : "")) . '">' . ($page + 1) . "</a>");
|
return " " . ($page == $_GET["page"] ? $page + 1 : '<a href="' . htmlspecialchars(remove_from_uri("page") . ($page ? "&page=$page" : "")) . '">' . ($page + 1) . "</a>");
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_file($key) {
|
function get_file($key) {
|
||||||
|
|
|
@ -335,18 +335,11 @@ if (!$columns) {
|
||||||
if (intval($limit) && $found_rows > $limit) {
|
if (intval($limit) && $found_rows > $limit) {
|
||||||
// display first, previous 3, next 3 and last page
|
// display first, previous 3, next 3 and last page
|
||||||
$max_page = floor(($found_rows - 1) / $limit);
|
$max_page = floor(($found_rows - 1) / $limit);
|
||||||
echo lang('Page') . ":";
|
echo lang('Page') . ":" . pagination(0) . ($_GET["page"] > 3 ? " ..." : "");
|
||||||
print_pagination(0);
|
|
||||||
if ($_GET["page"] > 3) {
|
|
||||||
echo " ...";
|
|
||||||
}
|
|
||||||
for ($i = max(1, $_GET["page"] - 2); $i < min($max_page, $_GET["page"] + 3); $i++) {
|
for ($i = max(1, $_GET["page"] - 2); $i < min($max_page, $_GET["page"] + 3); $i++) {
|
||||||
print_pagination($i);
|
echo pagination($i);
|
||||||
}
|
}
|
||||||
if ($_GET["page"] + 3 < $max_page) {
|
echo ($_GET["page"] + 3 < $max_page ? " ..." : "") . pagination($max_page);
|
||||||
echo " ...";
|
|
||||||
}
|
|
||||||
print_pagination($max_page);
|
|
||||||
}
|
}
|
||||||
echo " (" . lang('%d row(s)', $found_rows) . ') <label><input type="checkbox" name="all" value="1">' . lang('whole result') . "</label>\n";
|
echo " (" . lang('%d row(s)', $found_rows) . ') <label><input type="checkbox" name="all" value="1">' . lang('whole result') . "</label>\n";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue