[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  com_contact
   6   *
   7   * @copyright   (C) 2009 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  
  15  ?>
  16  <?php echo '<h3>' . Text::_('COM_CONTACT_LINKS') . '</h3>'; ?>
  17  
  18  <div class="com-contact__links contact-links">
  19      <ul class="list-unstyled">
  20          <?php
  21          // Letters 'a' to 'e'
  22          foreach (range('a', 'e') as $char) :
  23              $link = $this->item->params->get('link' . $char);
  24              $label = $this->item->params->get('link' . $char . '_name');
  25  
  26              if (!$link) :
  27                  continue;
  28              endif;
  29  
  30              // Add 'http://' if not present
  31              $link = (0 === strpos($link, 'http')) ? $link : 'http://' . $link;
  32  
  33              // If no label is present, take the link
  34              $label = $label ?: $link;
  35              ?>
  36              <li>
  37                  <a href="<?php echo $link; ?>" itemprop="url" rel="noopener noreferrer">
  38                      <?php echo $label; ?>
  39                  </a>
  40              </li>
  41          <?php endforeach; ?>
  42      </ul>
  43  </div>


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