summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/web/src/Control
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/ipl/web/src/Control/LimitControl.php6
-rw-r--r--vendor/ipl/web/src/Control/PaginationControl.php9
2 files changed, 11 insertions, 4 deletions
diff --git a/vendor/ipl/web/src/Control/LimitControl.php b/vendor/ipl/web/src/Control/LimitControl.php
index b390a0a..376d6be 100644
--- a/vendor/ipl/web/src/Control/LimitControl.php
+++ b/vendor/ipl/web/src/Control/LimitControl.php
@@ -119,5 +119,11 @@ class LimitControl extends CompatForm
'title' => t('Change item count per page'),
'value' => $limit
]);
+
+ if ($this->url->hasParam(PaginationControl::DEFAULT_PAGE_PARAM)) {
+ $this->addElement('hidden', PaginationControl::DEFAULT_PAGE_PARAM, [
+ 'value' => 1
+ ]);
+ }
}
}
diff --git a/vendor/ipl/web/src/Control/PaginationControl.php b/vendor/ipl/web/src/Control/PaginationControl.php
index 00f5c20..e704829 100644
--- a/vendor/ipl/web/src/Control/PaginationControl.php
+++ b/vendor/ipl/web/src/Control/PaginationControl.php
@@ -17,6 +17,9 @@ use ipl\Web\Widget\Icon;
*/
class PaginationControl extends BaseHtmlElement
{
+ /** @var string Default page parameter */
+ public const DEFAULT_PAGE_PARAM = 'page';
+
/** @var int Default maximum number of items which should be shown per page */
protected $defaultPageSize;
@@ -467,10 +470,8 @@ class PaginationControl extends BaseHtmlElement
'title' => t('Go to page …')
]);
- if (isset($currentPageNumber)) {
- if ($currentPageNumber === 1 || $currentPageNumber === $this->getPageCount()) {
- $select->add(Html::tag('option', ['disabled' => '', 'selected' => ''], '…'));
- }
+ if ($currentPageNumber === 1 || $currentPageNumber === $this->getPageCount()) {
+ $select->add(Html::tag('option', ['disabled' => '', 'selected' => ''], '…'));
}
foreach (range(2, $this->getPageCount() - 1) as $page) {