CoreFiles by mySites.guru
radio.php46 lines, 968 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
4af9aaa806520133e920b483a964ffc1
sha1
64b6bdc956c8eb18548e816875c02aaed5c9d7dc
sha256
d9a53e4fb4dacce1e9ceec30ab7c46bbe3def03568c69382f899a79f6b09964b
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.Radio
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Fields Radio Plugin
 *
 * @since  3.7.0
 */
class PlgFieldsRadio extends \Joomla\Component\Fields\Administrator\Plugin\FieldsListPlugin
{
	/**
	 * Before prepares the field value.
	 *
	 * @param   string     $context  The context.
	 * @param   \stdclass  $item     The item.
	 * @param   \stdclass  $field    The field.
	 *
	 * @return  void
	 *
	 * @since   3.7.0
	 */
	public function onCustomFieldsBeforePrepareField($context, $item, $field)
	{
		if (!$this->app->isClient('api'))
		{
			return;
		}

		if (!$this->isTypeSupported($field->type))
		{
			return;
		}

		$options = $this->getOptionsFromField($field);

		$field->apivalue = [$field->value => $options[$field->value]];
	}
}

No other release has this exact content. See every version of this file.