3namespace Bitrix\Iblock\Grid\Row\Assembler\Property;
5use Bitrix\Iblock\Grid\RowType;
6use Bitrix\Iblock\PropertyTable;
7use Bitrix\Iblock\UI\Input\Section;
8use Bitrix\Main\SystemException;
25 $property[
'LINK_IBLOCK_ID'] = (int)$property[
'LINK_IBLOCK_ID'];
26 if ($property[
'LINK_IBLOCK_ID'] <= 0)
28 $property[
'LINK_IBLOCK_ID'] =
null;
37 $this->preloadNames($elementIds);
40 return parent::prepareRows(
$rowList);
45 if (!self::isElementRow($row))
51 if (empty($columnIds))
56 $rowId =
RowType::getIndex(self::getRowType($row), (
string)($row[
'data'][
'ID'] ??
''));
58 $row[
'columns'] ??= [];
60 foreach ($columnIds as $columnId)
67 foreach ($value as $valueItem)
69 $tmp[] = $this->getName((
int)$valueItem);
72 $viewValue = join(
' / ',
$tmp);
76 $row[
'columns'][$columnId] ??= $viewValue;
79 if ($this->isCustomEditable($columnId))
81 $row[
'data'][
'~' . $columnId] = $this->getEditValue($rowId, $columnId, $this->properties[$columnId], $value);
89 private function getName(
int $id)
91 if (!isset($this->names))
96 return $this->names[$id] ??
'';
99 private function preloadNames(
array $elementIds): void
103 if (empty($elementIds))
108 $rows = CIBlockSection::GetList(
119 while ($row =
$rows->Fetch())
121 $this->names[$row[
'ID']] = $row[
'NAME'];
125 private function isCustomEditable(
string $columnId): bool
127 return in_array($columnId, $this->customEditableColumnIds);
130 private function getEditValue(
string $rowId,
string $columnId,
array $property, $values): string
137 'FIELD_NAME' => $columnId,
getColumnValues(mixed $rawValues, string $fieldName='VALUE')
compileColumnValues(array $rowList, int $normalizationMode=self::NORMALIZE_EMPTY)
prepareRows(array $rowList)
validateProperty(array $property)
static getIndex(string $type, string|int $id)
if(!is_array($prop["VALUES"])) $tmp
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)