} if (preg_match("/^(G|G:|E|E:)/", $data["TYPE"])) { $arResult["LINK_IBLOCKS"] = CLists::GetIBlocks($arParams["~IBLOCK_TYPE_ID"], !$arParams["CAN_EDIT"], $arParams["~SOCNET_GROUP_ID"]); if (substr($data["TYPE"], 0, 1) == "G") { unset($arResult["LINK_IBLOCKS"][$arResult["IBLOCK_ID"]]); } } $arResult["FORM_DATA"] = array(); foreach ($data as $key => $value) { $arResult["FORM_DATA"]["~" . $key] = $value; if (is_array($value)) { foreach ($value as $key1 => $value1) { $value[$key1] = htmlspecialcharsbx($value1); } $arResult["FORM_DATA"][$key] = $value; } else { $arResult["FORM_DATA"][$key] = htmlspecialcharsbx($value); } } $arResult["CAN_BE_MULTIPLE"] = !$obList->is_field($data["TYPE"]); $arResult["CAN_BE_OPTIONAL"] = $data["TYPE"] != "NAME"; $arResult["IS_READ_ONLY"] = $arResult["FIELD_ID"] ? $obList->is_readonly($arResult["FIELD_ID"]) : CListFieldTypeList::GetByID($data["TYPE"])->IsReadonly(); $this->IncludeComponentTemplate(); if ($arResult["FIELD_ID"]) { $APPLICATION->SetTitle(GetMessage("CC_BLFE_TITLE_EDIT", array("#NAME#" => htmlspecialcharsex($arResult["FIELD"]["NAME"])))); } else { $APPLICATION->SetTitle(GetMessage("CC_BLFE_TITLE_NEW")); } $APPLICATION->AddChainItem($arResult["IBLOCK"]["NAME"], $arResult["~LIST_URL"]); $APPLICATION->AddChainItem(GetMessage("CC_BLFE_CHAIN_LIST_EDIT"), $arResult["~LIST_EDIT_URL"]); $APPLICATION->AddChainItem(GetMessage("CC_BLFE_CHAIN_FIELDS"), $arResult["~LIST_FIELDS_URL"]);
public function __construct($iblock_id, $field_id, $label, $sort) { parent::__construct($iblock_id, $field_id, $label, $sort); //Cache iblock metadata in order to reduce queries if (!array_key_exists($this->_iblock_id, self::$prop_cache)) { self::$prop_cache[$this->_iblock_id] = array(); $rsProperties = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $this->_iblock_id, "CHECK_PERMISSIONS" => "N", "ACTIVE" => "Y")); while ($arProperty = $rsProperties->Fetch()) { self::$prop_cache[$this->_iblock_id][$arProperty["ID"]] = $arProperty; } } //init from cache if (preg_match("/^PROPERTY_(\\d+)\$/", $field_id, $match) && array_key_exists($match[1], self::$prop_cache[$this->_iblock_id])) { $this->_property = self::$prop_cache[$this->_iblock_id][$match[1]]; if ($this->_property["USER_TYPE"]) { $this->_type = CListFieldTypeList::GetByID($this->_property["PROPERTY_TYPE"] . ":" . $this->_property["USER_TYPE"]); } else { $this->_type = CListFieldTypeList::GetByID($this->_property["PROPERTY_TYPE"]); } } if (!is_object($this->_type)) { $this->_type = CListFieldTypeList::GetByID("S"); } }
public function __construct($iblock_id, $field_id, $label, $sort) { parent::__construct($iblock_id, $field_id, $label, $sort); if (preg_match("/^PROPERTY_(\\d+)\$/", $field_id, $match)) { $this->_property = $this->getPropertyArrayFromCache($match[1]); } if ($this->_property) { if ($this->_property["USER_TYPE"]) { $this->_type = CListFieldTypeList::GetByID($this->_property["PROPERTY_TYPE"] . ":" . $this->_property["USER_TYPE"]); } else { $this->_type = CListFieldTypeList::GetByID($this->_property["PROPERTY_TYPE"]); } } if (!is_object($this->_type)) { $this->_type = CListFieldTypeList::GetByID("S"); } }