[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/layouts/joomla/pagination/ -> link.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  Layout
   6   *
   7   * @copyright   (C) 2014 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  
  16  $item    = $displayData['data'];
  17  $display = $item->text;
  18  $app = Factory::getApplication();
  19  
  20  switch ((string) $item->text) {
  21      // Check for "Start" item
  22      case Text::_('JLIB_HTML_START'):
  23          $icon = $app->getLanguage()->isRtl() ? 'icon-angle-double-right' : 'icon-angle-double-left';
  24          $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
  25          break;
  26  
  27      // Check for "Prev" item
  28      case $item->text === Text::_('JPREV'):
  29          $item->text = Text::_('JPREVIOUS');
  30          $icon = $app->getLanguage()->isRtl() ? 'icon-angle-right' : 'icon-angle-left';
  31          $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
  32          break;
  33  
  34      // Check for "Next" item
  35      case Text::_('JNEXT'):
  36          $icon = $app->getLanguage()->isRtl() ? 'icon-angle-left' : 'icon-angle-right';
  37          $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
  38          break;
  39  
  40      // Check for "End" item
  41      case Text::_('JLIB_HTML_END'):
  42          $icon = $app->getLanguage()->isRtl() ? 'icon-angle-double-left' : 'icon-angle-double-right';
  43          $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text));
  44          break;
  45  
  46      default:
  47          $icon = null;
  48          $aria = Text::sprintf('JLIB_HTML_GOTO_PAGE', strtolower($item->text));
  49          break;
  50  }
  51  
  52  if ($icon !== null) {
  53      $display = '<span class="' . $icon . '" aria-hidden="true"></span>';
  54  }
  55  
  56  if ($displayData['active']) {
  57      if ($item->base > 0) {
  58          $limit = 'limitstart.value=' . $item->base;
  59      } else {
  60          $limit = 'limitstart.value=0';
  61      }
  62  
  63      $class = 'active';
  64  
  65      if ($app->isClient('administrator')) {
  66          $link = 'href="#" onclick="document.adminForm.' . $item->prefix . $limit . '; Joomla.submitform();return false;"';
  67      } elseif ($app->isClient('site')) {
  68          $link = 'href="' . $item->link . '"';
  69      }
  70  } else {
  71      $class = (property_exists($item, 'active') && $item->active) ? 'active' : 'disabled';
  72  }
  73  
  74  ?>
  75  <?php if ($displayData['active']) : ?>
  76      <li class="page-item">
  77          <a aria-label="<?php echo $aria; ?>" <?php echo $link; ?> class="page-link">
  78              <?php echo $display; ?>
  79          </a>
  80      </li>
  81  <?php elseif (isset($item->active) && $item->active) : ?>
  82      <?php $aria = Text::sprintf('JLIB_HTML_PAGE_CURRENT', strtolower($item->text)); ?>
  83      <li class="<?php echo $class; ?> page-item">
  84          <a aria-current="true" aria-label="<?php echo $aria; ?>" href="#" class="page-link"><?php echo $display; ?></a>
  85      </li>
  86  <?php else : ?>
  87      <li class="<?php echo $class; ?> page-item">
  88          <span class="page-link" aria-hidden="true"><?php echo $display; ?></span>
  89      </li>
  90  <?php endif; ?>


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