• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/internals/input.php
  • Класс: BitrixSaleInternalsInputManager
  • Вызов: Manager::getCommonSettings
static function getCommonSettings(array $input, $reload = null)
{
	if (! static::$initialized)
		static::initialize();

	$typeOptions = array();

	foreach (static::$types as $k => $v)
	{
		if (in_array($k, ['PRODUCT_CATEGORIES', 'CONCRETE_PRODUCT']))
		{
			continue;
		}

		$typeOptions[$k] = $v['NAME']." [$k]";
	}

	$hasMultipleSupport = true;
	if (isset(static::$types[$input['TYPE']]))
	{
		/** @var Base $typeClass */
		$typeClass = static::$types[$input['TYPE']]['CLASS'];

		if (!$typeClass::hasMultipleValuesSupport())
		{
			$hasMultipleSupport = false;
		}
	}

	$multiple = array('TYPE' => 'Y/N' , 'LABEL' => Loc::getMessage('INPUT_MULTIPLE'));

	if (!$hasMultipleSupport)
	{
		$multiple['DISABLED_YN'] = 'N';
	}
	else
	{
		$multiple['ONCLICK'] = $reload;
	}

	$result = [
		'TYPE' => array('TYPE' => 'ENUM', 'LABEL' => Loc::getMessage('INPUT_TYPE'), 'OPTIONS' => $typeOptions, 'REQUIRED' => 'Y', 'ONCHANGE' => $reload),
		'REQUIRED' => array('TYPE' => 'Y/N' , 'LABEL' => Loc::getMessage('INPUT_REQUIRED')),
		'MULTIPLE' => $multiple,
		'VALUE' => array('LABEL' => Loc::getMessage('INPUT_VALUE'), 'REQUIRED' => 'N') + $input,
	];

	return $result;
}