- Модуль: catalog
- Путь к файлу: ~/bitrix/modules/catalog/lib/component/baseform.php
- Класс: BitrixCatalogComponentBaseForm
- Вызов: BaseForm::getPropertyDescription
protected function getPropertyDescription(Property $property): array
{
$description = [
'entity' => 'property',
'name' => static::preparePropertyNameFromProperty($property),
'propertyId' => $property->getId(),
'propertyCode' => $property->getCode(),
'title' => $property->getName(),
'editable' => true,
'required' => $property->isRequired(),
'multiple' => $property->isMultiple(),
'defaultValue' => $property->getDefaultValue(),
'settings' => $property->getSettings(),
'type' => null,
];
if ($property->getUserType() === CIBlockPropertySequence::USER_TYPE)
{
$userTypeSettings = $property->getSetting('USER_TYPE_SETTINGS');
$description['editable'] = $userTypeSettings['write'] === 'Y';
}
$nonEditableUserTypes = [
'UserID',
'FileMan',
];
if (in_array($property->getUserType(), $nonEditableUserTypes, true))
{
$description['editable'] = false;
}
if ($description['propertyCode'] === self::MORE_PHOTO)
{
$description['optionFlags'] = 1; // showAlways
}
if ($description['multiple'] && !is_array($description['defaultValue']))
{
$description['defaultValue'] = $description['defaultValue'] === null ? [] : [$description['defaultValue']];
}
// remove it after PropertyTable::TYPE_ELEMENT refactoring
if ($property->getPropertyType() === PropertyTable::TYPE_ELEMENT)
{
Asset::getInstance()->addJs('/bitrix/js/main/utils.js');
}
if ($property->getUserType())
{
$specificDescription = $this->getUserTypePropertyDescription($property);
}
else
{
$specificDescription = $this->getGeneralPropertyDescription($property);
}
$specificDescription['data']['isPublic'] = $property->isPublic();
if (!$this->isAllowedEditFields())
{
unset($specificDescription['editable']);
$description['editable'] = false;
}
return array_merge($description, $specificDescription);
}