xref: /webtrees/resources/views/modules/media-list/pagination.phtml (revision 52288ec72a577b9a3a455ccc0f26d11b0df31667)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Module\ModuleListInterface;
7use Fisharebest\Webtrees\Tree;
8
9/**
10 * @var string              $filter
11 * @var string              $folder
12 * @var string              $format
13 * @var int                 $max
14 * @var ModuleListInterface $module
15 * @var int                 $page
16 * @var int                 $pages
17 * @var string              $subdirs
18 * @var Tree                $tree
19 */
20
21?>
22
23<div class="row text-center">
24    <div class="col">
25        <?php if ($page > 1) : ?>
26            <a class="btn btn-outline-secondary" href="<?= e($module->listUrl($tree, ['go' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'format' => $format, 'max' => $max, 'page' => 1])) ?>">
27                <?= I18N::translate('first') ?>
28            </a>
29        <?php endif ?>
30    </div>
31
32    <div class="col">
33        <?php if ($page > 1) : ?>
34            <a class="btn btn-outline-secondary" href="<?= e($module->listUrl($tree, ['go' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'format' => $format, 'max' => $max, 'page' => $page - 1])) ?>">
35                <?= I18N::translate('previous') ?>
36            </a>
37        <?php endif ?>
38    </div>
39
40    <div class="col">
41        <?= I18N::translate('Page %s of %s', I18N::number($page), I18N::number($pages)) ?>
42    </div>
43
44    <div class="col">
45        <?php if ($page < $pages) : ?>
46            <a class="btn btn-outline-secondary" href="<?= e($module->listUrl($tree, ['go' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'format' => $format, 'max' => $max, 'page' => $page + 1])) ?>">
47                <?= I18N::translate('next') ?>
48            </a>
49        <?php endif ?>
50    </div>
51
52    <div class="col">
53        <?php if ($page < $pages) : ?>
54            <a class="btn btn-outline-secondary" href="<?= e($module->listUrl($tree, ['go' => '1', 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'format' => $format, 'max' => $max, 'page' => $pages])) ?>">
55                <?= I18N::translate('last') ?>
56            </a>
57        <?php endif ?>
58    </div>
59</div>
60