aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers/logs_pagination.phtml
blob: c7b9ca0ca3e93a5b75146588a60dc69c41f4ce0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
	/** @var FreshRSS_View $this */
	$c = Minz_Request::controllerName();
	$a = Minz_Request::actionName();
	$params = $_GET;
?>

<?php if ($this->nbPage > 1) { ?>
<nav class="nav-pagination nav-list">
	<ul class="pagination">
		<?php
			/** @var int $getteur */
			$params[$getteur] = 1;
		?>
		<li class="item pager-first">
			<a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">« <?= _t('conf.logs.pagination.first') ?></a>
		</li>

		<?php $params[$getteur] = $this->currentPage - 1; ?>

		
		<li class="item pager-previous">
			<?php if ($this->currentPage > 1) { ?>
			<a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">‹ <?= _t('conf.logs.pagination.previous') ?></a>
			<?php } ?>
		</li>
		

		<?php if ($this->currentPage - 2 > 1) { ?>
		<li class="item">…</a></li>
		<?php } ?>

		<?php
		for ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) {
			if($i > 0 && $i <= $this->nbPage) {
				$params[$getteur] = $i;
				if ($i != $this->currentPage) {
					$class = '';
					$aria = 'false';
				} else {
					$class = ' active';
					$aria = 'true';
				} ?>
				<li class="item<?= $class ?>"><a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>" aria-current="<?= $aria ?>"><?= $i ?></a></li>
			<?php
			}
		} ?>

		<?php if ($this->nbPage > $i - 1) { ?>
		<li class="item">…</a></li>
		<?php } ?>

		<?php $params[$getteur] = $this->currentPage + 1; ?>
		
		<li class="item pager-next">
			<?php if ($this->currentPage < $this->nbPage) { ?>
			<a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('conf.logs.pagination.next') ?> ›</a>
			<?php } ?>
		</li>
		
		<?php $params[$getteur] = $this->nbPage; ?>
		<li class="item pager-last">
			<a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('conf.logs.pagination.last') ?> »</a>
		</li>
	</ul>
</nav>
<?php } ?>