- Модуль: bizproc
- Путь к файлу: ~/bitrix/modules/bizproc/lib/basetype/file.php
- Класс: BitrixBizprocBaseTypeFile
- Вызов: File::renderControlMultiple
static function renderControlMultiple(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode)
{
if ($renderMode & FieldType::RENDER_MODE_DESIGNER && !$allowSelection)
{
return '';
}
if ($allowSelection && $renderMode & FieldType::RENDER_MODE_PUBLIC)
{
return self::renderPublicSelectableControlMultiple($fieldType, $field, $value);
}
if ($renderMode & FieldType::RENDER_MODE_MOBILE)
{
return self::renderMobileControl($fieldType, $field, $value);
}
if ($renderMode & FieldType::RENDER_MODE_DESIGNER)
{
if (!is_array($value) || is_array($value) && CBPHelper::isAssociativeArray($value))
{
$value = [$value];
}
// need to show at least one control
if (empty($value))
{
$value[] = null;
}
$controls = [];
foreach ($value as $k => $v)
{
$singleField = $field;
$singleField['Index'] = $k;
$controls[] = parent::renderControlSingle($fieldType, $singleField, $v, $allowSelection, $renderMode);
}
return static::wrapCloneableControls($controls, static::generateControlName($field));
}
return parent::renderControlMultiple($fieldType, $field, $value, $allowSelection, $renderMode);
}