mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 12:34:39 +02:00
Simplify pagination generation
This commit is contained in:
parent
95b3322731
commit
df7c3a6566
1 changed files with 1 additions and 17 deletions
|
@ -208,7 +208,7 @@ class Pager
|
|||
'class' => $this->getPage() == 1 ? 'disabled' : ''
|
||||
];
|
||||
|
||||
$numpages = $totalItemCount / $this->getItemsPerPage();
|
||||
$numpages = (int) ceil($totalItemCount / $this->getItemsPerPage());
|
||||
|
||||
$numstart = 1;
|
||||
$numstop = $numpages;
|
||||
|
@ -237,22 +237,6 @@ class Pager
|
|||
}
|
||||
}
|
||||
|
||||
if (($totalItemCount % $this->getItemsPerPage()) != 0) {
|
||||
if ($i == $this->getPage()) {
|
||||
$pages[$i] = [
|
||||
'url' => '#',
|
||||
'text' => $i,
|
||||
'class' => 'current active'
|
||||
];
|
||||
} else {
|
||||
$pages[$i] = [
|
||||
'url' => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . $i),
|
||||
'text' => $i,
|
||||
'class' => 'n'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$data['pages'] = $pages;
|
||||
|
||||
$lastpage = (($numpages > intval($numpages)) ? intval($numpages)+1 : $numpages);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue