CoreFiles by mySites.guru
checkboxes.php31 lines, 671 bytes, from Joomla_5.1.4-Stable-Full_Package.zip
Raw History Compare with 5.1.3
md5
1fadfa4e528a4c8c60e6535e7448e9b7
sha1
7023649c32c050ace2f6cc4f0bb028ec2a8944ee
sha256
16da54be9616ad9be6e7867ff3ee28dd51157c92453ef8629f4263f94b8d600d
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.Checkboxes
 *
 * @copyright   (C) 2017 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\Language\Text;

$fieldValue = $field->value;

if ($fieldValue === '' || $fieldValue === null) {
    return;
}

$fieldValue = (array) $fieldValue;
$texts      = [];
$options    = $this->getOptionsFromField($field);

foreach ($options as $value => $name) {
    if (in_array((string) $value, $fieldValue)) {
        $texts[] = Text::_($name);
    }
}

echo htmlentities(implode(', ', $texts));

The same content is in 97 releases, Joomla 4.2.7-rc1 to 5.1.4. See them all, or every version of this file.