Merge branch 'maint/7.0'
[ninja.git] / system / views / pagination / digg.php
blob0e065a6f0172332d15d0c27f457c3e7ad1922ade
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * Digg pagination style
4 *
5 * @preview « Previous 1 2 … 5 6 7 8 9 10 11 12 13 14 … 25 26 Next »
6 */
7 ?>
9 <p class="pagination">
11 <?php if ($previous_page): ?>
12 <a href="<?php echo str_replace('{page}', $previous_page, $url) ?>">&laquo;&nbsp;<?php echo Kohana::lang('pagination.previous') ?></a>
13 <?php else: ?>
14 &laquo;&nbsp;<?php echo Kohana::lang('pagination.previous') ?>
15 <?php endif ?>
18 <?php if ($total_pages < 13): /* « Previous 1 2 3 4 5 6 7 8 9 10 11 12 Next » */ ?>
20 <?php for ($i = 1; $i <= $total_pages; $i++): ?>
21 <?php if ($i == $current_page): ?>
22 <strong><?php echo $i ?></strong>
23 <?php else: ?>
24 <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
25 <?php endif ?>
26 <?php endfor ?>
28 <?php elseif ($current_page < 9): /* « Previous 1 2 3 4 5 6 7 8 9 10 … 25 26 Next » */ ?>
30 <?php for ($i = 1; $i <= 10; $i++): ?>
31 <?php if ($i == $current_page): ?>
32 <strong><?php echo $i ?></strong>
33 <?php else: ?>
34 <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
35 <?php endif ?>
36 <?php endfor ?>
38 &hellip;
39 <a href="<?php echo str_replace('{page}', $total_pages - 1, $url) ?>"><?php echo $total_pages - 1 ?></a>
40 <a href="<?php echo str_replace('{page}', $total_pages, $url) ?>"><?php echo $total_pages ?></a>
42 <?php elseif ($current_page > $total_pages - 8): /* « Previous 1 2 … 17 18 19 20 21 22 23 24 25 26 Next » */ ?>
44 <a href="<?php echo str_replace('{page}', 1, $url) ?>">1</a>
45 <a href="<?php echo str_replace('{page}', 2, $url) ?>">2</a>
46 &hellip;
48 <?php for ($i = $total_pages - 9; $i <= $total_pages; $i++): ?>
49 <?php if ($i == $current_page): ?>
50 <strong><?php echo $i ?></strong>
51 <?php else: ?>
52 <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
53 <?php endif ?>
54 <?php endfor ?>
56 <?php else: /* « Previous 1 2 … 5 6 7 8 9 10 11 12 13 14 … 25 26 Next » */ ?>
58 <a href="<?php echo str_replace('{page}', 1, $url) ?>">1</a>
59 <a href="<?php echo str_replace('{page}', 2, $url) ?>">2</a>
60 &hellip;
62 <?php for ($i = $current_page - 5; $i <= $current_page + 5; $i++): ?>
63 <?php if ($i == $current_page): ?>
64 <strong><?php echo $i ?></strong>
65 <?php else: ?>
66 <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
67 <?php endif ?>
68 <?php endfor ?>
70 &hellip;
71 <a href="<?php echo str_replace('{page}', $total_pages - 1, $url) ?>"><?php echo $total_pages - 1 ?></a>
72 <a href="<?php echo str_replace('{page}', $total_pages, $url) ?>"><?php echo $total_pages ?></a>
74 <?php endif ?>
77 <?php if ($next_page): ?>
78 <a href="<?php echo str_replace('{page}', $next_page, $url) ?>"><?php echo Kohana::lang('pagination.next') ?>&nbsp;&raquo;</a>
79 <?php else: ?>
80 <?php echo Kohana::lang('pagination.next') ?>&nbsp;&raquo;
81 <?php endif ?>
83 </p>