[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/plugins/content/pagebreak/tmpl/ -> navigation.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Plugin
   5   * @subpackage  Content.pagebreak
   6   *
   7   * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Factory;
  14  use Joomla\CMS\Language\Text;
  15  use Joomla\CMS\Router\Route;
  16  
  17  /**
  18   * @var $links   array    Array with keys 'previous' and 'next' with non-SEO links to the previous and next pages
  19   * @var $page    integer  The page number
  20   */
  21  
  22  $lang = Factory::getLanguage();
  23  ?>
  24  <ul class="pagination">
  25      <li class="previous page-item">
  26          <?php if ($links['previous']) :
  27              $direction = $lang->isRtl() ? 'right' : 'left';
  28              $title = htmlspecialchars($this->list[$page]->title, ENT_QUOTES, 'UTF-8');
  29              $ariaLabel = Text::_('JPREVIOUS') . ': ' . $title . ' (' . Text::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', $page, $n) . ')';
  30              ?>
  31          <a class="page-link" href="<?php echo Route::_($links['previous']); ?>" title="<?php echo $title; ?>" aria-label="<?php echo $ariaLabel; ?>" rel="prev">
  32              <?php echo '<span class="icon-chevron-' . $direction . '" aria-hidden="true"></span> ' . Text::_('JPREV'); ?>
  33          </a>
  34          <?php endif; ?>
  35      </li>
  36      <li class="next page-item">
  37          <?php if ($links['next']) :
  38              $direction = $lang->isRtl() ? 'left' : 'right';
  39              $title = htmlspecialchars($this->list[$page + 2]->title, ENT_QUOTES, 'UTF-8');
  40              $ariaLabel = Text::_('JNEXT') . ': ' . $title . ' (' . Text::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', ($page + 2), $n) . ')';
  41              ?>
  42          <a class="page-link" href="<?php echo Route::_($links['next']); ?>" title="<?php echo $title; ?>" aria-label="<?php echo $ariaLabel; ?>" rel="next">
  43              <?php echo Text::_('JNEXT') . ' <span class="icon-chevron-' . $direction . '" aria-hidden="true"></span>'; ?>
  44          </a>
  45          <?php endif; ?>
  46      </li>
  47  </ul>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer