Код |
---|
... "PROPERTY_CODES" => array( 0 => "NAME", 1 => "DATE_ACTIVE_FROM", 2 => "69", //ID необходимого свойства 3 => "", ), "PROPERTY_CODES_REQUIRED" => array( 0 => "NAME", 1 => "DATE_ACTIVE_FROM", 2 => "69", //ID необходимого свойства 3 => "", ), ... |
Код |
---|
... case "S": case "N": ... |
Код |
---|
case "E": case "S": case "N": |
Код |
---|
... <?if($propertyID == 69):?> <select name="PROPERTY[<?=$propertyID?>][<?=$i?>]"> <option value=""></option> <? $arSelect = Array("ID", "NAME"); $arFilter = Array("IBLOCK_ID"=>IntVal(15), "ACTIVE"=>"Y"); $res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>1000), $arSelect); while($ob = $res->GetNextElement()){ $arFields = $ob->GetFields(); //print_r($arFields); if($value == $arFields["ID"]){$selected = "selected";}else{$selected = "";} echo "<option value=\"".$arFields["ID"]."\" ".$selected.">".$arFields["NAME"]."</option>"; } ?> </select> <?else:?> <input type="text" name="PROPERTY[<?=$propertyID?>][<?=$i?>]" size="25" value="<?=$value?>" /> <?if($arResult["PROPERTY_LIST_FULL"][$propertyID]["USER_TYPE"] == "DateTime"):?> <?$APPLICATION->IncludeComponent( 'bitrix:main.calendar', '', array( 'FORM_NAME' => 'iblock_add', 'INPUT_NAME' => "PROPERTY[".$propertyID."][".$i."]", 'INPUT_VALUE' => $value, ), null, array('HIDE_ICONS' => 'Y') );?> <br /><small><?=GetMessage("IBLOCK_FORM_DATE_FORMAT")?><?=FORMAT_DATETIME?></small> <?endif?> <br /> <?endif;?> ... |
Код |
---|
"PROPERTY_CODES" => array( 0 => "NAME", 1 => "DATE_ACTIVE_FROM", 2 => "PREVIEW_TEXT", 3 => "PREVIEW_PICTURE", 4 => "DETAIL_TEXT", 5 => "DETAIL_PICTURE", 6 => "2", //Привязка к разделам #1 7 => "3", //Привязка к разделам #2 8 => "4", 9 => "5", 10 => "6", 11 => "7", 12 => "8", 13 => "9", 14 => "10", 15 => "11", ), |
Код |
---|
case "N": for ($i = 0; $i<$inputNum; $i++) { if ($arParams["ID"] > 0 || count($arResult["ERRORS"]) > 0) { $value = intval($propertyID) > 0 ? $arResult["ELEMENT_PROPERTIES"][$propertyID][$i]["VALUE"] : $arResult["ELEMENT"][$propertyID]; } elseif ($i == 0) { $value = intval($propertyID) <= 0 ? "" : $arResult["PROPERTY_LIST_FULL"][$propertyID]["DEFAULT_VALUE"]; } else { $value = ""; } ?> <input type="text" name="PROPERTY[<?=$propertyID?>][<?=$i?>]" size="25" value="<?=$value?>" /><br /> <? if($arResult["PROPERTY_LIST_FULL"][$propertyID]["USER_TYPE"] == "DateTime"):?><? $APPLICATION->IncludeComponent( 'bitrix:main.calendar', '', array( 'FORM_NAME' => 'iblock_add', 'INPUT_NAME' => "PROPERTY[".$propertyID."][".$i."]", 'INPUT_VALUE' => $value, ), null, array('HIDE_ICONS' => 'Y') ); ?><br /><small><?=GetMessage("IBLOCK_FORM_DATE_FORMAT")?><?=FORMAT_DATETIME?></small><? endif ?><br /><? if($propertyID == 2) { ?> <select name="PROPERTY[<?=$propertyID?>][<?=$i?>]"> <option value=""></option> <? $arSelect = Array("ID", "NAME"); $arFilter = Array("IBLOCK_ID"=>IntVal(1), "ACTIVE"=>"Y"); $res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>1000), $arSelect); while($ob = $res->GetNextElement()) { $arFields = $ob->GetFields(); //print_r($arFields); if($value == $arFields["ID"]){$selected = "selected";}else{$selected = "";} echo "<option value=\"".$arFields["ID"]."\" ".$selected.">".$arFields["NAME"]."</option>"; } ?> </select> <? } } break; |
Код |
---|
case "E": case "S": case "N": for ($i = 0; $i<$inputNum; $i++) { if ($arParams["ID"] > 0 || count($arResult["ERRORS"]) > 0) { $value = intval($propertyID) > 0 ? $arResult["ELEMENT_PROPERTIES"][$propertyID][$i]["VALUE"] : $arResult["ELEMENT"][$propertyID]; } elseif ($i == 0) { $value = intval($propertyID) <= 0 ? "" : $arResult["PROPERTY_LIST_FULL"][$propertyID]["DEFAULT_VALUE"]; } else { $value = ""; } //Здесь производим необходимые действия if($propertyID == 60): //ID необходимого св-ва //выполняем выборку и выводим результат, для примера просто выведем текущее значение $value echo $value; else: //выполняем стандартный код ?> <input type="text" name="PROPERTY[<?=$propertyID?>][<?=$i?>]" size="25" value="<?=$value?>" /> <?if($arResult["PROPERTY_LIST_FULL"][$propertyID]["USER_TYPE"] == "DateTime"): $APPLICATION->IncludeComponent( 'bitrix:main.calendar', '', array( 'FORM_NAME' => 'iblock_add', 'INPUT_NAME' => "PROPERTY[".$propertyID."][".$i."]", 'INPUT_VALUE' => $value, ), null, array('HIDE_ICONS' => 'Y') ); ?><br /><small><?=GetMessage("IBLOCK_FORM_DATE_FORMAT")?><?=FORMAT_DATETIME?></small><? endif ?><br /><? endif; } break; |