• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/cml2.php
  • Класс: CIBlockCMLImport
  • Вызов: CIBlockCMLImport::Init
function Init(&$next_step, $files_dir = false, $use_crc = true, $preview = false, $detail = false, $use_offers = false, $use_iblock_type_id = false, $table_name = "b_xml_tree")
{
	global $USER;
	$this->currentUserId = (isset($USER) && $USER instanceof CUser ? (int)$USER->GetID() : 0);

	$this->next_step = &$next_step;
	$this->files_dir = $files_dir;
	$this->use_offers = $use_offers;
	$this->use_iblock_type_id = $use_iblock_type_id;
	$this->use_crc = $use_crc;

	$this->_xml_file = new CIBlockXMLFile($table_name);

	if(!is_array($preview) && $preview)
		$this->iblock_resize = true;

	if(is_array($preview) && count($preview)==2)
		$this->preview = $preview;
	else
		$this->preview = false;

	if(is_array($detail) && count($detail)==2)
		$this->detail = $detail;
	else
		$this->detail = false;

	$this->bCatalog = Loader::includeModule('catalog');
	$this->currencyIncluded = Loader::includeModule('currency');
	$this->bitrix24mode = ModuleManager::isModuleInstalled('bitrix24');
	$this->arProperties = array();
	$this->PROPERTY_MAP = array();
	if (isset($this->next_step["IBLOCK_ID"]) && $this->next_step["IBLOCK_ID"] > 0)
	{
		$obProperty = new CIBlockProperty;
		$rsProperties = $obProperty->GetList(array(), array("IBLOCK_ID"=>$this->next_step["IBLOCK_ID"], "ACTIVE"=>"Y"));
		while($arProperty = $rsProperties->Fetch())
		{
			$this->PROPERTY_MAP[$arProperty["XML_ID"]] = $arProperty["ID"];
			$this->arProperties[$arProperty["ID"]] = $arProperty;
		}

		if ($this->bCatalog)
		{
			$catalogsIterator = BitrixCatalogCatalogIblockTable::getList(array(
				'select' => array('IBLOCK_ID'),
				'filter' => array('=IBLOCK_ID' => $this->next_step["IBLOCK_ID"])
			));
			if ($catalogData = $catalogsIterator->fetch())
				$this->isCatalogIblock = true;
			unset($catalogData, $catalogsIterator);
		}
	}

	if (isset($this->next_step['lang']) && $this->next_step['lang'])
	{
		$this->mess = MainLocalizationLoc::loadLanguageFile(__FILE__, $this->next_step['lang']);
	}

	$this->arTempFiles = array();
	$this->arLinkedProps = false;
}