• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/cml2.php
  • Класс: CIBlockCMLExport
  • Вызов: CIBlockCMLExport::ExportSectionsProperties
function ExportSectionsProperties($arUserFields)
{
	if(empty($arUserFields))
		return;

	fwrite($this->fp, "tt<".GetMessage("IBLOCK_XML2_GROUPS_PROPERTIES").">n");
	foreach($arUserFields as $FIELD_ID => $arField)
	{
		fwrite($this->fp, "ttt<".GetMessage("IBLOCK_XML2_PROPERTY").">n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_ID").">".htmlspecialcharsbx($arField["XML_ID"])."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_NAME").">".htmlspecialcharsbx($FIELD_ID)."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_SORT").">".htmlspecialcharsbx($arField["SORT"])."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_MULTIPLE").">".($arField["MULTIPLE"] == "Y"? "true": "false")."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_BX_PROPERTY_TYPE").">".htmlspecialcharsbx($arField["USER_TYPE_ID"])."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_BX_IS_REQUIRED").">".($arField["MANDATORY"] == "Y"? "true": "false")."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_BX_FILTER").">".($arField["SHOW_FILTER"] == "Y"? "true": "false")."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_BX_SHOW_IN_LIST").">".($arField["SHOW_IN_LIST"] == "Y"? "true": "false")."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_BX_EDIT_IN_LIST").">".($arField["EDIT_IN_LIST"] == "Y"? "true": "false")."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_BX_SEARCH").">".($arField["IS_SEARCHABLE"] == "Y"? "true": "false")."n");
		fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_BX_SETTINGS").">".htmlspecialcharsbx(serialize($arField["SETTINGS"]))."n");

		if (is_callable(array($arField["USER_TYPE"]['CLASS_NAME'], 'getlist')))
		{
			fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_CHOICE_VALUES").">n");

			$rsEnum = call_user_func_array(
				array($arField["USER_TYPE"]["CLASS_NAME"], "getlist"),
				array(
					$arField,
				)
			);
			if (is_object($rsEnum))
			{
				while ($arEnum = $rsEnum->GetNext())
				{
					fwrite($this->fp,
						"ttttt<".GetMessage("IBLOCK_XML2_CHOICE").">n"
						.$this->formatXMLNode(6, GetMessage("IBLOCK_XML2_ID"), $arEnum["XML_ID"])
						.$this->formatXMLNode(6, GetMessage("IBLOCK_XML2_VALUE"), $arEnum["VALUE"])
						.$this->formatXMLNode(6, GetMessage("IBLOCK_XML2_BY_DEFAULT"), ($arEnum["DEF"] == "Y" ? "true" : "false"))
						.$this->formatXMLNode(6, GetMessage("IBLOCK_XML2_SORT"), intval($arEnum["SORT"]))
						."tttttn"
					);
				}
			}
			unset($rsEnum);

			fwrite($this->fp, "ttttn");
		}

		fwrite($this->fp, "tttn");
	}
	fwrite($this->fp, "ttn");
}