CoreFiles by mySites.guru
note.php41 lines, 1,348 bytes, from Joomla_6.0.1-Stable-Full_Package.zip
Raw History Compare with 6.0.0
md5
10d51700d474900d967a4f413da53d65
sha1
75de83a6d7f5c5dd3e1d4ba9d65f3b1f5ce9ad67
sha256
cc65261369f1b595f506b7b3695f6c2496cfcf1fb53465ffd1ac42fbbc17065b
<?php

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

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;

defined('_JEXEC') or die;

if (empty($field->params->get('display_frontend', 0))) {
    return;
}

$html  = [];
$class = [];

if (!empty($field->fieldparams->get('class', ''))) {
    $class[] = $field->fieldparams->get('class', '');
}

if ($close = (string) $field->fieldparams->get('close', '')) {
    HTMLHelper::_('bootstrap.alert');
    $close   = $close === 'true' ? 'alert' : $close;
    $html[]  = '<button type="button" class="btn-close" data-bs-dismiss="' . $close . '"></button>';
    $class[] = 'alert-dismissible show';
}

$class       = $class ? ' class="' . implode(' ', $class) . '"' : '';
$title       = (string) $field->fieldparams->get('label', ($field->label ? : ''));
$heading     = (string) $field->fieldparams->get('heading', 'h4');
$description = (string) $field->fieldparams->get('description', '');
$html[]      = !empty($title) ? '<' . $heading . '>' . Text::_($title) . '</' . $heading . '>' : '';
$html[]      = !empty($description) ? Text::_($description) : '';

echo '<div ' . $class . '>' . implode('', $html) . '</div>';

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