CoreFiles by mySites.guru
checkboxes.php32 lines, 673 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
aa92f2d934d7a3b8ebf3b06a9ab0fda4
sha1
1d7f10279e49eb4ee84df2f60ea7258701ebe067
sha256
4bd4928f60929cfc86b2ee5183e9cccbb6723323ab1655dcba0dabac6fdde622
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.Checkboxes
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @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 3 releases, Joomla 4.0.0-alpha3 to 4.0.0-alpha6. See them all, or every version of this file.