[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  com_contact
   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\Contact\Site\Helper\RouteHelper;
  17  
  18  if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
  19      ?>
  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-contact-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); ?></a>
  26                      <?php if ($this->params->get('show_cat_items_cat') == 1) :?>
  27                          <span class="badge bg-info">
  28                              <?php echo Text::_('COM_CONTACT_NUM_ITEMS'); ?>&nbsp;
  29                              <?php echo $item->numitems; ?>
  30                          </span>
  31                      <?php endif; ?>
  32                      <?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
  33                          <button
  34                              type="button"
  35                              id="category-btn-<?php echo $item->id; ?>"
  36                              data-bs-target="#category-<?php echo $item->id; ?>"
  37                              data-bs-toggle="collapse"
  38                              class="btn btn-secondary btn-sm float-end"
  39                              aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"
  40                          >
  41                              <span class="icon-plus" aria-hidden="true"></span>
  42                          </button>
  43                      <?php endif; ?>
  44                  </h3>
  45                  <?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
  46                      <?php if ($item->description) : ?>
  47                          <div class="category-desc">
  48                              <?php echo HTMLHelper::_('content.prepare', $item->description, '', 'com_contact.categories'); ?>
  49                          </div>
  50                      <?php endif; ?>
  51                  <?php endif; ?>
  52  
  53                  <?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
  54                      <div class="collapse fade" id="category-<?php echo $item->id; ?>">
  55                          <?php
  56                          $this->items[$item->id] = $item->getChildren();
  57                          $this->parent = $item;
  58                          $this->maxLevelcat--;
  59                          echo $this->loadTemplate('items');
  60                          $this->parent = $item->getParent();
  61                          $this->maxLevelcat++;
  62                          ?>
  63                      </div>
  64                  <?php endif; ?>
  65              </div>
  66          <?php endif; ?>
  67      <?php endforeach; ?><?php
  68  endif; ?>


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