- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/lib/grid/panel/ui/actions/item/elementgroup/createcodegroupchild.php
- Класс: BitrixIblockGridPanelUIActionsItemElementGroupCreateCodeGroupChild
- Вызов: CreateCodeGroupChild::processCodeTranslitSections
private function processCodeTranslitSections(bool $isSelectedAllRows, array $ids): Result
{
$result = new Result();
$entity = new CIBlockSection();
$translitSettings = $this->getSectionTranslitSettings();
$filter = [
'IBLOCK_ID' => $this->getIblockId(),
];
if (!$isSelectedAllRows)
{
$filter['ID'] = $ids;
}
$rows = CIBlockSection::GetList(
[],
$filter + ['CHECK_PERMISSIONS' => 'N'],
false,
[
'ID',
'NAME',
]
);
while ($row = $rows->Fetch())
{
$id = (int)$row['ID'];
if (!$this->getIblockRightsChecker()->canEditSection($id))
{
$message = Loc::getMessage('IBLOCK_GRID_PANEL_UI_CREATE_CODE_GROUP_CHILD_ACCESS_DENIED_SECTION', [
'#ID#' => $id,
]);
$result->addError(
new Error($message)
);
continue;
}
$fields = [
'CODE' => CUtil::translit(
$row['NAME'],
LANGUAGE_ID,
$translitSettings
),
];
$updateResult = $entity->Update($id, $fields);
if (!$updateResult && $entity->LAST_ERROR)
{
$result->addError(
new Error($entity->LAST_ERROR)
);
}
}
return $result;
}