CoreFiles by mySites.guru
radio.php32 lines, 698 bytes, from Joomla_6.2.0-beta2-Beta-Full_Package.zip
Raw History Compare with 6.2.0-beta1
md5
c064575732178a490f25e9d9c80df2e8
sha1
f7382353c39db4fb0b6f09800b312c625142c64d
sha256
a7ce1d4bd2156c1fbb18e766e0eebe187637fc2a679a1a0e478fce5017a8d7c1
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.Radio
 *
 * @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\Radio\Extension\Radio $this */
$value = $field->value;

if ($value == '') {
    return;
}

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

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

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.