X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FBoundariesPager.php;h=df6ebf08a55387b7f3582bc3d28c40d047dd4b16;hb=8fd0d4cdc090dfdeeaf9beda8090c030d3f853c3;hp=da296bd8cc95bda3a7e9c22c2aa3752717d1fca0;hpb=e89e606b8827f6dc43f29db0965e27b12249d9dd;p=friendica.git diff --git a/src/Content/BoundariesPager.php b/src/Content/BoundariesPager.php index da296bd8cc..df6ebf08a5 100644 --- a/src/Content/BoundariesPager.php +++ b/src/Content/BoundariesPager.php @@ -1,6 +1,6 @@ first_item_id = $first_item_id; $this->last_item_id = $last_item_id; $parsed = parse_url($this->getBaseQueryString()); - if ($parsed) { + if (!empty($parsed['query'])) { parse_str($parsed['query'], $queryParameters); - $this->first_page = !($queryParameters['since_id'] ?? null) && !($queryParameters['max_id'] ?? null); + $this->first_page = !($queryParameters['min_id'] ?? null) && !($queryParameters['max_id'] ?? null); - unset($queryParameters['since_id']); + unset($queryParameters['min_id']); unset($queryParameters['max_id']); $parsed['query'] = http_build_query($queryParameters); @@ -71,12 +73,12 @@ class BoundariesPager extends Pager } } - public function getStart() + public function getStart(): int { throw new \BadMethodCallException(); } - public function getPage() + public function getPage(): int { throw new \BadMethodCallException(); } @@ -100,7 +102,7 @@ class BoundariesPager extends Pager * @return string HTML string of the pager * @throws \Exception */ - public function renderMinimal(int $itemCount) + public function renderMinimal(int $itemCount): string { $displayedItemCount = max(0, intval($itemCount)); @@ -109,17 +111,17 @@ class BoundariesPager extends Pager 'prev' => [ 'url' => Strings::ensureQueryParameter($this->baseQueryString . ($this->first_item_id >= $this->last_item_id ? - '&since_id=' . $this->first_item_id : '&max_id=' . $this->first_item_id) + '&min_id=' . $this->first_item_id : '&max_id=' . $this->first_item_id) ), - 'text' => DI::l10n()->t('newer'), + 'text' => $this->l10n->t('newer'), 'class' => 'previous' . ($this->first_page ? ' disabled' : '') ], 'next' => [ 'url' => Strings::ensureQueryParameter($this->baseQueryString . ($this->first_item_id >= $this->last_item_id ? - '&max_id=' . $this->last_item_id : '&since_id=' . $this->last_item_id) + '&max_id=' . $this->last_item_id : '&min_id=' . $this->last_item_id) ), - 'text' => DI::l10n()->t('older'), + 'text' => $this->l10n->t('older'), 'class' => 'next' . ($displayedItemCount < $this->getItemsPerPage() ? ' disabled' : '') ] ]; @@ -128,7 +130,10 @@ class BoundariesPager extends Pager return Renderer::replaceMacros($tpl, ['pager' => $data]); } - public function renderFull($itemCount) + /** + * Unsupported method, must be type-compatible + */ + public function renderFull(int $itemCount): string { throw new \BadMethodCallException(); }