mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-12-02 13:32:43 -05:00
Fix the paging bug noticed in #9544. In the HTML view of a shared user query, the pagination links did not include the `search` parameter, so the user search was lost when going to the next page. The pagination links now keep the user search (URL-encoded). The common part of the URLs is factored out, using `&` consistently. Tested locally with a shared query of 60 entries and `search=x`: the second page now only shows matching entries.
25 lines
918 B
PHTML
25 lines
918 B
PHTML
<?php
|
||
declare(strict_types=1);
|
||
/** @var FreshRSS_View $this */
|
||
$url = $this->userQuery->sharedUrlHtml() . '&nb=' . FreshRSS_Context::$number;
|
||
$search = FreshRSS_Context::$search->toString();
|
||
if ($search !== '') {
|
||
$url .= '&search=' . rawurlencode($search);
|
||
}
|
||
?>
|
||
<nav class="nav-pagination nav-list">
|
||
<ul class="pagination">
|
||
<?php if (FreshRSS_Context::$offset > 0): ?>
|
||
<li class="item pager-first">
|
||
<a href="<?= $url ?>">« <?= _t('conf.logs.pagination.first') ?></a>
|
||
</li>
|
||
<li class="item pager-previous">
|
||
<a href="<?= $url . '&offset=' . max(0, FreshRSS_Context::$offset - FreshRSS_Context::$number) ?>">‹ <?= _t('conf.logs.pagination.previous') ?></a>
|
||
</li>
|
||
<?php endif; ?>
|
||
<li class="item pager-next">
|
||
<a href="<?= $url . '&offset=' . (FreshRSS_Context::$offset + FreshRSS_Context::$number) ?>"><?= _t('conf.logs.pagination.next') ?> ›</a>
|
||
</li>
|
||
</ul>
|
||
</nav>
|