Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(ui): replace the lastPage array with a string for the pagination …
Browse files Browse the repository at this point in the history
…filters
  • Loading branch information
sc979 committed Apr 1, 2019
1 parent 044c810 commit 2e84ae5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions www/include/common/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@
$type = $_REQUEST["type"] ?? null;
$o = $_GET["o"] ?? $o = null;

// splitting the path ($url) to keep only the current page's filename
$currentPage = (explode('/', $url));

if (isset($centreon->historyLastPage) && $centreon->historyLastPage !== $currentPage) {
// checking if the current page and the last displayed page are the same
if (isset($centreon->historyLastPage) && $centreon->historyLastPage !== $url) {
$num = 0;
} elseif (isset($_REQUEST['num'])) {
$num = filter_var(
Expand All @@ -59,10 +57,9 @@
$num = $centreon->historyPage[$url] ?? 0;
}

//saving current pagination filter value
//saving current pagination filter value and current displayed page
$centreon->historyPage[$url] = $num;
//saving current page's file name
$centreon->historyLastPage = $currentPage;
$centreon->historyLastPage = $url;

$num = addslashes($num);

Expand Down

0 comments on commit 2e84ae5

Please sign in to comment.