30 public static function getId(): string
37 return Loc::getMessage(
'IBLOCK_GRID_PANEL_UI_ACTIONS_ELEMENT_GROUP_CREATE_CODE_NAME_MSGVER_1');
49 if ($isSelectedAllRows)
51 [$elements, $sections] = $this->getItemsByFilter($select, $filter);
63 $elements = $this->getElementsByIdList($select, $elementIds);
64 $sections = $this->getSectionsByIdList($select, $sectionIds);
66 unset($elementIds, $sectionIds);
72 $this->processCodeTranslitElements($elements)->
getErrors()
79 $this->processCodeTranslitSections($sections)->
getErrors()
88 $confirmMessage =
Loc::getMessage(
'IBLOCK_GRID_PANEL_UI_ACTIONS_ELEMENT_GROUP_CREATE_CODE_CONFIRM');
92 'ACTION' => Actions::RESET_CONTROLS,
95 'ACTION' => Actions::CREATE,
97 (
new Snippet)->getSendSelectedButton($confirmMessage),
103 private function processCodeTranslitElements(array $elements):
Result
106 $entity =
new CIBlockElement();
107 $translitSettings = $this->getElementTranslitSettings();
109 foreach ($elements as $row)
115 $message =
Loc::getMessage(
'IBLOCK_GRID_PANEL_UI_CREATE_CODE_GROUP_CHILD_ACCESS_DENIED_ELEMENT', [
126 'CODE' => CUtil::translit(
132 $updateResult = $entity->Update($id, $fields);
133 if (!$updateResult && $entity->getLastError())
136 new Error($entity->getLastError())
144 private function processCodeTranslitSections(array $sections):
Result
147 $entity =
new CIBlockSection();
148 $translitSettings = $this->getSectionTranslitSettings();
150 foreach ($sections as $row)
156 $message =
Loc::getMessage(
'IBLOCK_GRID_PANEL_UI_CREATE_CODE_GROUP_CHILD_ACCESS_DENIED_SECTION', [
167 'CODE' => CUtil::translit(
173 $updateResult = $entity->Update($id, $fields);
174 if (!$updateResult && $entity->getLastError())
177 new Error($entity->getLastError())
getRequestRows(HttpRequest $request)
static getMessage($code, $replace=null, $language=null)