21 private int $iblockId;
24 private CIBlockElement $elementEntity;
25 private CIBlockSection $sectionEntity;
27 public static function getId(): string
34 $this->iblockId = $iblockId;
35 $this->columns = $columns;
36 $this->rights = $rights;
39 private function getElementEntity(): CIBlockElement
41 if (!isset($this->elementEntity))
43 $this->elementEntity =
new CIBlockElement();
44 $this->elementEntity->setIblock($this->
getIblockId());
47 return $this->elementEntity;
52 if (!isset($this->sectionEntity))
55 $this->sectionEntity->setIblock($this->
getIblockId());
58 return $this->sectionEntity;
68 return $this->columns;
89 [
$type, $id] = $index;
99 if (!$this->rights->canEditElement($id))
117 if (!$this->rights->canEditSection($id))
119 $message = Loc::getMessage(
'IBLOCK_GRID_PANEL_UI_EDIT_ACTIONS_ITEM_ACCESS_DENIED', [
143 $propertyColumnIds = ElementPropertyProvider::getPropertyIdsFromColumnsIds(array_keys(
$fields));
146 $propertyId = $propertyColumnIds[
$name] ??
null;
147 if (isset($propertyId))
153 $elementFields[
$name] = $value;
168 if (!empty($elementFields))
170 $entity = $this->getElementEntity();
192 $entity = $this->getSectionEntity();
209 $columnId = $column->getId();
210 $value =
$fields[$columnId] ??
null;
216 $editable = $column->getEditable();
217 if (!isset($editable))
221 elseif ($editable->getType() === Types::MULTISELECT)
223 if (is_array($value))
225 $fields[$columnId] = array_column($value,
'VALUE');
228 elseif ($editable->getType() === Types::IMAGE)
230 if ($value ===
'null')
247 if (empty(
$files[
'name']))
254 foreach (
$fields as $fieldName => $fieldValue)
256 $rows[$rowId] ??= [];
257 $rows[$rowId][$fieldName] = [
258 'name' => $fieldValue,
259 'type' =>
$files[
'type'][$rowId][$fieldName] ??
null,
260 'size' =>
$files[
'size'][$rowId][$fieldName] ??
null,
261 'error' =>
$files[
'error'][$rowId][$fieldName] ??
null,
262 'tmp_name' =>
$files[
'tmp_name'][$rowId][$fieldName] ??
null,
263 'full_path' =>
$files[
'full_path'][$rowId][$fieldName] ??
null,
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)