- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/lib/bizproctype/usertypeproperty.php
- Класс: BitrixIblockBizprocTypeUserTypeProperty
- Вызов: UserTypeProperty::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;
}
$userType = static::getUserType($fieldType);
if (!empty($userType['GetPublicEditHTMLMulty']))
{
foreach ($typeValue as $k => &$fld)
{
if (!is_array($fld) || !isset($fld['VALUE']))
$fld = array('VALUE' => $fld);
if ($fld['VALUE'] === null)
unset($typeValue[$k]);
}
$typeValue = array_values($typeValue);
$renderResult = call_user_func_array(
$userType['GetPublicEditHTMLMulty'],
array(
array('LINK_IBLOCK_ID' => $fieldType->getOptions()),
$typeValue,
array(
'FORM_NAME' => $field['Form'],
'VALUE' => static::generateControlName($field)
),
true
)
);
}
else
{
$controls = array();
// need to show at least one control
if (empty($typeValue))
$typeValue[] = null;
foreach ($typeValue as $k => $v)
{
$singleField = $field;
$singleField['Index'] = $k;
$controls[] = static::renderControlSingle(
$fieldType,
$singleField,
$v,
$allowSelection,
$renderMode
);
}
$renderResult = static::wrapCloneableControls($controls, static::generateControlName($field));
}
if ($allowSelection)
{
$renderResult .= static::renderControlSelector($field, $selectorValue, true, '', $fieldType);
}
return $renderResult;
}