• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/component/gridvariationform.php
  • Класс: BitrixCatalogComponentGridVariationForm
  • Вызов: GridVariationForm::getIblockPropertiesHeaders
protected function getIblockPropertiesHeaders(): array
{
	$headers = [];

	foreach ($this->getIblockPropertiesDescriptions() as $property)
	{
		$isDirectory =
			$property['settings']['PROPERTY_TYPE'] === PropertyTable::TYPE_STRING
			&& $property['settings']['USER_TYPE'] === 'directory'
		;

		$sortField = "PROPERTY_{$property['propertyCode']}";
		if (
			$property['multiple']
			|| $property['propertyCode'] === 'CML2_LINK'
			|| $property['settings']['PROPERTY_TYPE'] === PropertyTable::TYPE_FILE
		)
		{
			$sortField = false;
		}

		$header = [
			'id' => $property['name'],
			'name' => $property['title'],
			'title' => $property['title'],
			'type' => $property['type'],
			'align' => $property['type'] === 'number' ? 'right' : 'left',
			'sort' => $sortField,
			'default' => $property['propertyCode'] === self::MORE_PHOTO,
			'data' => $property['data'],
			'width' => $isDirectory ? 160 : null,
			'editable' => $property['editable'],
		];
		if (!empty($property['isEnabledOfferTree']))
		{
			$header['hint'] = Loc::getMessage('CATALOG_PRODUCT_CARD_VARIATION_GRID_OFFER_TREE_HINT');
		}

		if (
			$property['settings']['PROPERTY_TYPE'] === PropertyTable::TYPE_FILE
			&& $property['multiple'] === true
			&& $property['propertyCode'] !== 'MORE_PHOTO'
		)
		{
			$header['hint'] = Loc::getMessage('CATALOG_PRODUCT_CARD_VARIATION_GRID_FILE_MULTIPLE_HINT');
		}

		$headers[] = $header;
	}

	return $headers;
}