• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/cml2.php
  • Класс: CIBlockCMLExport
  • Вызов: CIBlockCMLExport::Init
function Init($fp, $IBLOCK_ID, $next_step, $bExtended=false, $work_dir=false, $file_dir=false, $bCheckPermissions = true, $PRODUCT_IBLOCK_ID = false)
{
	$this->fp = $fp;
	$this->IBLOCK_ID = intval($IBLOCK_ID);
	$this->bExtended = $bExtended;
	$this->work_dir = $work_dir;
	$this->file_dir = $file_dir;
	$this->next_step = $next_step;
	$this->only_price = false;
	$this->download_files = true;
	$this->PRODUCT_IBLOCK_ID = intval($PRODUCT_IBLOCK_ID);

	$arFilter = array(
		"ID" => $this->IBLOCK_ID,
		"MIN_PERMISSION" => "W",
	);
	if(!$bCheckPermissions)
		$arFilter["CHECK_PERMISSIONS"] = "N";

	$rsIBlock = CIBlock::GetList(array(), $arFilter);
	if(($this->arIBlock = $rsIBlock->Fetch()) && ($this->arIBlock["ID"]==$this->IBLOCK_ID))
	{
		$this->next_step["catalog"] = Loader::includeModule('catalog');
		if($this->next_step["catalog"])
		{
			$rs = CCatalog::GetList(array(),array("IBLOCK_ID"=>$this->arIBlock["ID"]));
			if($rs->Fetch())
			{
				$this->next_step["catalog"] = true;
				$this->prices = array();
				foreach (CatalogGroupTable::getTypeList() as $arPrice)
				{
					$this->prices[$arPrice["ID"]] = $arPrice["NAME"];
				}
			}
			else
			{
				$this->next_step["catalog"] = false;
			}
		}
		return true;
	}
	else
		return false;
}