|
16 | 16 |
|
17 | 17 | $list = $displayData['list']; |
18 | 18 | $pages = $list['pages']; |
| 19 | +$total = $list['total']; |
19 | 20 |
|
20 | 21 | $options = new Registry($displayData['options']); |
21 | 22 |
|
22 | | -$showLimitBox = $options->get('showLimitBox', false); |
23 | | -$showPagesLinks = $options->get('showPagesLinks', true); |
24 | | -$showLimitStart = $options->get('showLimitStart', true); |
| 23 | +$showLimitBox = $options->get('showLimitBox', false); |
| 24 | +$showPagesLinks = $options->get('showPagesLinks', true); |
| 25 | +$showLimitStart = $options->get('showLimitStart', true); |
| 26 | +$showItemPosition = $options->get('showItemPosition', true); |
25 | 27 |
|
26 | 28 | // Calculate to display range of pages |
27 | 29 | $currentPage = 1; |
|
43 | 45 | $range = ceil($currentPage / $step); |
44 | 46 | } |
45 | 47 | } |
46 | | -?> |
47 | | - |
| 48 | +$first = ($currentPage - 1) * $list['limit'] + 1; |
| 49 | +$last = $first + $list['limit'] - 1; |
| 50 | +$last = $last > $total ? $total : $last; |
48 | 51 |
|
49 | | -<?php if (!empty($pages)) : ?> |
| 52 | +?> |
| 53 | +<?php if (!empty($pages) || $showItemPosition) : ?> |
50 | 54 | <nav class="pagination__wrapper" aria-label="<?php echo Text::_('JLIB_HTML_PAGINATION'); ?>"> |
51 | | - <div class="pagination pagination-toolbar text-center"> |
| 55 | + <?php if ($showItemPosition) : ?> |
| 56 | + <div class="text-end me-3"> |
| 57 | + <?php echo Text::sprintf('JLIB_HTML_PAGINATION_NUMBERS', $first, $last, $total); ?> |
| 58 | + </div> |
| 59 | + <?php endif; ?> |
| 60 | + |
| 61 | + <div class="pagination pagination-toolbar text-center mt-0"> |
52 | 62 |
|
53 | 63 | <?php if ($showLimitBox) : ?> |
54 | 64 | <div class="limit float-end"> |
55 | 65 | <?php echo Text::_('JGLOBAL_DISPLAY_NUM') . $list['limitfield']; ?> |
56 | 66 | </div> |
57 | 67 | <?php endif; ?> |
58 | 68 |
|
59 | | - <?php if ($showPagesLinks) : ?> |
60 | | - <ul class="pagination ms-auto mb-4 me-0"> |
| 69 | + <?php if ($showPagesLinks && !empty($pages)) : ?> |
| 70 | + <ul class="pagination ms-auto me-0"> |
61 | 71 | <?php echo LayoutHelper::render('joomla.pagination.link', $pages['start']); ?> |
62 | 72 | <?php echo LayoutHelper::render('joomla.pagination.link', $pages['previous']); ?> |
63 | 73 | <?php foreach ($pages['pages'] as $k => $page) : ?> |
|
0 commit comments