• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/controller/export/exportaction.php
  • Класс: BitrixTranslateControllerExportExportAction
  • Вызов: ExportAction::__construct
public function __construct($name, MainEngineController $controller, array $config = [])
{
	$this->filter = new TranslateFilter();

	Loc::loadLanguageFile(__FILE__);

	if ($this instanceof TranslateControllerIProcessParameters)
	{
		$this->keepField([
			'tabId',
			'exportFileName',
			'exportFilePath',
			'exportFileSize',
			'exportedPhraseCount',
			'collectUntranslated',
			'appendSamples',
			'samplesCount',
			'samplesRestriction',
			'samplesFileName',
			'samplesFilePath',
			'samplesFileSize',
			'exportedSamplesCount',
			'convertEncoding',
			'encodingOut',
			'languages'
		]);
	}

	$fields = [
		'collectUntranslated',
		'appendSamples',
		'samplesCount',
		'samplesRestriction',
		'convertEncoding',
		'encodingOut',
		'languages',
		'filter'
	];
	foreach ($fields as $key)
	{
		if (isset($config[$key]))
		{
			if ($key == 'filter')
			{
				if (!$config[$key] instanceof TranslateFilter)
				{
					continue;
				}
			}
			$this->{$key} = $config[$key];
		}
	}

	self::$documentRoot = rtrim(TranslateIOPath::tidy(MainApplication::getDocumentRoot()), '/');

	self::$useTranslationRepository = MainLocalizationTranslation::useTranslationRepository();
	if (self::$useTranslationRepository)
	{
		self::$translationRepositoryLanguages = TranslateConfig::getTranslationRepositoryLanguages();
	}

	if (in_array('all', $this->languages) || empty($this->languages))
	{
		$this->languages = TranslateConfig::getEnabledLanguages();
	}

	parent::__construct($name, $controller, $config);
}