15 private int $iblockId;
24 $this->iblockId = $iblockId;
25 $this->linksBuilder = $linksBuilder;
33 return "iblock_property_{$this->iblockId}";
46 foreach ($columns as $item)
48 if ($item[
'id'] === $fieldId)
50 return (
string)$item[
'name'];
82 'id' =>
'PROPERTY_TYPE',
83 'name' =>
Loc::getMessage(
'IBLOCK_UI_GRID_PROPERTY_PROVIDER_PROPERTY_TYPE'),
84 'sort' =>
'PROPERTY_TYPE',
100 'type' =>
'checkbox',
105 'id' =>
'IS_REQUIRED',
106 'name' =>
Loc::getMessage(
'IBLOCK_UI_GRID_PROPERTY_PROVIDER_IS_REQUIRED'),
107 'sort' =>
'IS_REQUIRED',
108 'type' =>
'checkbox',
114 'name' =>
Loc::getMessage(
'IBLOCK_UI_GRID_PROPERTY_PROVIDER_MULTIPLE'),
115 'sort' =>
'MULTIPLE',
116 'type' =>
'checkbox',
121 'id' =>
'SEARCHABLE',
122 'name' =>
Loc::getMessage(
'IBLOCK_UI_GRID_PROPERTY_PROVIDER_SEARCHABLE'),
123 'sort' =>
'SEARCHABLE',
124 'type' =>
'checkbox',
130 'name' =>
Loc::getMessage(
'IBLOCK_UI_GRID_PROPERTY_PROVIDER_FILTRABLE'),
131 'sort' =>
'FILTRABLE',
132 'type' =>
'checkbox',
142 'id' =>
'WITH_DESCRIPTION',
143 'name' =>
Loc::getMessage(
'IBLOCK_UI_GRID_PROPERTY_PROVIDER_WITH_DESCRIPTION'),
144 'sort' =>
'WITH_DESCRIPTION',
145 'type' =>
'checkbox',
160 $id = (int)$row[
'ID'];
164 'TEXT' =>
Loc::getMessage(
'IBLOCK_UI_GRID_PROPERTY_PROVIDER_ACTION_OPEN'),
165 'HREF' => $this->linksBuilder->getActionOpenLink($id),
166 'ONCLICK' => $this->linksBuilder->getActionOpenClick($id),
174 'TEXT' =>
Loc::getMessage(
'IBLOCK_UI_GRID_PROPERTY_PROVIDER_ACTION_DELETE'),
175 'HREF' => $this->linksBuilder->getActionDeleteLink($id),
176 'ONCLICK' => $this->linksBuilder->getActionDeleteClick($id),
188 private function getPropertyTypeItems(): array
190 $result = Property::getBaseTypeList(
true);
192 $userTypes = CIBlockProperty::GetUserType();
193 Collection::sortByColumn($userTypes, [
194 'DESCRIPTION' => SORT_STRING,
197 foreach ($userTypes as $type => $item)
199 $key =
"{$item['PROPERTY_TYPE']}:{$type}";
200 $result[$key] = $item[
'DESCRIPTION'];
211 $result = parent::getRowColumns($row);
214 if (isset($result[
'PROPERTY_TYPE']))
216 $type = $row[
'PROPERTY_TYPE'] ??
null;
219 $userType = $row[
'USER_TYPE'] ??
null;
222 $type .=
':' . $userType;
225 $typeNames = $this->getPropertyTypeItems();
226 $result[
'PROPERTY_TYPE'] = $typeNames[$type] ??
null;
242 if (isset($rawRow[
'NAME']))
247 return parent::prepareRow($rawRow);
static getMessage($code, $replace=null, $language=null)
static encode($string, $flags=ENT_COMPAT, $doubleEncode=true)