[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/components/com_contact/tmpl/contact/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  com_contact
   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\Factory;
  14  use Joomla\CMS\Helper\ContentHelper;
  15  use Joomla\CMS\HTML\HTMLHelper;
  16  use Joomla\CMS\Language\Text;
  17  use Joomla\CMS\Layout\FileLayout;
  18  use Joomla\CMS\Layout\LayoutHelper;
  19  use Joomla\CMS\Plugin\PluginHelper;
  20  use Joomla\CMS\Router\Route;
  21  use Joomla\Component\Contact\Site\Helper\RouteHelper;
  22  
  23  $tparams = $this->item->params;
  24  $canDo   = ContentHelper::getActions('com_contact', 'category', $this->item->catid);
  25  $canEdit = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by === Factory::getUser()->id);
  26  $htag    = $tparams->get('show_page_heading') ? 'h2' : 'h1';
  27  ?>
  28  
  29  <div class="com-contact contact" itemscope itemtype="https://schema.org/Person">
  30      <?php if ($tparams->get('show_page_heading')) : ?>
  31          <h1>
  32              <?php echo $this->escape($tparams->get('page_heading')); ?>
  33          </h1>
  34      <?php endif; ?>
  35  
  36      <?php if ($this->item->name && $tparams->get('show_name')) : ?>
  37          <div class="page-header">
  38              <<?php echo $htag; ?>>
  39                  <?php if ($this->item->published == 0) : ?>
  40                      <span class="badge bg-warning text-light"><?php echo Text::_('JUNPUBLISHED'); ?></span>
  41                  <?php endif; ?>
  42                  <span class="contact-name" itemprop="name"><?php echo $this->item->name; ?></span>
  43              </<?php echo $htag; ?>>
  44          </div>
  45      <?php endif; ?>
  46  
  47      <?php if ($canEdit) : ?>
  48          <div class="icons">
  49              <div class="float-end">
  50                  <div>
  51                      <?php echo HTMLHelper::_('contacticon.edit', $this->item, $tparams); ?>
  52                  </div>
  53              </div>
  54          </div>
  55      <?php endif; ?>
  56  
  57      <?php $show_contact_category = $tparams->get('show_contact_category'); ?>
  58  
  59      <?php if ($show_contact_category === 'show_no_link') : ?>
  60          <h3>
  61              <span class="contact-category"><?php echo $this->item->category_title; ?></span>
  62          </h3>
  63      <?php elseif ($show_contact_category === 'show_with_link') : ?>
  64          <?php $contactLink = RouteHelper::getCategoryRoute($this->item->catid, $this->item->language); ?>
  65          <h3>
  66              <span class="contact-category"><a href="<?php echo $contactLink; ?>">
  67                  <?php echo $this->escape($this->item->category_title); ?></a>
  68              </span>
  69          </h3>
  70      <?php endif; ?>
  71  
  72      <?php echo $this->item->event->afterDisplayTitle; ?>
  73  
  74      <?php if ($tparams->get('show_contact_list') && count($this->contacts) > 1) : ?>
  75          <form action="#" method="get" name="selectForm" id="selectForm">
  76              <label for="select_contact"><?php echo Text::_('COM_CONTACT_SELECT_CONTACT'); ?></label>
  77              <?php echo HTMLHelper::_(
  78                  'select.genericlist',
  79                  $this->contacts,
  80                  'select_contact',
  81                  'class="form-select" onchange="document.location.href = this.value"',
  82                  'link',
  83                  'name',
  84                  $this->item->link
  85              );
  86              ?>
  87          </form>
  88      <?php endif; ?>
  89  
  90      <?php if ($tparams->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
  91          <div class="com-contact__tags">
  92              <?php $this->item->tagLayout = new FileLayout('joomla.content.tags'); ?>
  93              <?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
  94          </div>
  95      <?php endif; ?>
  96  
  97      <?php echo $this->item->event->beforeDisplayContent; ?>
  98  
  99      <?php if ($this->params->get('show_info', 1)) : ?>
 100          <div class="com-contact__container">
 101              <?php echo '<h3>' . Text::_('COM_CONTACT_DETAILS') . '</h3>'; ?>
 102  
 103              <?php if ($this->item->image && $tparams->get('show_image')) : ?>
 104                  <div class="com-contact__thumbnail thumbnail">
 105                      <?php echo LayoutHelper::render(
 106                          'joomla.html.image',
 107                          [
 108                              'src'      => $this->item->image,
 109                              'alt'      => $this->item->name,
 110                              'itemprop' => 'image',
 111                          ]
 112                      ); ?>
 113                  </div>
 114              <?php endif; ?>
 115  
 116              <?php if ($this->item->con_position && $tparams->get('show_position')) : ?>
 117                  <dl class="com-contact__position contact-position dl-horizontal">
 118                      <dt><?php echo Text::_('COM_CONTACT_POSITION'); ?>:</dt>
 119                      <dd itemprop="jobTitle">
 120                          <?php echo $this->item->con_position; ?>
 121                      </dd>
 122                  </dl>
 123              <?php endif; ?>
 124  
 125              <div class="com-contact__info">
 126                  <?php echo $this->loadTemplate('address'); ?>
 127  
 128                  <?php if ($tparams->get('allow_vcard')) : ?>
 129                      <?php echo Text::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS'); ?>
 130                      <a href="<?php echo Route::_('index.php?option=com_contact&amp;view=contact&amp;id=' . $this->item->id . '&amp;format=vcf'); ?>">
 131                      <?php echo Text::_('COM_CONTACT_VCARD'); ?></a>
 132                  <?php endif; ?>
 133              </div>
 134          </div>
 135  
 136      <?php endif; ?>
 137  
 138      <?php if ($tparams->get('show_email_form') && ($this->item->email_to || $this->item->user_id)) : ?>
 139          <?php echo '<h3>' . Text::_('COM_CONTACT_EMAIL_FORM') . '</h3>'; ?>
 140  
 141          <?php echo $this->loadTemplate('form'); ?>
 142      <?php endif; ?>
 143  
 144      <?php if ($tparams->get('show_links')) : ?>
 145          <?php echo $this->loadTemplate('links'); ?>
 146      <?php endif; ?>
 147  
 148      <?php if ($tparams->get('show_articles') && $this->item->user_id && $this->item->articles) : ?>
 149          <?php echo '<h3>' . Text::_('JGLOBAL_ARTICLES') . '</h3>'; ?>
 150  
 151          <?php echo $this->loadTemplate('articles'); ?>
 152      <?php endif; ?>
 153  
 154      <?php if ($tparams->get('show_profile') && $this->item->user_id && PluginHelper::isEnabled('user', 'profile')) : ?>
 155          <?php echo '<h3>' . Text::_('COM_CONTACT_PROFILE') . '</h3>'; ?>
 156  
 157          <?php echo $this->loadTemplate('profile'); ?>
 158      <?php endif; ?>
 159  
 160      <?php if ($tparams->get('show_user_custom_fields') && $this->contactUser) : ?>
 161          <?php echo $this->loadTemplate('user_custom_fields'); ?>
 162      <?php endif; ?>
 163  
 164      <?php if ($this->item->misc && $tparams->get('show_misc')) : ?>
 165          <?php echo '<h3>' . Text::_('COM_CONTACT_OTHER_INFORMATION') . '</h3>'; ?>
 166  
 167          <div class="com-contact__miscinfo contact-miscinfo">
 168              <dl class="dl-horizontal">
 169                  <dt>
 170                      <?php if (!$this->params->get('marker_misc')) : ?>
 171                          <span class="icon-info-circle" aria-hidden="true"></span>
 172                          <span class="visually-hidden"><?php echo Text::_('COM_CONTACT_OTHER_INFORMATION'); ?></span>
 173                      <?php else : ?>
 174                          <span class="<?php echo $this->params->get('marker_class'); ?>">
 175                              <?php echo $this->params->get('marker_misc'); ?>
 176                          </span>
 177                      <?php endif; ?>
 178                  </dt>
 179                  <dd>
 180                      <span class="contact-misc">
 181                          <?php echo $this->item->misc; ?>
 182                      </span>
 183                  </dd>
 184              </dl>
 185          </div>
 186      <?php endif; ?>
 187      <?php echo $this->item->event->afterDisplayContent; ?>
 188  </div>


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