CoreFiles by mySites.guru
checkboxes.php31 lines, 676 bytes, from Joomla_4.2.6-Stable-Full_Package.zip
Raw History Compare with 4.2.5
md5
5cfcdc1df0bb1b0dfaa9a357bd763621
sha1
611ab59d18e59a3f1d1467fcb791492a468b86bd
sha256
492451526d5e0e6d8bd5bbb6fe777dd23047b1db9febcd884e867c1b46f8e2b5
<?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      = array();
$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 16 releases, Joomla 4.2.0-beta3 to 4.3.0-alpha2. See them all, or every version of this file.