CoreFiles by mySites.guru
checkboxes.php32 lines, 719 bytes, from Joomla_5.2.4-Stable-Full_Package.zip
Raw History Compare with 5.2.3
md5
1e189979e4fcacdb2ab143fd19325fdb
sha1
ee0dde95618c74fb377999534f7dbd132f566829
sha256
fcab8d75b55d3a79942a11b33018a3df5a14324bf61ded800b213e1344158607
<?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\CMS\Layout\FileLayout $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 67 releases, Joomla 5.2.0-alpha1 to 5.4.10. See them all, or every version of this file.