Пример #1
0
 public function getIBlockItems($IBLOCK_ID)
 {
     $items = array();
     foreach (CIBlockSectionPropertyLink::GetArray($IBLOCK_ID, $this->SECTION_ID) as $PID => $arLink) {
         if ($arLink["SMART_FILTER"] !== "Y") {
             continue;
         }
         $rsProperty = CIBlockProperty::GetByID($PID);
         $arProperty = $rsProperty->Fetch();
         if ($arProperty) {
             $items[$arProperty["ID"]] = array("ID" => $arProperty["ID"], "IBLOCK_ID" => $arProperty["IBLOCK_ID"], "CODE" => $arProperty["CODE"], "NAME" => $arProperty["NAME"], "PROPERTY_TYPE" => $arProperty["PROPERTY_TYPE"], "VALUES" => array());
             if ($arProperty["PROPERTY_TYPE"] == "N") {
                 $items[$arProperty["ID"]]["VALUES"] = array("MIN" => array("CONTROL_ID" => htmlspecialcharsbx($this->FILTER_NAME . "_" . $arProperty["ID"] . "_MIN"), "CONTROL_NAME" => htmlspecialcharsbx($this->FILTER_NAME . "_" . $arProperty["ID"] . "_MIN")), "MAX" => array("CONTROL_ID" => htmlspecialcharsbx($this->FILTER_NAME . "_" . $arProperty["ID"] . "_MAX"), "CONTROL_NAME" => htmlspecialcharsbx($this->FILTER_NAME . "_" . $arProperty["ID"] . "_MAX")));
             }
         }
     }
     return $items;
 }
Пример #2
0
	public function getIBlockItems($IBLOCK_ID)
	{
		$items = array();

		foreach(CIBlockSectionPropertyLink::GetArray($IBLOCK_ID, $this->SECTION_ID) as $PID => $arLink)
		{
			if($arLink["SMART_FILTER"] !== "Y")
				continue;

			$rsProperty = CIBlockProperty::GetByID($PID);
			$arProperty = $rsProperty->Fetch();
			if($arProperty)
			{
				$items[$arProperty["ID"]] = array(
					"ID" => $arProperty["ID"],
					"IBLOCK_ID" => $arProperty["IBLOCK_ID"],
					"CODE" => $arProperty["CODE"],
					"NAME" => $arProperty["NAME"],
					"PROPERTY_TYPE" => $arProperty["PROPERTY_TYPE"],
					"USER_TYPE" => $arProperty["USER_TYPE"],
					"USER_TYPE_SETTINGS" => $arProperty["USER_TYPE_SETTINGS"],
					"VALUES" => array(),
				);

				if($arProperty["PROPERTY_TYPE"] == "N")
				{
					$minID = $this->SAFE_FILTER_NAME.'_'.$arProperty['ID'].'_MIN';
					$maxID = $this->SAFE_FILTER_NAME.'_'.$arProperty['ID'].'_MAX';
					$items[$arProperty["ID"]]["VALUES"] = array(
						"MIN" => array(
							"CONTROL_ID" => $minID,
							"CONTROL_NAME" => $minID,
						),
						"MAX" => array(
							"CONTROL_ID" => $maxID,
							"CONTROL_NAME" => $maxID,
						),
					);
				}
			}
		}
		return $items;
	}
Пример #3
0
             $arProperty["PROPERTY_TYPE"] = $_POST["PROPERTY_PROPERTY_TYPE"];
         }
     }
     if (!empty($arListValues)) {
         $arProperty["VALUES"] = $arListValues;
     }
 } elseif (is_array($arPropCheck)) {
     $arProperty = $arPropCheck;
     if ($arProperty['PROPERTY_TYPE'] == "L") {
         $arProperty['VALUES'] = array();
         $rsLists = CIBlockProperty::GetPropertyEnum($arProperty['ID'], array('SORT' => 'ASC', 'ID' => 'ASC'));
         while ($res = $rsLists->Fetch()) {
             $arProperty['VALUES'][$res["ID"]] = array('ID' => $res["ID"], 'VALUE' => $res["VALUE"], 'SORT' => $res['SORT'], 'XML_ID' => $res["XML_ID"], 'DEF' => $res['DEF']);
         }
     }
     $arPropLink = CIBlockSectionPropertyLink::GetArray($intIBlockID, 0);
     if (isset($arPropLink[$arProperty["ID"]])) {
         $arProperty["SECTION_PROPERTY"] = "Y";
         $arProperty["SMART_FILTER"] = $arPropLink[$arProperty["ID"]]["SMART_FILTER"] == 'Y' ? 'Y' : 'N';
         $arProperty["DISPLAY_TYPE"] = $arPropLink[$arProperty["ID"]]["DISPLAY_TYPE"];
         $arProperty["DISPLAY_EXPANDED"] = $arPropLink[$arProperty["ID"]]["DISPLAY_EXPANDED"] == 'Y' ? 'Y' : 'N';
         $arProperty["FILTER_HINT"] = $arPropLink[$arProperty["ID"]]["FILTER_HINT"];
     } else {
         $arProperty["SECTION_PROPERTY"] = "N";
         $arProperty["SMART_FILTER"] = "N";
         $arProperty["DISPLAY_TYPE"] = "";
         $arProperty["DISPLAY_EXPANDED"] = "N";
         $arProperty["FILTER_HINT"] = "";
     }
 } else {
     $arProperty = $arDefPropInfo;
Пример #4
0
        echo GetMessage("IB_E_PROP_CODE_SHORT");
        ?>
</td>
					<td><?php 
        echo GetMessage("IB_E_PROP_MODIFY_SHORT");
        ?>
</td>
					<td><?php 
        echo GetMessage("IB_E_PROP_DELETE_SHORT");
        ?>
</td>
				</tr>
				<?php 
        $arPropList = array();
        if (0 < $ID) {
            $arPropLinks = CIBlockSectionPropertyLink::GetArray($ID, 0);
            $rsProps = CIBlockProperty::GetList(array("SORT" => "ASC", 'ID' => 'ASC'), array("IBLOCK_ID" => $ID, "CHECK_PERMISSIONS" => "N"));
            while ($arProp = $rsProps->Fetch()) {
                if ('L' == $arProp['PROPERTY_TYPE']) {
                    $arProp['VALUES'] = array();
                    $rsLists = CIBlockProperty::GetPropertyEnum($arProp['ID'], array('SORT' => 'ASC', 'ID' => 'ASC'));
                    while ($res = $rsLists->Fetch()) {
                        $arProp['VALUES'][$res["ID"]] = array('ID' => $res["ID"], 'VALUE' => $res["VALUE"], 'SORT' => $res['SORT'], 'XML_ID' => $res["XML_ID"], 'DEF' => $res['DEF']);
                    }
                }
                if (array_key_exists($arProp["ID"], $arPropLinks)) {
                    $arProp["SECTION_PROPERTY"] = "Y";
                    $arProp["SMART_FILTER"] = $arPropLinks[$arProp["ID"]]["SMART_FILTER"];
                    $arProp["DISPLAY_TYPE"] = $arPropLinks[$arProp["ID"]]["DISPLAY_TYPE"];
                    $arProp["DISPLAY_EXPANDED"] = $arPropLinks[$arProp["ID"]]["DISPLAY_EXPANDED"];
                    $arProp["FILTER_HINT"] = $arPropLinks[$arProp["ID"]]["FILTER_HINT"];
Пример #5
0
 function ExportSmartFilter($level, $iblockId, $sectionId = false, $PROPERTY_MAP, $productIblockId = 0)
 {
     $propertyLinksBySection = array();
     if ($sectionId === false) {
         $propertyLinksBySection[0] = CIBlockSectionPropertyLink::GetArray($iblockId, 0);
         foreach ($propertyLinksBySection[0] as $PID => $arLink) {
             if ($arLink["INHERITED"] != "N" || !array_key_exists($PID, $PROPERTY_MAP)) {
                 unset($propertyLinksBySection[0][$PID]);
             } else {
                 if ($productIblockId > 0) {
                     $iblock_xml_id = $this->GetIBlockXML_ID($productIblockId, CIBlock::GetArrayByID($productIblockId, "XML_ID"));
                     $propertyLinksBySection[0][$PID]["IBLOCK_XML_ID"] = $iblock_xml_id;
                 }
             }
         }
         $arFilter = array("IBLOCK_ID" => $productIblockId ? $productIblockId : $iblockId, "CHECK_PERMISSIONS" => "N");
         $rsSections = CIBlockSection::GetList(array("left_margin" => "asc"), $arFilter, false, array("ID", "XML_ID", "IBLOCK_ID"));
         while ($arSection = $rsSections->Fetch()) {
             $section_xml_id = $this->GetSectionXML_ID($arSection["IBLOCK_ID"], $arSection["ID"], $arSection["XML_ID"]);
             $iblock_xml_id = $this->GetIBlockXML_ID($arSection["IBLOCK_ID"], CIBlock::GetArrayByID($arSection["IBLOCK_ID"], "XML_ID"));
             $propertyLinksBySection[$arSection["ID"]] = CIBlockSectionPropertyLink::GetArray($iblockId, $arSection["ID"]);
             foreach ($propertyLinksBySection[$arSection["ID"]] as $PID => $arLink) {
                 if ($arLink["INHERITED"] != "N" || !array_key_exists($PID, $PROPERTY_MAP)) {
                     unset($propertyLinksBySection[$arSection["ID"]][$PID]);
                 } else {
                     $propertyLinksBySection[$arSection["ID"]][$PID]["IBLOCK_XML_ID"] = $iblock_xml_id;
                     $propertyLinksBySection[$arSection["ID"]][$PID]["SECTION_XML_ID"] = $section_xml_id;
                 }
             }
         }
     } else {
         $propertyLinksBySection[$sectionId] = CIBlockSectionPropertyLink::GetArray($iblockId, $sectionId);
         foreach ($propertyLinksBySection[$sectionId] as $PID => $arLink) {
             if ($arLink["INHERITED"] != "N" || !array_key_exists($PID, $PROPERTY_MAP)) {
                 unset($propertyLinksBySection[$sectionId][$PID]);
             }
         }
     }
     $first = true;
     foreach ($propertyLinksBySection as $arPropLink) {
         if (!empty($arPropLink)) {
             if ($first) {
                 fwrite($this->fp, str_repeat("\t", $level) . "<" . GetMessage("IBLOCK_XML2_SECTION_PROPERTIES") . ">\n");
                 $first = false;
             }
             foreach ($arPropLink as $PID => $arLink) {
                 $xmlLink = array(GetMessage("IBLOCK_XML2_ID") => $PROPERTY_MAP[$PID], GetMessage("IBLOCK_XML2_SMART_FILTER") => $arLink["SMART_FILTER"] == "Y" ? "true" : "false", GetMessage("IBLOCK_XML2_SMART_FILTER_DISPLAY_TYPE") => $arLink["DISPLAY_TYPE"], GetMessage("IBLOCK_XML2_SMART_FILTER_DISPLAY_EXPANDED") => $arLink["DISPLAY_EXPANDED"] == "Y" ? "true" : "false", GetMessage("IBLOCK_XML2_SMART_FILTER_HINT") => $arLink["FILTER_HINT"]);
                 if (isset($arLink["IBLOCK_XML_ID"])) {
                     $xmlLink[GetMessage("IBLOCK_XML2_BX_LINKED_IBLOCK")] = $arLink["IBLOCK_XML_ID"];
                 }
                 if (isset($arLink["SECTION_XML_ID"])) {
                     $xmlLink[GetMessage("IBLOCK_XML2_GROUP")] = $arLink["SECTION_XML_ID"];
                 }
                 fwrite($this->fp, $this->formatXMLNode($level + 1, GetMessage("IBLOCK_XML2_PROPERTY"), $xmlLink));
             }
         }
     }
     if (!$first) {
         fwrite($this->fp, str_repeat("\t", $level) . "</" . GetMessage("IBLOCK_XML2_SECTION_PROPERTIES") . ">\n");
     }
 }
Пример #6
0
 public function executeComponent()
 {
     if (!CModule::IncludeModule('sale')) {
         ShowError("Module sale not installed!");
         return;
     }
     if (!CModule::IncludeModule('catalog')) {
         ShowError("Module catalog not installed!");
         return;
     }
     $this->arResult["BITRIX_CATEGORY_ID"] = isset($this->arParams["BITRIX_CATEGORY_ID"]) ? $this->arParams["BITRIX_CATEGORY_ID"] : 0;
     $this->arResult["IBLOCK_ID"] = isset($this->arParams["IBLOCK_ID"]) ? $this->arParams["IBLOCK_ID"] : 0;
     if (isset($this->arParams["EBAY_CATEGORY_ID"])) {
         $this->arResult["EBAY_CATEGORY_ID"] = $this->arParams["EBAY_CATEGORY_ID"];
     } else {
         $this->arResult["EBAY_CATEGORY_ID"] = $this->getMappedEbayCategoryId($this->arResult["BITRIX_CATEGORY_ID"]);
     }
     $this->arResult["TOP_CATEGORIES_LIST"] = $this->getTopCategories();
     $this->arResult["VARIATIONS_BLOCK_ID"] = 'SALE_EBAY_CAT_' . $this->arResult["EBAY_CATEGORY_ID"] . '_VARIATIONS';
     $siteRes = CIBlock::GetSite($this->arResult["IBLOCK_ID"]);
     //todo: It can be many sites for one iblock.
     if ($site = $siteRes->Fetch()) {
         $this->arResult["SITE_ID"] = $site["LID"];
     } else {
         $this->arResult["SITE_ID"] = "";
     }
     if (strlen($this->arResult["EBAY_CATEGORY_ID"]) > 0) {
         $this->arResult["CATEGORY_AND_PARENTS_INFO"] = $this->getCategoryAndParentsInfo($this->arResult["EBAY_CATEGORY_ID"]);
         if (isset($this->arResult["CATEGORY_AND_PARENTS_INFO"][1]["CATEGORY_ID"])) {
             $this->arResult["TOP_CATEGORY_ID"] = $this->arResult["CATEGORY_AND_PARENTS_INFO"][1]["CATEGORY_ID"];
         }
         $this->arResult["EBAY_CATEGORY_VARIATIONS"] = \Bitrix\Sale\TradingPlatform\Ebay\Helper::getEbayCategoryVariations($this->arResult["EBAY_CATEGORY_ID"], $this->arResult["SITE_ID"]);
         if (isset($this->arParams["VARIATIONS_VALUES"])) {
             $this->arResult["VARIATIONS_VALUES"] = $this->arParams["VARIATIONS_VALUES"];
         } else {
             $this->arResult["VARIATIONS_VALUES"] = $this->getVariationsValues($this->arResult["IBLOCK_ID"], $this->arResult["EBAY_CATEGORY_ID"], $this->arResult["EBAY_CATEGORY_VARIATIONS"]);
         }
     } else {
         $this->arResult["VARIATIONS_VALUES"] = array('' => '');
         $this->arResult["EBAY_CATEGORY_VARIATIONS"] = array();
     }
     $this->arResult["CATEGORY_PROPS"] = \CIBlockSectionPropertyLink::GetArray($this->arParams["IBLOCK_ID"], $this->arParams["BITRIX_CATEGORY_ID"]);
     $rsProps = \CIBlockProperty::GetList(array("SORT" => "ASC", 'ID' => 'ASC'), array("IBLOCK_ID" => $this->arParams["IBLOCK_ID"], "CHECK_PERMISSIONS" => "N", "ACTIVE" => "Y"));
     while ($arProp = $rsProps->Fetch()) {
         if (isset($this->arResult["CATEGORY_PROPS"][$arProp["ID"]])) {
             $this->arResult["CATEGORY_PROPS"][$arProp["ID"]]["NAME"] = $arProp["NAME"];
         }
     }
     $this->arResult["IBLOCK_IDS"] = array($this->arParams["IBLOCK_ID"] => Loc::getMessage("SALE_EBAY_SEC_CATEGORY_PROP"));
     $arOffers = \CCatalogSKU::GetInfoByProductIBlock($this->arParams["IBLOCK_ID"]);
     if (is_array($arOffers) && !empty($arOffers)) {
         $this->arResult["OFFERS_IBLOCK_ID"] = $arOffers["IBLOCK_ID"];
         $this->arResult["CATEGORY_OFFERS_PROPS"] = \CIBlockSectionPropertyLink::GetArray($arOffers["IBLOCK_ID"], $this->arParams["BITRIX_CATEGORY_ID"]);
         $rsProps = \CIBlockProperty::GetList(array("SORT" => "ASC", 'ID' => 'ASC'), array("IBLOCK_ID" => $arOffers["IBLOCK_ID"], "CHECK_PERMISSIONS" => "N", "ACTIVE" => "Y"));
         while ($arProp = $rsProps->Fetch()) {
             if (isset($this->arResult["CATEGORY_OFFERS_PROPS"][$arProp["ID"]])) {
                 $this->arResult["CATEGORY_OFFERS_PROPS"][$arProp["ID"]]["NAME"] = $arProp["NAME"];
             }
         }
         $this->arResult["IBLOCK_IDS"][$arOffers["IBLOCK_ID"]] = Loc::getMessage("SALE_EBAY_SEC_OFFERS_PROP");
     }
     $this->IncludeComponentTemplate();
 }
Пример #7
0
if(!empty($PROP)):
	if ($arIBlock["SECTION_PROPERTY"] === "Y" || defined("CATALOG_PRODUCT"))
	{
		$arPropLinks = array("IBLOCK_ELEMENT_PROP_VALUE");
		if(is_array($str_IBLOCK_ELEMENT_SECTION) && !empty($str_IBLOCK_ELEMENT_SECTION))
		{
			foreach($str_IBLOCK_ELEMENT_SECTION as $section_id)
			{
				foreach(CIBlockSectionPropertyLink::GetArray($IBLOCK_ID, $section_id) as $PID => $arLink)
					$arPropLinks[$PID] = "PROPERTY_".$PID;
			}
		}
		else
		{
			foreach(CIBlockSectionPropertyLink::GetArray($IBLOCK_ID, 0) as $PID => $arLink)
				$arPropLinks[$PID] = "PROPERTY_".$PID;
		}
		$tabControl->AddFieldGroup("IBLOCK_ELEMENT_PROPERTY", GetMessage("IBLOCK_ELEMENT_PROP_VALUE"), $arPropLinks, $bPropertyAjax);
	}

	$tabControl->AddSection("IBLOCK_ELEMENT_PROP_VALUE", GetMessage("IBLOCK_ELEMENT_PROP_VALUE"));

	foreach($PROP as $prop_code=>$prop_fields):
		$prop_values = $prop_fields["VALUE"];
		$tabControl->BeginCustomField("PROPERTY_".$prop_fields["ID"], $prop_fields["NAME"], $prop_fields["IS_REQUIRED"]==="Y");
		?>
		<tr id="tr_PROPERTY_<?echo $prop_fields["ID"];?>"<?if ($prop_fields["PROPERTY_TYPE"]=="F"):?> class="adm-detail-file-row"<?endif?>>
			<td class="adm-detail-valign-top" width="40%"><?if($prop_fields["HINT"]!=""):
				?><span id="hint_<?echo $prop_fields["ID"];?>"></span><script type="text/javascript">BX.hint_replace(BX('hint_<?echo $prop_fields["ID"];?>'), '<?echo CUtil::JSEscape($prop_fields["HINT"])?>');</script>&nbsp;<?
			endif;?><?echo $tabControl->GetCustomLabelHTML();?>:</td>
Пример #8
0
 public function getIBlockItems($IBLOCK_ID)
 {
     $items = array();
     foreach (CIBlockSectionPropertyLink::GetArray($IBLOCK_ID, $this->SECTION_ID) as $PID => $arLink) {
         if ($arLink["SMART_FILTER"] !== "Y") {
             continue;
         }
         if ($arLink['FILTER_HINT'] != '') {
             $arLink['FILTER_HINT'] = CTextParser::closeTags($arLink['FILTER_HINT']);
         }
         $rsProperty = CIBlockProperty::GetByID($PID);
         $arProperty = $rsProperty->Fetch();
         if ($arProperty) {
             $items[$arProperty["ID"]] = array("ID" => $arProperty["ID"], "IBLOCK_ID" => $arProperty["IBLOCK_ID"], "CODE" => $arProperty["CODE"], "NAME" => $arProperty["NAME"], "PROPERTY_TYPE" => $arProperty["PROPERTY_TYPE"], "USER_TYPE" => $arProperty["USER_TYPE"], "USER_TYPE_SETTINGS" => $arProperty["USER_TYPE_SETTINGS"], "DISPLAY_TYPE" => $arLink["DISPLAY_TYPE"], "DISPLAY_EXPANDED" => $arLink["DISPLAY_EXPANDED"], "FILTER_HINT" => $arLink["FILTER_HINT"], "VALUES" => array());
             if ($arProperty["PROPERTY_TYPE"] == "N" || $arLink["DISPLAY_TYPE"] == "U") {
                 $minID = $this->SAFE_FILTER_NAME . '_' . $arProperty['ID'] . '_MIN';
                 $maxID = $this->SAFE_FILTER_NAME . '_' . $arProperty['ID'] . '_MAX';
                 $items[$arProperty["ID"]]["VALUES"] = array("MIN" => array("CONTROL_ID" => $minID, "CONTROL_NAME" => $minID), "MAX" => array("CONTROL_ID" => $maxID, "CONTROL_NAME" => $maxID));
             }
         }
     }
     return $items;
 }
Пример #9
0
						if(tbl.rows[i].style.display != 'none')
							display = 'none';
					}
					tr.style.display = display;
				}
			}
			</script>
		</td></tr>
		<?
		$arCatalog = false;
		if (CModule::IncludeModule("catalog"))
			$arCatalog = CCatalog::GetSkuInfoByProductID($IBLOCK_ID);

		if (is_array($arCatalog))
		{
			$arPropLinks = CIBlockSectionPropertyLink::GetArray($arCatalog["IBLOCK_ID"], 0);
		?>
		<tr colspan="2" class="heading">
			<td align="center"><?echo GetMessage("CAT_CEDIT_PROP_SKU_SECTION");?></td>
		</tr>
		<tr colspan="2"><td align="center">
			<table class="internal" id="table_SKU_SECTION_PROPERTY">
			<tr class="heading">
				<td><?echo GetMessage("CAT_CEDIT_PROP_TABLE_NAME");?></td>
				<td><?echo GetMessage("CAT_CEDIT_PROP_TABLE_TYPE");?></td>
				<td><?echo GetMessage("CAT_CEDIT_PROP_TABLE_SMART_FILTER");?></td>
				<td><?echo GetMessage("CAT_CEDIT_PROP_TABLE_ACTION");?></td></tr>
			<?
			if(CIBlockRights::UserHasRightTo($arCatalog["IBLOCK_ID"], $arCatalog["IBLOCK_ID"], "iblock_edit"))
				$arShadow = $arHidden = array(
					-1 => GetMessage("CAT_CEDIT_PROP_SELECT_CHOOSE"),
Пример #10
0
	function ExportProperties(&$PROPERTY_MAP)
	{
		$PROPERTY_MAP = array();

		fwrite($this->fp, "\t\t<".GetMessage("IBLOCK_XML2_PROPERTIES").">\n");

		if($this->bExtended)
		{
			$arElementFields = array(
				"CML2_ACTIVE" => GetMessage("IBLOCK_XML2_BX_ACTIVE"),
				"CML2_CODE" => GetMessage("IBLOCK_XML2_SYMBOL_CODE"),
				"CML2_SORT" => GetMessage("IBLOCK_XML2_SORT"),
				"CML2_ACTIVE_FROM" => GetMessage("IBLOCK_XML2_START_TIME"),
				"CML2_ACTIVE_TO" => GetMessage("IBLOCK_XML2_END_TIME"),
				"CML2_PREVIEW_TEXT" => GetMessage("IBLOCK_XML2_ANONS"),
				"CML2_DETAIL_TEXT" => GetMessage("IBLOCK_XML2_DETAIL"),
				"CML2_PREVIEW_PICTURE" => GetMessage("IBLOCK_XML2_PREVIEW_PICTURE"),
			);

			foreach($arElementFields as $key => $value)
				fwrite($this->fp, $this->formatXMLNode(3, GetMessage("IBLOCK_XML2_PROPERTY"), array(
					GetMessage("IBLOCK_XML2_ID") => $key,
					GetMessage("IBLOCK_XML2_NAME") => $value,
					GetMessage("IBLOCK_XML2_MULTIPLE") => "false",
				)));
		}

		$arFilter = array(
			"IBLOCK_ID" => $this->arIBlock["ID"],
			"ACTIVE" => "Y",
		);
		$arSort = array(
			"sort" => "asc",
		);

		$obProp = new CIBlockProperty();
		$rsProp = $obProp->GetList($arSort, $arFilter);
		while($arProp = $rsProp->Fetch())
		{
			fwrite($this->fp, "\t\t\t<".GetMessage("IBLOCK_XML2_PROPERTY").">\n");

			$xml_id = $this->GetPropertyXML_ID($this->arIBlock["ID"], $arProp["NAME"], $arProp["ID"], $arProp["XML_ID"]);
			$PROPERTY_MAP[$arProp["ID"]] = $xml_id;
			fwrite($this->fp, $this->formatXMLNode(4, GetMessage("IBLOCK_XML2_ID"), $xml_id));

			fwrite($this->fp, $this->formatXMLNode(4, GetMessage("IBLOCK_XML2_NAME"), $arProp["NAME"]));
			fwrite($this->fp, $this->formatXMLNode(4, GetMessage("IBLOCK_XML2_MULTIPLE"), ($arProp["MULTIPLE"]=="Y"? "true": "false")));
			if($arProp["PROPERTY_TYPE"]=="L")
			{
				fwrite($this->fp, "\t\t\t\t<".GetMessage("IBLOCK_XML2_CHOICE_VALUES").">\n");
				$rsEnum = CIBlockProperty::GetPropertyEnum($arProp["ID"]);
				while($arEnum = $rsEnum->Fetch())
				{
					fwrite($this->fp, $this->formatXMLNode(5, GetMessage("IBLOCK_XML2_VALUE"), $arEnum["VALUE"]));
					if($this->bExtended)
					{
						fwrite($this->fp,
							"\t\t\t\t\t<".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"]))
							."\t\t\t\t\t</".GetMessage("IBLOCK_XML2_CHOICE").">\n"
						);
					}
				}
				fwrite($this->fp, "\t\t\t\t</".GetMessage("IBLOCK_XML2_CHOICE_VALUES").">\n");
			}

			if($this->bExtended)
			{
				fwrite($this->fp,
					$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_SORT"), intval($arProp["SORT"]))
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_CODE"), $arProp["CODE"])
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_PROPERTY_TYPE"), $arProp["PROPERTY_TYPE"])
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_ROWS"), $arProp["ROW_COUNT"])
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_COLUMNS"), $arProp["COL_COUNT"])
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_LIST_TYPE"), $arProp["LIST_TYPE"])
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_FILE_EXT"), $arProp["FILE_TYPE"])
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_FIELDS_COUNT"), $arProp["MULTIPLE_CNT"])
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_LINKED_IBLOCK"), $this->GetIBlockXML_ID($arProp["LINK_IBLOCK_ID"]))
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_WITH_DESCRIPTION"), ($arProp["WITH_DESCRIPTION"]=="Y"? "true": "false"))
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_SEARCH"), ($arProp["SEARCHABLE"]=="Y"? "true": "false"))
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_FILTER"), ($arProp["FILTRABLE"]=="Y"? "true": "false"))
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_USER_TYPE"), $arProp["USER_TYPE"])
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_IS_REQUIRED"), ($arProp["IS_REQUIRED"]=="Y"? "true": "false"))
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_BX_DEFAULT_VALUE"), serialize($arProp["DEFAULT_VALUE"]))
					.$this->formatXMLNode(4, GetMessage("IBLOCK_XML2_SERIALIZED"), 1)
				);
			}
			fwrite($this->fp, "\t\t\t</".GetMessage("IBLOCK_XML2_PROPERTY").">\n");
		}
		fwrite($this->fp, "\t\t</".GetMessage("IBLOCK_XML2_PROPERTIES").">\n");

		if($this->bExtended)
		{
			$arPropLink = CIBlockSectionPropertyLink::GetArray($this->arIBlock["ID"], 0);
			foreach($arPropLink as $PID => $arLink)
				if($arLink["INHERITED"] != "N" || !array_key_exists($PID, $PROPERTY_MAP))
					unset($arPropLink[$PID]);
			if(!empty($arPropLink))
			{
				fwrite($this->fp, "\t\t<".GetMessage("IBLOCK_XML2_SECTION_PROPERTIES").">\n");
				foreach($arPropLink as $PID => $arLink)
				{
					fwrite($this->fp, "\t\t\t<".GetMessage("IBLOCK_XML2_PROPERTY").">\n");
					fwrite($this->fp, "\t\t\t\t<".GetMessage("IBLOCK_XML2_ID").">".htmlspecialcharsbx($PROPERTY_MAP[$PID])."</".GetMessage("IBLOCK_XML2_ID").">\n");
					fwrite($this->fp, "\t\t\t\t<".GetMessage("IBLOCK_XML2_SMART_FILTER").">".($arLink["SMART_FILTER"] == "Y"? "true": "false")."</".GetMessage("IBLOCK_XML2_SMART_FILTER").">\n");
					fwrite($this->fp, "\t\t\t</".GetMessage("IBLOCK_XML2_PROPERTY").">\n");
				}
				fwrite($this->fp, "\t\t</".GetMessage("IBLOCK_XML2_SECTION_PROPERTIES").">\n");
			}
		}
	}
Пример #11
0
 /**
  * @param int $iblockId Iblock Id.
  * @param int $sectionId Section Id.
  * @return array Iblock properties list.
  */
 public static function getPropertiesList($iblockId, $sectionId = 0)
 {
     $result = \CIBlockSectionPropertyLink::GetArray($iblockId, $sectionId);
     $rsProps = \CIBlockProperty::GetList(array("SORT" => "ASC", 'ID' => 'ASC'), array("IBLOCK_ID" => $iblockId, "CHECK_PERMISSIONS" => "N", "ACTIVE" => "Y"));
     while ($arProp = $rsProps->Fetch()) {
         if (isset($result[$arProp["ID"]])) {
             $result[$arProp["ID"]]["NAME"] = $arProp["NAME"];
         }
     }
     return $result;
 }
Пример #12
0
				<td><?php 
    echo GetMessage("IBSEC_E_PROP_TABLE_SMART_FILTER");
    ?>
</td>
				<td><?php 
    echo GetMessage("IBSEC_E_PROP_TABLE_ACTION");
    ?>
</td>
			</tr>
			<?php 
    if (CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit")) {
        $arShadow = $arHidden = array(-1 => GetMessage("IBSEC_E_PROP_SELECT_CHOOSE"), 0 => GetMessage("IBSEC_E_PROP_SELECT_CREATE"));
    } else {
        $arShadow = $arHidden = array(-1 => GetMessage("IBSEC_E_PROP_SELECT_CHOOSE"));
    }
    $arPropLinks = CIBlockSectionPropertyLink::GetArray($arIBlock["ID"], $ID, $ID <= 0);
    $rsProps = CIBlockProperty::GetList(array("SORT" => "ASC", 'ID' => 'ASC'), array("IBLOCK_ID" => $arIBlock["ID"], "CHECK_PERMISSIONS" => "N", "ACTIVE" => "Y"));
    $rows = 0;
    while ($arProp = $rsProps->Fetch()) {
        if (array_key_exists($arProp["ID"], $arPropLinks)) {
            $rows++;
            $arLink = $arPropLinks[$arProp["ID"]];
            if ($arLink["INHERITED"] == "N") {
                $arShadow[$arProp["ID"]] = $arProp["NAME"];
            }
        } else {
            $arLink = false;
            $arHidden[$arProp["ID"]] = $arProp["NAME"];
            $arShadow[$arProp["ID"]] = $arProp["NAME"];
        }
        ?>