- md5
- 2d88f54443926e1c620aea358904bff1
- sha1
- e2ecdccafa949ca157b822d4b147e58e44396541
- sha256
- 11fa10d29c0a9cb48da54baaf65f20e38f6716356296e1ca0fe5f1b61393ca62
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Check if we have all the data
if (!key_exists('item', $displayData) || !key_exists('context', $displayData))
{
return;
}
// Setting up for display
$item = $displayData['item'];
if (!$item)
{
return;
}
$context = $displayData['context'];
if (!$context)
{
return;
}
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$parts = explode('.', $context);
$component = $parts[0];
$fields = null;
if (key_exists('fields', $displayData))
{
$fields = $displayData['fields'];
}
else
{
$fields = $item->jcfields ?: FieldsHelper::getFields($context, $item, true);
}
if (!$fields)
{
return;
}
// Check if we have mail context in first element
$isMail = (reset($fields)->context == 'com_contact.mail');
if (!$isMail)
{
// Print the container tag
echo '<dl class="fields-container contact-fields dl-horizontal">';
}
// Loop through the fields and print them
foreach ($fields as $field)
{
// If the value is empty do nothing
if (empty($field->value) && !$isMail)
{
continue;
}
echo FieldsHelper::render($context, 'field.render', array('field' => $field));
}
if (!$isMail)
{
// Close the container
echo '</dl>';
}
The same content is in 9 releases, Joomla 3.8.4-rc to 3.8.7. See them all, or every version of this file.