$v) { $singleField = $field; $singleField["Index"] = $k; $controls[] = self::renderControlSingle($fieldType, $singleField, $v, $allowSelection, $renderMode); } return static::wrapCloneableControls($controls, static::generateControlName($field)); } /** * Low-level control rendering method * @param FieldType $fieldType * @param array $field * @param mixed $value * @param bool $allowSelection * @param int $renderMode * @return string - HTML rendering */ protected static function renderControl(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode) { $name = static::generateControlName($field); $controlId = static::generateControlId($field); $className = static::generateControlClassName($fieldType, $field); $options = $fieldType->getOptions(); $iblockId = self::getIblockId($fieldType); $propertyId = 0; $queryObject = \CIBlockProperty::getByID(mb_substr($field["Field"], mb_strlen("PROPERTY_")), $iblockId); if ($property = $queryObject->fetch()) { $propertyId = $property["ID"]; } if ($value) { $value = (int) $value; } else { $sequence = new \CIBlockSequence($iblockId, $propertyId); $value = $sequence->getCurrent(); } $readonly = ((isset($options["write"]) && $options["write"] == "Y") ? "" : "readonly"); return ''; } private static function getIblockId(FieldType $fieldType) { $documentType = $fieldType->getDocumentType(); $type = explode('_', $documentType[2]); return intval($type[1]); } } }