[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/components/com_contact/layouts/field/ -> render.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  com_contact
   6   *
   7   * @copyright   (C) 2016 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  if (!array_key_exists('field', $displayData)) {
  16      return;
  17  }
  18  
  19  $field     = $displayData['field'];
  20  $label     = Text::_($field->label);
  21  $value     = $field->value;
  22  $class     = $field->params->get('render_class');
  23  $showLabel = $field->params->get('showlabel');
  24  $labelClass = $field->params->get('label_render_class');
  25  
  26  if ($field->context == 'com_contact.mail') {
  27      // Prepare the value for the contact form mail
  28      $value = html_entity_decode($value);
  29  
  30      echo ($showLabel ? $label . ': ' : '') . $value . "\r\n";
  31      return;
  32  }
  33  
  34  if (!strlen($value)) {
  35      return;
  36  }
  37  
  38  ?>
  39  <dt class="contact-field-entry <?php echo $class; ?>">
  40      <?php if ($showLabel == 1) : ?>
  41          <span class="field-label <?php echo $labelClass; ?>"><?php echo htmlentities($label, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?>: </span>
  42      <?php endif; ?>
  43  </dt>
  44  <dd class="contact-field-entry <?php echo $class; ?>">
  45      <span class="field-value"><?php echo $value; ?></span>
  46  </dd>


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