CoreFiles by mySites.guru
media.php29 lines, 707 bytes, from Joomla_4.3.2-Stable-Full_Package.zip
Raw History Compare with 4.3.1
md5
1a377c2a3a9f85e46483ec81c44d37d8
sha1
3a935f07673e44daf902ec0fc5ef9a3670a84862
sha256
2a78e6d720eb77cee5b5aec05d96989687d46a28119d7168ad389857ab94688c
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.Media
 *
 * @copyright   (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Layout\LayoutHelper;

if (empty($field->value) || empty($field->value['imagefile'])) {
    return;
}

$class   = $fieldParams->get('image_class');
$options = [
    'src' => $field->value['imagefile'],
    'alt' => empty($field->value['alt_text']) && empty($field->value['alt_empty']) ? false : $field->value['alt_text'],
];

if ($class) {
    $options['class'] = $class;
}

echo LayoutHelper::render('joomla.html.image', $options);

The same content is in 208 releases, Joomla 4.3.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.