CoreFiles by mySites.guru
checkboxes.php32 lines, 743 bytes, from Joomla_6.1.2-Stable-Full_Package.zip
Raw History Compare with 6.1.1
md5
16ba8f10b292ea2cb643375fab1ab4ae
sha1
0fca90239173d1fa8905c228202f563fb298b698
sha256
88d4d86efee5caa12be40305c5f68f81d7447391f008ec93b71e8ba4163af08b
<?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;

/** @var \Joomla\Plugin\Fields\Checkboxes\Extension\Checkboxes $this */
$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 50 releases, Joomla 6.0.0-alpha1 to 6.2.1-rc1. See them all, or every version of this file.