• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/lib/importer.php
  • Класс: BitrixListsImporter
  • Вызов: Importer::installProcesses
static function installProcesses($lang, $siteId = null)
{
	if (empty($lang))
		throw new MainArgumentNullException("lang");

	if (! MainLoader::includeModule("bizproc"))
		return;

	$iblockType = static::getIBlockType();

	$db = CIBlockType::GetList(array(), array("=ID" => $iblockType));
	$res = $db->Fetch();
	if (!$res)
		static::createIBlockType();

	if(in_array($lang, self::$listRuLanguage))
		$lang = 'ru';

	$dir = new MainIODirectory(MainLoader::getDocumentRoot() . static::PATH . $lang . "/");
	if(!$dir->isExists())
		$dir = new MainIODirectory(MainLoader::getDocumentRoot() . static::PATH . "en/");

	if ($dir->isExists())
	{
		$children = $dir->getChildren();
		foreach ($children as $child)
		{
			/** @var MainIOFile $child */
			if ($child->isFile() && ($child->getExtension() == "prc"))
			{
				static::import($iblockType, $child->getContents(), $siteId);
			}
		}
	}
}