render.php
1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
if (!key_exists('field', $displayData))
{
return;
}
$field = $displayData['field'];
$label = JText::_($field->label);
$value = $field->value;
$class = $field->params->get('render_class');
$showLabel = $field->params->get('showlabel');
$labelClass = $field->params->get('label_render_class');
if ($field->context == 'com_contact.mail')
{
// Prepare the value for the contact form mail
$value = html_entity_decode($value);
echo ($showLabel ? $label . ': ' : '') . $value . "\r\n";
return;
}
if (!strlen($value))
{
return;
}
?>
<dt class="contact-field-entry <?php echo $class; ?>">
<?php if ($showLabel == 1) : ?>
<span class="field-label <?php echo $labelClass; ?>"><?php echo htmlentities($label, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?>: </span>
<?php endif; ?>
</dt>
<dd class="contact-field-entry <?php echo $class; ?>">
<span class="field-value"><?php echo $value; ?></span>
</dd>