[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/components/com_newsfeeds/tmpl/category/ -> default_items.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  com_newsfeeds
   6   *
   7   * @copyright   (C) 2006 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  use Joomla\CMS\Router\Route;
  15  use Joomla\CMS\String\PunycodeHelper;
  16  use Joomla\CMS\Uri\Uri;
  17  use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper;
  18  
  19  $n         = count($this->items);
  20  $listOrder = $this->escape($this->state->get('list.ordering'));
  21  $listDirn  = $this->escape($this->state->get('list.direction'));
  22  
  23  ?>
  24  <div class="com-newsfeeds-category__items">
  25      <?php if (empty($this->items)) : ?>
  26          <p><?php echo Text::_('COM_NEWSFEEDS_NO_ARTICLES'); ?></p>
  27      <?php else : ?>
  28          <form action="<?php echo htmlspecialchars(Uri::getInstance()->toString(), ENT_COMPAT, 'UTF-8'); ?>" method="post" name="adminForm" id="adminForm">
  29              <?php if ($this->params->get('filter_field') !== 'hide' || $this->params->get('show_pagination_limit')) : ?>
  30                  <fieldset class="com-newsfeeds-category__filters filters">
  31                      <?php if ($this->params->get('filter_field') !== 'hide' && $this->params->get('filter_field') == '1') : ?>
  32                          <div class="btn-group">
  33                              <label class="filter-search-lbl visually-hidden" for="filter-search">
  34                                  <?php echo Text::_('COM_NEWSFEEDS_FILTER_LABEL') . '&#160;'; ?>
  35                              </label>
  36                              <input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" placeholder="<?php echo Text::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>">
  37                          </div>
  38                      <?php endif; ?>
  39                      <?php if ($this->params->get('show_pagination_limit')) : ?>
  40                          <div class="btn-group float-end">
  41                              <label for="limit" class="visually-hidden">
  42                                  <?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
  43                              </label>
  44                              <?php echo $this->pagination->getLimitBox(); ?>
  45                          </div>
  46                      <?php endif; ?>
  47                  </fieldset>
  48              <?php endif; ?>
  49              <ul class="com-newsfeeds-category__category list-group list-unstyled">
  50                  <?php foreach ($this->items as $item) : ?>
  51                      <li class="list-group-item">
  52                      <?php if ($this->params->get('show_articles')) : ?>
  53                          <span class="list-hits badge bg-info float-end">
  54                              <?php echo Text::sprintf('COM_NEWSFEEDS_NUM_ARTICLES_COUNT', $item->numarticles); ?>
  55                          </span>
  56                      <?php endif; ?>
  57                      <span class="list float-start">
  58                          <div class="list-title">
  59                              <a href="<?php echo Route::_(RouteHelper::getNewsfeedRoute($item->slug, $item->catid)); ?>">
  60                                  <?php echo $item->name; ?>
  61                              </a>
  62                          </div>
  63                      </span>
  64                      <?php if ($item->published == 0) : ?>
  65                          <span class="badge bg-warning text-light">
  66                              <?php echo Text::_('JUNPUBLISHED'); ?>
  67                          </span>
  68                      <?php endif; ?>
  69                      <br>
  70                      <?php if ($this->params->get('show_link')) : ?>
  71                          <?php $link = PunycodeHelper::urlToUTF8($item->link); ?>
  72                          <span class="list float-start">
  73                              <a href="<?php echo $item->link; ?>">
  74                                  <?php echo $link; ?>
  75                              </a>
  76                          </span>
  77                          <br>
  78                      <?php endif; ?>
  79                      </li>
  80                  <?php endforeach; ?>
  81              </ul>
  82              <?php // Add pagination links ?>
  83              <?php if (!empty($this->items)) : ?>
  84                  <?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
  85                      <div class="com-newsfeeds-category__pagination w-100">
  86                          <?php if ($this->params->def('show_pagination_results', 1)) : ?>
  87                              <p class="counter float-end pt-3 pe-2">
  88                                  <?php echo $this->pagination->getPagesCounter(); ?>
  89                              </p>
  90                          <?php endif; ?>
  91                          <?php echo $this->pagination->getPagesLinks(); ?>
  92                      </div>
  93                  <?php endif; ?>
  94              <?php endif; ?>
  95          </form>
  96      <?php endif; ?>
  97  </div>
  98  


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