MultiFieldBase::renderControlSingle

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. MultiFieldBase
  4. renderControlSingle
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/bizproc/fieldtype/multifieldbase.php
  • Класс: Bitrix\Crm\Integration\BizProc\FieldType\MultiFieldBase
  • Вызов: MultiFieldBase::renderControlSingle
static function renderControlSingle(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode)
{
	global $APPLICATION;

	$selectorValue = null;
	$typeValue = array();
	$value = (array) $value;

	foreach ($value as $k => $v)
	{
		if (\CBPActivity::isExpression($v))
		{
			$selectorValue = $v;
		}
		else
		{
			$typeValue[$k] = $v;
		}
	}

	$value = $typeValue;

	ob_start();
	$APPLICATION->IncludeComponent('bitrix:crm.field_multi.edit', 'new',
		Array(
			'FM_MNEMONIC' => static::generateControlName($field),
			'ENTITY_ID'   => $fieldType->getDocumentType()[2],
			'ELEMENT_ID'  => 0,
			'TYPE_ID'     => mb_strtoupper($fieldType->getType()),
			'VALUES'      => $value
		),
		null,
		array('HIDE_ICONS' => 'Y')
	);

	$renderResult = ob_get_clean();

	if ($allowSelection)
	{
		$renderResult .= static::renderControlSelector($field, $selectorValue, true, '', $fieldType);
	}

	return $renderResult;
}

Добавить комментарий