mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Prevent duplicate sort, order and page GET VARs in the URL when Clicking to Sort a field or Clicking a page number. We now unset the GET VAR arrays before recreating the URL GET Strings
This commit is contained in:
@@ -58,12 +58,16 @@ if ($total_found_rows > 10) {
|
||||
} else {
|
||||
$next_class = "disabled";
|
||||
}
|
||||
$url_query_strings = http_build_query(array_merge($_GET, array('page' => $i)));
|
||||
$get_copy = $_GET; // create a copy of the $_GET array
|
||||
//unset($get_copy['page']);
|
||||
// Unset Array Var to prevent Duplicate Get VARs
|
||||
unset($get_copy['page']);
|
||||
$url_query_strings_page = http_build_query($get_copy);
|
||||
$prev_page = $page - 1;
|
||||
$next_page = $page + 1;
|
||||
|
||||
if ($page > 1) {
|
||||
echo "<li class='page-item $prev_class'><a class='page-link' href='?$url_query_strings&page=$prev_page'>Prev</a></li>";
|
||||
echo "<li class='page-item $prev_class'><a class='page-link' href='?$url_query_strings_page&page=$prev_page'>Prev</a></li>";
|
||||
}
|
||||
|
||||
while ($i < $total_pages) {
|
||||
@@ -74,12 +78,12 @@ if ($total_found_rows > 10) {
|
||||
} else {
|
||||
$page_class = "";
|
||||
}
|
||||
echo "<li class='page-item $page_class'><a class='page-link' href='?$url_query_strings&page=$i'>$i</a></li>";
|
||||
echo "<li class='page-item $page_class'><a class='page-link' href='?$url_query_strings_page&page=$i'>$i</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($page <> $total_pages) {
|
||||
echo "<li class='page-item $next_class'><a class='page-link' href='?$url_query_strings&page=$next_page'>Next</a></li>";
|
||||
echo "<li class='page-item $next_class'><a class='page-link' href='?$url_query_strings_page&page=$next_page'>Next</a></li>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user