- Модуль: translate
- Путь к файлу: ~/bitrix/modules/translate/lib/controller/import/csv.php
- Класс: BitrixTranslateControllerImportCsv
- Вызов: Csv::indexAction
public function indexAction(): array
{
if ($this->reindex !== true)
{
return [
'STATUS' => TranslateControllerSTATUS_COMPLETED,
'SUMMARY' => Loc::getMessage('TR_IMPORT_COMPLETED')
];
}
$action = new TranslateControllerImportIndexCsv(
self::ACTION_INDEX,
$this,
[
'tabId' => $this->tabId,
'csvFilePath' => $this->csvFilePath,
]
);
$result = $action->run(true);
if (count($action->getErrors()) > 0)
{
$this->addErrors($action->getErrors());
}
if ($action instanceof TranslateControllerITimeLimit)
{
if ($action->hasProcessCompleted())
{
$result['SUMMARY'] = Loc::getMessage('TR_IMPORT_COMPLETED');
}
else
{
$messagePlaceholders = [
'#TOTAL_FILES#' => $result['TOTAL_ITEMS'],
'#PROCESSED_FILES#' => $result['PROCESSED_ITEMS'],
];
$result['SUMMARY'] = Loc::getMessage('TR_INDEX_ACTION_STATS', $messagePlaceholders);
}
}
else
{
$result['SUMMARY'] = Loc::getMessage('TR_IMPORT_COMPLETED');
}
return $result;
}