- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/lib/bizproctype/ecrm.php
- Класс: BitrixIblockBizprocTypeECrm
- Вызов: ECrm::renderControlMultiple
static function renderControlMultiple(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode)
{
$selectorValue = null;
$typeValue = array();
if (!is_array($value) || is_array($value) && CBPHelper::isAssociativeArray($value))
$value = array($value);
foreach ($value as $v)
{
if (CBPActivity::isExpression($v))
$selectorValue = $v;
else
$typeValue[] = $v;
}
// need to show at least one control
if (empty($typeValue))
$typeValue[] = null;
$property = static::getUserType($fieldType);
if(!empty($property['GetPublicEditHTMLMulty']))
{
$fieldName = static::generateControlName($field);
$renderResult = call_user_func_array(
$property['GetPublicEditHTMLMulty'],
array(
array(
'IBLOCK_ID' => self::getIblockId($fieldType),
'USER_TYPE_SETTINGS' => $fieldType->getOptions(),
'MULTIPLE' => $fieldType->isMultiple() ? 'Y' : 'N',
'IS_REQUIRED' => $fieldType->isRequired() ? 'Y' : 'N',
'PROPERTY_USER_TYPE' => $property
),
array('VALUE' => $typeValue),
array(
'FORM_NAME' => $field['Form'],
'VALUE' => $fieldName,
'DESCRIPTION' => '',
),
true
)
);
}
else
{
$renderResult = static::renderControl($fieldType, $field, '', $allowSelection, $renderMode);
}
if($allowSelection)
{
$renderResult .= static::renderControlSelector($field, $selectorValue, true, '', $fieldType);
}
return $renderResult;
}