• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/cml2.php
  • Класс: CIBlockCMLImport
  • Вызов: CIBlockCMLImport::CheckCurrency
function CheckCurrency($currency)
{
	global $CML2_CURRENCY;

	if($currency==$this->mess["IBLOCK_XML2_RUB"])
	{
		$currency="RUB";
	}
	elseif(!preg_match("/^[a-zA-Z]+$/", $currency))
	{
		if(
			is_array($CML2_CURRENCY)
			&& isset($CML2_CURRENCY[$currency])
			&& is_string($CML2_CURRENCY[$currency])
			&& preg_match("/^[a-zA-Z0-9]+$/", $CML2_CURRENCY[$currency])
		)
		{
			$currency = $CML2_CURRENCY[$currency];
		}
		else
		{
			$currency="RUB";
			$this->LAST_ERROR = GetMessage("IBLOCK_XML2_CURRENCY_ERROR");
		}
	}

	if(!isset($this->arCurrencyCache[$currency]))
	{
		if($this->bCatalog && $this->currencyIncluded)
		{
			CCurrency::Add(array(
				"CURRENCY" => $currency,
			));
		}
		$this->arCurrencyCache[$currency] = true;
	}

	return $currency;
}