[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  com_newsfeeds
   6   *
   7   * @copyright   (C) 2010 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\HTML\HTMLHelper;
  14  use Joomla\CMS\Language\Text;
  15  use Joomla\CMS\Router\Route;
  16  use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper;
  17  
  18  ?>
  19  <?php if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) : ?>
  20      <?php foreach ($this->items[$this->parent->id] as $id => $item) : ?>
  21          <?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : ?>
  22              <div class="com-newsfeeds-categories__items">
  23                  <h3 class="page-header item-title">
  24                      <a href="<?php echo Route::_(RouteHelper::getCategoryRoute($item->id, $item->language)); ?>">
  25                          <?php echo $this->escape($item->title); ?>
  26                      </a>
  27                      <?php if ($this->params->get('show_cat_items_cat') == 1) : ?>
  28                          <span class="badge bg-info">
  29                              <?php echo Text::_('COM_NEWSFEEDS_NUM_ITEMS'); ?>&nbsp;
  30                              <?php echo $item->numitems; ?>
  31                          </span>
  32                      <?php endif; ?>
  33                      <?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
  34                          <button
  35                              type="button"
  36                              id="category-btn-<?php echo $item->id; ?>"
  37                              data-bs-target="#category-<?php echo $item->id; ?>"
  38                              data-bs-toggle="collapse"
  39                              class="btn btn-secondary btn-sm float-end"
  40                              aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"
  41                          >
  42                              <span class="icon-plus" aria-hidden="true"></span>
  43                          </button>
  44                      <?php endif; ?>
  45                  </h3>
  46                  <?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
  47                      <?php if ($item->description) : ?>
  48                          <div class="com-newsfeeds-categories__description category-desc">
  49                              <?php echo HTMLHelper::_('content.prepare', $item->description, '', 'com_newsfeeds.categories'); ?>
  50                          </div>
  51                      <?php endif; ?>
  52                  <?php endif; ?>
  53                  <?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
  54                      <div class="com-newsfeeds-categories__children collapse fade" id="category-<?php echo $item->id; ?>">
  55                          <?php $this->items[$item->id] = $item->getChildren(); ?>
  56                          <?php $this->parent = $item; ?>
  57                          <?php $this->maxLevelcat--; ?>
  58                          <?php echo $this->loadTemplate('items'); ?>
  59                          <?php $this->parent = $item->getParent(); ?>
  60                          <?php $this->maxLevelcat++; ?>
  61                      </div>
  62                  <?php endif; ?>
  63              </div>
  64          <?php endif; ?>
  65      <?php endforeach; ?>
  66  <?php endif; ?>


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