Csv::cancelAction

  1. Bitrix24 API (v. 23.675.0)
  2. translate
  3. Csv
  4. cancelAction
  • Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/controller/export/csv.php
  • Класс: Bitrix\Translate\Controller\Export\Csv
  • Вызов: Csv::cancelAction
public function cancelAction($tabId): array
{
	if (empty($tabId))
	{
		throw new Main\ArgumentException("Missing 'tabId' parameter");
	}

	$this
		->keepField('export')
		->keepField('samples')
		->restoreProgressParameters();

	foreach (['export', 'samples'] as $type)
	{
		if (!empty($this->{$type}['filePath']))
		{
			$path = new Main\IO\File($this->{$type}['filePath']);
			if ($path->isExists())
			{
				$path->delete();
			}
		}
	}

	$this->clearProgressParameters();

	return [
		'SUMMARY' => Loc::getMessage('TR_EXPORT_ACTION_CANCEL'),
		'STATUS' => Translate\Controller\STATUS_COMPLETED
	];
}

Добавить комментарий