CoreFiles by mySites.guru
checkboxes.php32 lines, 660 bytes, from Joomla_4.0.4-Stable-Full_Package.zip
Raw History Compare with 4.0.3
md5
b1a6ddf018a5a91aa5c4881e1ec14274
sha1
202776970f7d0e308571d48baf5576e877cb34e1
sha256
fcac4a50737141f2bd6fcf3559b8eb38cc1049dcee67efe3130781b74db42e3b
<?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 51 releases, Joomla 4.0.0-beta6 to 4.2.0-beta2. See them all, or every version of this file.