- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/classes/general/cml2.php
- Класс: CIBlockCMLExport
- Вызов: CIBlockCMLExport::exportElementProperties
function exportElementProperties($arElement, $PROPERTY_MAP)
{
if($this->bExtended)
{
$this->ExportPropertyValue("CML2_ACTIVE", ($arElement["ACTIVE"]=="Y"? "true": "false"));
$this->ExportPropertyValue("CML2_CODE", $arElement["CODE"]);
$this->ExportPropertyValue("CML2_SORT", intval($arElement["SORT"]));
$this->ExportPropertyValue("CML2_ACTIVE_FROM", CDatabase::FormatDate($arElement["ACTIVE_FROM"], CLang::GetDateFormat("FULL"), "YYYY-MM-DD HH:MI:SS"));
$this->ExportPropertyValue("CML2_ACTIVE_TO", CDatabase::FormatDate($arElement["ACTIVE_TO"], CLang::GetDateFormat("FULL"), "YYYY-MM-DD HH:MI:SS"));
$this->ExportPropertyValue("CML2_PREVIEW_TEXT", $arElement["PREVIEW_TEXT"], $arElement["PREVIEW_TEXT_TYPE"]);
$this->ExportPropertyValue("CML2_DETAIL_TEXT", $arElement["DETAIL_TEXT"], $arElement["DETAIL_TEXT_TYPE"]);
$this->ExportPropertyValue("CML2_PREVIEW_PICTURE", $this->ExportFile($arElement["PREVIEW_PICTURE"]));
}
$arProps = $this->preparePropertiesValues($arElement);
foreach($arProps as $pid => $arProp)
{
$bEmpty = true;
if($this->next_step["catalog"] && !$this->bExtended)
fwrite($this->fp, "ttttt<".GetMessage("IBLOCK_XML2_ITEM_ATTRIBUTE").">n");
else
fwrite($this->fp, "ttttt<".GetMessage("IBLOCK_XML2_PROPERTY_VALUES").">n");
if($this->next_step["catalog"] && !$this->bExtended)
fwrite($this->fp, "tttttt<".GetMessage("IBLOCK_XML2_NAME").">".htmlspecialcharsbx($PROPERTY_MAP["~".$pid])."".GetMessage("IBLOCK_XML2_NAME").">n");
else
fwrite($this->fp, "tttttt<".GetMessage("IBLOCK_XML2_ID").">".htmlspecialcharsbx($PROPERTY_MAP[$pid])."".GetMessage("IBLOCK_XML2_ID").">n");
foreach($arProp["VALUES"] as $arValue)
{
$value = $arValue["VALUE"];
if(is_array($value) || (string)$value != '')
{
$bEmpty = false;
$bSerialized = false;
$this->preparePropertyValue($arProp, $arValue, $value, $bSerialized);
fwrite($this->fp, $this->formatXMLNode(6, GetMessage("IBLOCK_XML2_VALUE"), $value));
if($this->bExtended)
{
fwrite($this->fp, "tttttt<".GetMessage("IBLOCK_XML2_PROPERTY_VALUE").">n");
if($bSerialized)
fwrite($this->fp, "ttttttt<".GetMessage("IBLOCK_XML2_SERIALIZED").">true".GetMessage("IBLOCK_XML2_SERIALIZED").">n");
fwrite($this->fp, $this->formatXMLNode(7, GetMessage("IBLOCK_XML2_VALUE"), $value));
fwrite($this->fp, "ttttttt<".GetMessage("IBLOCK_XML2_DESCRIPTION").">".htmlspecialcharsbx($arValue["DESCRIPTION"])."".GetMessage("IBLOCK_XML2_DESCRIPTION").">n");
fwrite($this->fp, "tttttt".GetMessage("IBLOCK_XML2_PROPERTY_VALUE").">n");
}
}
}
if($bEmpty)
fwrite($this->fp, "tttttt<".GetMessage("IBLOCK_XML2_VALUE").">".GetMessage("IBLOCK_XML2_VALUE").">n");
if($this->next_step["catalog"] && !$this->bExtended)
fwrite($this->fp, "ttttt".GetMessage("IBLOCK_XML2_ITEM_ATTRIBUTE").">n");
else
fwrite($this->fp, "ttttt".GetMessage("IBLOCK_XML2_PROPERTY_VALUES").">n");
}
}