Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Usability: Back-end - Add total number of items to Page Navigation #43570

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions administrator/language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ JGLOBAL_INHERIT="Inherit"
JGLOBAL_INTEGRATION_LABEL="Integration"
JGLOBAL_INTRO_TEXT="Intro Text"
JGLOBAL_ISFREESOFTWARE="%s is free software released under the <a href=\"https://www.gnu.org/licenses/gpl-2.0.html\" target=\"_blank\" rel=\"noopener noreferrer\">GNU General Public License</a>."
JGLOBAL_ITEM_COUNT="%d Items"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to handle when there is only one item.

JGLOBAL_ITEM_FEATURE="Feature Item"
JGLOBAL_ITEM_UNFEATURE="Unfeature Item"
JGLOBAL_JOOA11Y="Accessibility Check"
Expand Down
1 change: 1 addition & 0 deletions api/language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ JGLOBAL_INHERIT="Inherit"
JGLOBAL_INTEGRATION_LABEL="Integration"
JGLOBAL_INTRO_TEXT="Intro Text"
JGLOBAL_ISFREESOFTWARE="%s is free software released under the <a href=\"https://www.gnu.org/licenses/gpl-2.0.html\" target=\"_blank\" rel=\"noopener noreferrer\">GNU General Public License</a>."
JGLOBAL_ITEM_COUNT="%d Items"
JGLOBAL_ITEM_FEATURE="Feature Item"
JGLOBAL_ITEM_UNFEATURE="Unfeature Item"
JGLOBAL_JOOA11Y="Accessibility Check"
Expand Down
1 change: 1 addition & 0 deletions language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ JGLOBAL_HITS_DESC="Hits descending"
JGLOBAL_ICON_SEP="|"
JGLOBAL_INHERIT="Inherit"
JGLOBAL_INTRO_TEXT="Intro Text"
JGLOBAL_ITEM_COUNT="%d Items"
JGLOBAL_JOOA11Y="Accessibility Check"
JGLOBAL_KEEP_TYPING="Keep typing &hellip;"
JGLOBAL_LEARN_MORE="Learn More"
Expand Down
66 changes: 33 additions & 33 deletions layouts/joomla/pagination/links.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

$list = $displayData['list'];
$pages = $list['pages'];
$total = $list['total'];

$options = new Registry($displayData['options']);

Expand Down Expand Up @@ -45,40 +46,39 @@
}
?>


<?php if (!empty($pages)) : ?>
<nav class="pagination__wrapper" aria-label="<?php echo Text::_('JLIB_HTML_PAGINATION'); ?>">
<div class="pagination pagination-toolbar text-center">

<?php if ($showLimitBox) : ?>
<div class="limit float-end">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM') . $list['limitfield']; ?>
</div>
<?php endif; ?>

<?php if ($showPagesLinks) : ?>
<ul class="pagination ms-auto mb-4 me-0">
<?php echo LayoutHelper::render('joomla.pagination.link', $pages['start']); ?>
<?php echo LayoutHelper::render('joomla.pagination.link', $pages['previous']); ?>
<?php foreach ($pages['pages'] as $k => $page) : ?>
<?php $output = LayoutHelper::render('joomla.pagination.link', $page); ?>
<?php if (in_array($k, range($range * $step - ($step + 1), $range * $step), true)) : ?>
<?php if (($k % $step === 0 || $k === $range * $step - ($step + 1)) && $k !== $currentPage && $k !== $range * $step - $step) : ?>
<?php $output = preg_replace('#(<a.*?>).*?(</a>)#', '$1...$2', $output); ?>
<?php endif; ?>
<nav class="pagination__wrapper" aria-label="<?php echo Text::_('JLIB_HTML_PAGINATION'); ?>">
<div class="text-end me-3">
<?php echo Text::sprintf('JGLOBAL_ITEM_COUNT', $total); ?>
</div>
<div class="pagination pagination-toolbar text-center mt-0">
<?php if ($showLimitBox) : ?>
<div class="limit float-end">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM') . $list['limitfield']; ?>
</div>
<?php endif; ?>

<?php if ($showPagesLinks && (!empty($pages))): ?>
brianteeman marked this conversation as resolved.
Show resolved Hide resolved
<ul class="pagination ms-auto me-0">
<?php echo LayoutHelper::render('joomla.pagination.link', $pages['start']); ?>
<?php echo LayoutHelper::render('joomla.pagination.link', $pages['previous']); ?>
<?php foreach ($pages['pages'] as $k => $page) : ?>
<?php $output = LayoutHelper::render('joomla.pagination.link', $page); ?>
<?php if (in_array($k, range($range * $step - ($step + 1), $range * $step), true)) : ?>
<?php if (($k % $step === 0 || $k === $range * $step - ($step + 1)) && $k !== $currentPage && $k !== $range * $step - $step) : ?>
<?php $output = preg_replace('#(<a.*?>).*?(</a>)#', '$1...$2', $output); ?>
<?php endif; ?>
<?php endif; ?>

<?php echo $output; ?>
<?php endforeach; ?>
<?php echo LayoutHelper::render('joomla.pagination.link', $pages['next']); ?>
<?php echo LayoutHelper::render('joomla.pagination.link', $pages['end']); ?>
</ul>
<?php endif; ?>
<?php echo $output; ?>
<?php endforeach; ?>
<?php echo LayoutHelper::render('joomla.pagination.link', $pages['next']); ?>
<?php echo LayoutHelper::render('joomla.pagination.link', $pages['end']); ?>
</ul>
<?php endif; ?>

<?php if ($showLimitStart) : ?>
<input type="hidden" name="<?php echo $list['prefix']; ?>limitstart" value="<?php echo $list['limitstart']; ?>">
<?php endif; ?>
<?php if ($showLimitStart) : ?>
<input type="hidden" name="<?php echo $list['prefix']; ?>limitstart" value="<?php echo $list['limitstart']; ?>">
<?php endif; ?>
</div>
</nav>

</div>
</nav>
<?php endif; ?>