[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/layouts/joomla/searchtools/grid/ -> sort.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  Layout
   6   *
   7   * @copyright   (C) 2013 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\Language\Text;
  14  
  15  $data = $displayData;
  16  $icon = 'icon-sort';
  17  $sort = '';
  18  $caption = '';
  19  $selected = '';
  20  $id = '';
  21  
  22  if ($data->order === $data->selected) :
  23      $icon = $data->orderIcon;
  24      $sort = $data->direction === 'asc' ? 'descending' : 'ascending';
  25      $heading = !empty($data->title) ? Text::_($data->title) : Text::_('JGRID_HEADING_ORDERING');
  26      $caption = Text::sprintf('JGRID_HEADING_CAPTION_' . $data->direction, $heading);
  27      $selected = ' selected';
  28      $id = 'id="sorted"';
  29  endif;
  30  ?>
  31  
  32  <a href="" onclick="return false;" class="js-stools-column-order<?php echo $selected; ?> js-stools-button-sort"
  33      <?php echo $id; ?>
  34      data-order="<?php echo $data->order; ?>"
  35      data-direction="<?php echo strtoupper($data->direction); ?>"
  36      data-caption="<?php echo $caption; ?>"
  37      <?php if (!empty($sort)) : ?>
  38          data-sort="<?php echo $sort; ?>"
  39      <?php endif; ?>>
  40      <?php // The following statement has been concatenated purposely to remove whitespace. ?>
  41      <?php // Please leave as is. ?>
  42      <?php if (!empty($data->title)) :
  43          ?><span><?php echo Text::_($data->title); ?></span><?php
  44      endif; ?><span
  45          class="ms-1 <?php echo $icon; ?>"
  46          aria-hidden="true"></span>
  47      <span class="visually-hidden">
  48          <?php echo Text::_('JGLOBAL_SORT_BY'); ?>
  49          <?php echo (!empty($data->title)) ? Text::_($data->title) : Text::_('JGRID_HEADING_ORDERING'); ?>
  50      </span>
  51  </a>


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