[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/components/com_contact/tmpl/featured/ -> 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\CMS\Uri\Uri;
  17  use Joomla\Component\Contact\Site\Helper\RouteHelper;
  18  
  19  /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
  20  $wa = $this->document->getWebAssetManager();
  21  $wa->useScript('com_contact.contacts-list')
  22      ->useScript('core');
  23  
  24  $listOrder = $this->escape($this->state->get('list.ordering'));
  25  $listDirn  = $this->escape($this->state->get('list.direction'));
  26  
  27  ?>
  28  <div class="com-contact-featured__items">
  29      <form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
  30          <?php if ($this->params->get('filter_field')) : ?>
  31              <div class="com-contact-featured__filter btn-group">
  32                  <label class="filter-search-lbl visually-hidden" for="filter-search">
  33                      <?php echo Text::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>
  34                  </label>
  35                  <input
  36                      type="text"
  37                      name="filter-search"
  38                      id="filter-search"
  39                      value="<?php echo $this->escape($this->state->get('list.filter')); ?>"
  40                      class="inputbox" onchange="document.adminForm.submit();"
  41                      placeholder="<?php echo Text::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>"
  42                  >
  43                  <button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
  44                  <button type="reset" name="filter-clear-button" class="btn btn-secondary"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
  45              </div>
  46          <?php endif; ?>
  47  
  48          <?php if ($this->params->get('show_pagination_limit')) : ?>
  49              <div class="com-contact-featured__pagination btn-group float-end">
  50                  <label for="limit" class="visually-hidden">
  51                      <?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
  52                  </label>
  53                  <?php echo $this->pagination->getLimitBox(); ?>
  54              </div>
  55          <?php endif; ?>
  56  
  57          <?php if (empty($this->items)) : ?>
  58              <div class="alert alert-info">
  59                  <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  60                      <?php echo Text::_('COM_CONTACT_NO_CONTACTS'); ?>
  61              </div>
  62          <?php else : ?>
  63          <table class="com-contact-featured__table table table-striped table-bordered table-hover">
  64              <caption class="visually-hidden">
  65                  <?php echo Text::_('COM_CONTACT_TABLE_CAPTION'); ?>,
  66              </caption>
  67              <?php if ($this->params->get('show_headings')) : ?>
  68                  <thead>
  69                      <tr>
  70                          <th scope="col" class="item-title">
  71                              <?php echo HTMLHelper::_('grid.sort', 'JGLOBAL_TITLE', 'a.name', $listDirn, $listOrder); ?>
  72                          </th>
  73  
  74                          <?php if ($this->params->get('show_position_headings')) : ?>
  75                          <th scope="col" class="item-position">
  76                              <?php echo HTMLHelper::_('grid.sort', 'COM_CONTACT_POSITION', 'a.con_position', $listDirn, $listOrder); ?>
  77                          </th>
  78                          <?php endif; ?>
  79  
  80                          <?php if ($this->params->get('show_email_headings')) : ?>
  81                          <th scope="col" class="item-email">
  82                              <?php echo Text::_('JGLOBAL_EMAIL'); ?>
  83                          </th>
  84                          <?php endif; ?>
  85  
  86                          <?php if ($this->params->get('show_telephone_headings')) : ?>
  87                          <th scope="col" class="item-phone">
  88                              <?php echo Text::_('COM_CONTACT_TELEPHONE'); ?>
  89                          </th>
  90                          <?php endif; ?>
  91  
  92                          <?php if ($this->params->get('show_mobile_headings')) : ?>
  93                          <th scope="col" class="item-phone">
  94                              <?php echo Text::_('COM_CONTACT_MOBILE'); ?>
  95                          </th>
  96                          <?php endif; ?>
  97  
  98                          <?php if ($this->params->get('show_fax_headings')) : ?>
  99                          <th scope="col" class="item-phone">
 100                              <?php echo Text::_('COM_CONTACT_FAX'); ?>
 101                          </th>
 102                          <?php endif; ?>
 103  
 104                          <?php if ($this->params->get('show_suburb_headings')) : ?>
 105                          <th scope="col" class="item-suburb">
 106                              <?php echo HTMLHelper::_('grid.sort', 'COM_CONTACT_SUBURB', 'a.suburb', $listDirn, $listOrder); ?>
 107                          </th>
 108                          <?php endif; ?>
 109  
 110                          <?php if ($this->params->get('show_state_headings')) : ?>
 111                          <th scope="col" class="item-state">
 112                              <?php echo HTMLHelper::_('grid.sort', 'COM_CONTACT_STATE', 'a.state', $listDirn, $listOrder); ?>
 113                          </th>
 114                          <?php endif; ?>
 115  
 116                          <?php if ($this->params->get('show_country_headings')) : ?>
 117                          <th scope="col" class="item-state">
 118                              <?php echo HTMLHelper::_('grid.sort', 'COM_CONTACT_COUNTRY', 'a.country', $listDirn, $listOrder); ?>
 119                          </th>
 120                          <?php endif; ?>
 121                      </tr>
 122                  </thead>
 123              <?php endif; ?>
 124              <tbody>
 125                  <?php foreach ($this->items as $i => $item) : ?>
 126                      <?php if ($this->items[$i]->published == 0) : ?>
 127                          <tr class="system-unpublished featured-list-row<?php echo $i % 2; ?>">
 128                      <?php else : ?>
 129                          <tr class="featured-list-row<?php echo $i % 2; ?>" itemscope itemtype="https://schema.org/Person">
 130                      <?php endif; ?>
 131                      <th scope="row" class="list-title">
 132                          <a href="<?php echo Route::_(RouteHelper::getContactRoute($item->slug, $item->catid, $item->language)); ?>" itemprop="url">
 133                              <span itemprop="name"><?php echo $this->escape($item->name); ?></span>
 134                          </a>
 135                          <?php if ($item->published == 0) : ?>
 136                              <div>
 137                                  <span class="list-published badge bg-warning text-light">
 138                                      <?php echo Text::_('JUNPUBLISHED'); ?>
 139                                  </span>
 140                              </div>
 141                          <?php endif; ?>
 142                      </th>
 143  
 144                      <?php if ($this->params->get('show_position_headings')) : ?>
 145                          <td class="item-position" itemprop="jobTitle">
 146                              <?php echo $item->con_position; ?>
 147                          </td>
 148                      <?php endif; ?>
 149  
 150                      <?php if ($this->params->get('show_email_headings')) : ?>
 151                          <td class="item-email" itemprop="email">
 152                              <?php echo $item->email_to; ?>
 153                          </td>
 154                      <?php endif; ?>
 155  
 156                      <?php if ($this->params->get('show_telephone_headings')) : ?>
 157                          <td class="item-phone" itemprop="telephone">
 158                              <?php echo $item->telephone; ?>
 159                          </td>
 160                      <?php endif; ?>
 161  
 162                      <?php if ($this->params->get('show_mobile_headings')) : ?>
 163                          <td class="item-phone" itemprop="telephone">
 164                              <?php echo $item->mobile; ?>
 165                          </td>
 166                      <?php endif; ?>
 167  
 168                      <?php if ($this->params->get('show_fax_headings')) : ?>
 169                          <td class="item-phone" itemprop="faxNumber">
 170                              <?php echo $item->fax; ?>
 171                          </td>
 172                      <?php endif; ?>
 173  
 174                      <?php if ($this->params->get('show_suburb_headings')) : ?>
 175                          <td class="item-suburb" itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
 176                              <span itemprop="addressLocality"><?php echo $item->suburb; ?></span>
 177                          </td>
 178                      <?php endif; ?>
 179  
 180                      <?php if ($this->params->get('show_state_headings')) : ?>
 181                          <td class="item-state" itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
 182                              <span itemprop="addressRegion"><?php echo $item->state; ?></span>
 183                          </td>
 184                      <?php endif; ?>
 185  
 186                      <?php if ($this->params->get('show_country_headings')) : ?>
 187                          <td class="item-state" itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
 188                              <span itemprop="addressCountry"><?php echo $item->country; ?></span>
 189                          </td>
 190                      <?php endif; ?>
 191                  <?php endforeach; ?>
 192              </tbody>
 193          </table>
 194          <?php endif; ?>
 195          <div>
 196              <input type="hidden" name="filter_order" value="<?php echo $this->escape($this->state->get('list.ordering')); ?>">
 197              <input type="hidden" name="filter_order_Dir" value="<?php echo $this->escape($this->state->get('list.direction')); ?>">
 198          </div>
 199      </form>
 200  </div>


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