- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/lib/bizproctype/money.php
- Класс: BitrixIblockBizprocTypeMoney
- Вызов: Money::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;
$controls = array();
$property = static::getUserType($fieldType);
if(!empty($property['GetPublicEditHTML']))
{
foreach($typeValue as $k => $v)
{
$singleField = $field;
$singleField['Index'] = $k;
$fieldName = static::generateControlName($singleField);
$controls[] = call_user_func_array(
$property['GetPublicEditHTML'],
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' => $v),
array(
'FORM_NAME' => $singleField['Form'],
'VALUE' => $fieldName,
'DESCRIPTION' => '',
),
true
)
);
}
}
else
{
foreach($typeValue as $k => $v)
{
$singleField = $field;
$singleField['Index'] = $k;
$controls[] = static::renderControl(
$fieldType,
$singleField,
$v,
$allowSelection,
$renderMode
);
}
}
$renderResult = static::wrapCloneableControls($controls, static::generateControlName($field));
if($allowSelection)
{
$renderResult .= static::renderControlSelector($field, $selectorValue, true, '', $fieldType);
}
return $renderResult;
}