24if (defined(
"CATALOG_EXPORT_NO_STEP") && CATALOG_EXPORT_NO_STEP ==
true)
37$SETUP_VARS_LIST =
'IBLOCK_ID,SETUP_FILE_NAME,fields_type,delimiter_r,delimiter_other_r,first_line_names,field_needed,field_num,field_code,export_files,export_from_clouds,CML2_LINK_IS_XML,MAX_EXECUTION_TIME';
50if (!function_exists(
'__CSVArrayMultiply'))
52 function __CSVArrayMultiply($arTuple, $arTemp, &$csvFile, $currentFile): void
57 $csvFile->SaveFile(
$_SERVER[
"DOCUMENT_ROOT"].$currentFile, $arTemp);
61 $head = array_shift($arTuple);
67 $arTemp[
count($arTemp)-1] =
"";
68 __CSVArrayMultiply($arTuple, $arTemp, $csvFile, $currentFile);
72 foreach ($head as &$value)
75 __CSVArrayMultiply($arTuple, $arTemp, $csvFile, $currentFile);
83 $arTemp[
count($arTemp)-1] = $head;
84 __CSVArrayMultiply($arTuple, $arTemp, $csvFile, $currentFile);
90if (!function_exists(
'__CSVExportFile'))
92 function __CSVExportFile($intFileID, $strExportPath, $strFilePath, $strExportFromClouds =
'Y'): string
94 if (
'Y' != $strExportFromClouds)
95 $strExportFromClouds =
'N';
100 if (
'N' == $strExportFromClouds && 0 < $arFile[
"HANDLER_ID"])
102 return serialize($arFile);
107 if (isset($arTempFile[
"tmp_name"]) && $arTempFile[
"tmp_name"] !=
"")
109 $strFile = $arFile[
"SUBDIR"].
"/".$arFile[
"FILE_NAME"];
110 $strNewFile = str_replace(
"//",
"/", $strExportPath.$strFilePath.$strFile);
113 if (@copy($arTempFile[
"tmp_name"],
$_SERVER[
'DOCUMENT_ROOT'].$strNewFile))
114 return $strFilePath.$strFile;
176 if (!(
$arIBlock = $arIBlockres->Fetch()))
192 array(
'IBLOCK_ID',
'PRODUCT_IBLOCK_ID',
'SKU_PROPERTY_ID')
218 if (!isset($fields_type) || ($fields_type !=
"F" && $fields_type !=
"R"))
223 $csvFile->SetFieldsType($fields_type);
225 $first_line_names = (isset($first_line_names) && $first_line_names ==
'Y');
227 $first_line_names =
false;
228 $csvFile->SetFirstHeader($first_line_names);
230 $delimiter_r_char =
'';
231 if (isset($delimiter_r))
233 switch ($delimiter_r)
236 $delimiter_r_char =
"\t";
239 $delimiter_r_char =
",";
242 $delimiter_r_char =
" ";
245 $delimiter_r_char = (isset($delimiter_other_r)? mb_substr($delimiter_other_r, 0, 1) :
'');
248 $delimiter_r_char =
";";
253 if (mb_strlen($delimiter_r_char) != 1)
260 $csvFile->SetDelimiter($delimiter_r_char);
263 if (!isset($export_files) || $export_files !=
'Y')
265 if (!isset($export_from_clouds) || $export_from_clouds !=
'Y')
266 $export_from_clouds =
'N';
293 if (!($fp = fopen(
$_SERVER[
"DOCUMENT_ROOT"].$currentFile,
"wb")))
301 if (!($fp = fopen(
$_SERVER[
"DOCUMENT_ROOT"].$currentFile,
"ab")))
308 if ($export_files ==
'Y')
311 $strFilePath = str_replace($strExportPath,
'', mb_substr(
$SETUP_FILE_NAME, 0, -4)).
'_files/';
317 'CATI_NO_RIGHTS_EXPORT_FILES_PATH',
318 [
'#PATH#' => $strExportPath.$strFilePath]
327 $bFieldsPres = (!empty($field_needed) && is_array($field_needed) && in_array(
'Y', $field_needed));
328 if ($bFieldsPres && (empty($field_code) || !is_array($field_code)))
330 $bFieldsPres =
false;
340 $arSortFields =
array();
341 $selectArray =
array(
"ID",
"IBLOCK_ID",
"IBLOCK_SECTION_ID");
342 $bNeedGroups =
false;
343 $bNeedPrices =
false;
344 $bNeedProducts =
false;
346 $arGroupProps =
array();
347 $allSectionFields = [];
348 $arElementProps =
array();
349 $arCatalogGroups =
array();
350 $bNeedCounts =
false;
351 $arCountFields =
array();
352 $arValueCodes =
array();
353 $arNeedFields =
array();
357 $arAvailProdFields = explode(
",", $strAvailProdFields);
358 $arAvailProdFields_names =
array();
361 if (in_array($arOneCatalogAvailProdFields[
'value'],$arAvailProdFields))
363 $arAvailProdFields_names[$arOneCatalogAvailProdFields[
'value']] =
array(
364 "field" => $arOneCatalogAvailProdFields[
"field"],
365 "important" => $arOneCatalogAvailProdFields[
"important"],
367 $mxSelKey = array_search($arOneCatalogAvailProdFields[
'value'], $field_code);
368 if (!(
false === $mxSelKey || empty($field_needed[$mxSelKey]) ||
'Y' != $field_needed[$mxSelKey]))
370 $arSortFields[$arOneCatalogAvailProdFields[
'value']] =
array(
371 'CODE' => $arOneCatalogAvailProdFields[
'value'],
373 'SORT' => (!empty($field_num[$mxSelKey]) && 0 < (
int)$field_num[$mxSelKey] ? (
int)$field_num[$mxSelKey] : ($intCount+1)*10),
375 $selectArray[] = $arOneCatalogAvailProdFields[
"field"];
380 unset($arOneCatalogAvailProdFields);
382 $rsProps = CIBlockProperty::GetList(
array(
"SORT"=>
"ASC",
"ID"=>
"ASC"),
array(
"IBLOCK_ID"=>
$IBLOCK_ID,
"ACTIVE"=>
"Y",
'CHECK_PERMISSIONS' =>
'N'));
385 $mxSelKey = array_search(
'IP_PROP'.$arProp[
'ID'], $field_code);
386 if (!(
false === $mxSelKey || empty($field_needed[$mxSelKey]) ||
'Y' != $field_needed[$mxSelKey]))
388 $arSortFields[
'IP_PROP'.$arProp[
'ID']] =
array(
389 'CODE' =>
'IP_PROP'.$arProp[
'ID'],
391 'SORT' => (!empty($field_num[$mxSelKey]) && 0 < (
int)$field_num[$mxSelKey] ? (
int)$field_num[$mxSelKey] : ($intCount+1)*10),
394 $arElementProps[] = $arProp[
'ID'];
399 $arElementProps = array_values(array_unique($arElementProps));
403 $arAvailGroupFields = explode(
",", $strAvailGroupFields);
404 $arAvailGroupFields_names =
array();
407 if (in_array($arOneCatalogAvailGroupFields[
'value'],$arAvailGroupFields))
409 $arAvailGroupFields_names[$arOneCatalogAvailGroupFields[
'value']] =
array(
410 "field" => $arOneCatalogAvailGroupFields[
"field"],
411 "important" => $arOneCatalogAvailGroupFields[
"important"],
415 unset($arOneCatalogAvailGroupFields);
417 if (!empty($arAvailGroupFields_names))
419 $arAvailGroupFieldsList = array_keys($arAvailGroupFields_names);
422 foreach ($arAvailGroupFieldsList as &$strKey)
424 $mxSelKey = array_search($strKey.$i, $field_code);
425 if (!(
false === $mxSelKey || empty($field_needed[$mxSelKey]) ||
'Y' != $field_needed[$mxSelKey]))
427 $arSortFields[$strKey.$i] =
array(
428 'CODE' => $strKey.$i,
430 'SORT' => (!empty($field_num[$mxSelKey]) && 0 < (
int)$field_num[$mxSelKey] ? (
int)$field_num[$mxSelKey] : ($intCount+1)*10),
433 $arGroupProps[
$i][] = $strKey;
434 $allSectionFields[] = $arAvailGroupFields_names[$strKey][
'field'];
440 if (!empty($arGroupProps[
$i]))
441 $arGroupProps[
$i] = array_values(array_unique($arGroupProps[
$i]));
443 unset($arAvailGroupFieldsList);
445 if (!empty($allSectionFields))
447 $allSectionFields[] =
'ID';
448 $allSectionFields = array_values(array_unique($allSectionFields));
455 $arAvailPriceFields = explode(
",", $strAvailPriceFields);
456 $arAvailPriceFields_names =
array();
459 if (in_array($arOneCatalogAvailPriceFields[
'value'],$arAvailPriceFields))
461 $iblockField = (isset($arOneCatalogAvailPriceFields[
"field_orig"])
462 ? $arOneCatalogAvailPriceFields[
"field_orig"]
463 : $arOneCatalogAvailPriceFields[
"field"]
465 $arAvailPriceFields_names[$arOneCatalogAvailPriceFields[
'value']] =
array(
466 "field" => $arOneCatalogAvailPriceFields[
"field"],
467 'iblock_field' =>
'CATALOG_'.$iblockField,
468 "important" => $arOneCatalogAvailPriceFields[
"important"]
471 $mxSelKey = array_search($arOneCatalogAvailPriceFields[
'value'], $field_code);
472 if (!(
false === $mxSelKey || empty($field_needed[$mxSelKey]) ||
'Y' != $field_needed[$mxSelKey]))
474 $arSortFields[$arOneCatalogAvailPriceFields[
'value']] =
array(
475 'CODE' => $arOneCatalogAvailPriceFields[
'value'],
477 'SORT' => (!empty($field_num[$mxSelKey]) && 0 < (
int)$field_num[$mxSelKey] ? (
int)$field_num[$mxSelKey] : ($intCount+1)*10),
479 $bNeedProducts =
true;
480 $selectArray[] =
'CATALOG_'.$iblockField;
485 unset($arOneCatalogAvailPriceFields);
489 $arAvailCountFields = explode(
",", $strAvailCountFields);
490 $arAvailCountFields_names =
array();
493 if (in_array($arOneCatalogAvailQuantityFields[
'value'], $arAvailCountFields))
495 $arAvailCountFields_names[$arOneCatalogAvailQuantityFields[
'value']] =
array(
496 "field" => $arOneCatalogAvailQuantityFields[
"field"],
497 "important" => $arOneCatalogAvailQuantityFields[
"important"]
499 $mxSelKey = array_search($arOneCatalogAvailQuantityFields[
'value'], $field_code);
500 if (!(
false === $mxSelKey || empty($field_needed[$mxSelKey]) ||
'Y' != $field_needed[$mxSelKey]))
502 $arSortFields[$arOneCatalogAvailQuantityFields[
'value']] =
array(
503 'CODE' => $arOneCatalogAvailQuantityFields[
'value'],
505 'SORT' => (!empty($field_num[$mxSelKey]) && 0 < (
int)$field_num[$mxSelKey] ? (
int)$field_num[$mxSelKey] : ($intCount+1)*10),
508 $arCountFields[] = $arOneCatalogAvailQuantityFields[
'value'];
513 unset($arOneCatalogAvailQuantityFields);
516 $arAvailValueFields = explode(
",", $strAvailValueFields);
517 $arAvailValueFields_names =
array();
520 if (in_array($arOneCatalogAvailValueFields[
'value'],$arAvailValueFields))
522 $arValueCodes[] = $arOneCatalogAvailValueFields[
'value'].
'_';
523 $arAvailValueFields_names[$arOneCatalogAvailValueFields[
'value']] =
array(
524 "field" => $arOneCatalogAvailValueFields[
"field"],
525 "important" => $arOneCatalogAvailValueFields[
"important"]
529 unset($arOneCatalogAvailValueFields);
530 if (!empty($arValueCodes))
531 $arValueCodes = array_values(array_unique($arValueCodes));
533 if (!empty($arAvailValueFields_names))
535 $arAvailValueFieldsList = array_keys($arAvailValueFields_names);
537 while ($arPriceType = $rsPriceTypes->Fetch())
539 foreach ($arAvailValueFieldsList as &$strKey)
541 $mxSelKey = array_search($strKey.
'_'.$arPriceType[
'ID'], $field_code);
542 if (!(
false === $mxSelKey || empty($field_needed[$mxSelKey]) ||
'Y' != $field_needed[$mxSelKey]))
544 $arSortFields[$strKey.
'_'.$arPriceType[
'ID']] =
array(
545 'CODE' => $strKey.
'_'.$arPriceType[
'ID'],
547 'SORT' => (!empty($field_num[$mxSelKey]) && 0 < (
int)$field_num[$mxSelKey] ? (
int)$field_num[$mxSelKey] : ($intCount+1)*10),
550 $arCatalogGroups[] = intval($arPriceType[
'ID']);
557 unset($arAvailValueFieldsList);
560 $arCatalogGroups = array_values(array_unique($arCatalogGroups));
561 sort($arCatalogGroups);
566 $bNeedCounts =
false;
567 $arCountFields =
array();
572 $arCacheSections =
array();
573 $arCacheChains =
array();
574 $arCacheResultSections =
array();
576 $arNeedFields = array_keys($arSortFields);
578 if ($first_line_names)
580 $csvFile->SaveFile(
$_SERVER[
"DOCUMENT_ROOT"].$currentFile, $arNeedFields);
581 $first_line_names =
false;
590 if (isset($CUR_ELEMENT_ID) && $CUR_ELEMENT_ID > 0)
591 $filter[
'>ID'] = $CUR_ELEMENT_ID;
595 $dbIBlockElement = CIBlockElement::GetList(
596 array(
'ID' =>
'ASC'),
602 while ($obIBlockElement = $dbIBlockElement->GetNextElement())
604 $arIBlockElement = $obIBlockElement->GetFields();
606 $finalExport =
false;
609 $id = (int)$arIBlockElement[
'ID'];
610 $CUR_ELEMENT_ID = $id;
612 if (isset($arIBlockElement[
"PREVIEW_PICTURE"]))
614 if (
'Y' == $export_files)
616 $arIBlockElement[
"~PREVIEW_PICTURE"] = __CSVExportFile($arIBlockElement[
'PREVIEW_PICTURE'], $strExportPath, $strFilePath);
620 $arIBlockElement[
"PREVIEW_PICTURE"] = CFile::GetFileArray($arIBlockElement[
"PREVIEW_PICTURE"]);
621 if ($arIBlockElement[
"PREVIEW_PICTURE"])
622 $arIBlockElement[
"~PREVIEW_PICTURE"] = $arIBlockElement[
"PREVIEW_PICTURE"][
"SRC"];
625 if (isset($arIBlockElement[
"DETAIL_PICTURE"]))
627 if (
'Y' == $export_files)
629 $arIBlockElement[
"~DETAIL_PICTURE"] = __CSVExportFile($arIBlockElement[
'DETAIL_PICTURE'], $strExportPath, $strFilePath);
633 $arIBlockElement[
"DETAIL_PICTURE"] = CFile::GetFileArray($arIBlockElement[
"DETAIL_PICTURE"]);
634 if ($arIBlockElement[
"DETAIL_PICTURE"])
635 $arIBlockElement[
"~DETAIL_PICTURE"] = $arIBlockElement[
"DETAIL_PICTURE"][
"SRC"];
645 if (in_array($arProperty[
"ID"], $arElementProps))
648 $arProperty[
"USER_TYPE"] = (string)$arProperty[
"USER_TYPE"];
649 if ($arProperty[
"USER_TYPE"] !=
'')
651 $arUserType = CIBlockProperty::GetUserType($arProperty[
"USER_TYPE"]);
652 if (isset($arUserType[
"GetPublicViewHTML"]))
659 $arPropsValues =
array();
662 if (in_array($arProperty[
"ID"], $arElementProps))
667 if ($arProperty[
'MULTIPLE'] ==
'Y' && is_array($arProperty[
"~VALUE"]))
670 foreach ($arProperty[
"~VALUE"] as $value)
674 array(
"VALUE" => $value),
675 array(
"MODE" => $exportMode)
683 array(
"VALUE" => $arProperty[
"~VALUE"]),
684 array(
"MODE" => $exportMode),
688 elseif ($arProperty[
"PROPERTY_TYPE"] ==
"F")
690 if (is_array($arProperty[
"~VALUE"]))
693 foreach ($arProperty[
"~VALUE"] as $file_id)
695 if (
'Y' == $export_files)
697 $arValues[] = __CSVExportFile($file_id, $strExportPath, $strFilePath);
701 $file = CFile::GetFileArray($file_id);
707 elseif ($arProperty[
"~VALUE"] > 0)
709 if (
'Y' == $export_files)
711 $arValues = __CSVExportFile($arProperty[
"~VALUE"], $strExportPath, $strFilePath);
715 $file = CFile::GetFileArray($arProperty[
"~VALUE"]);
731 $arPropsValues[$arProperty[
"ID"]] =
$arValues;
735 $arResSections =
array();
739 $rsSections = CIBlockElement::GetElementGroups($arIBlockElement[
"ID"],
false,
array(
'ID',
'ADDITIONAL_PROPERTY_ID'));
740 while ($arSection = $rsSections->Fetch())
742 if (0 < intval($arSection[
'ADDITIONAL_PROPERTY_ID']))
744 if (!isset($arCacheChains[$arSection[
'ID']]))
748 $rsPath = CIBlockSection::GetNavChain(
754 foreach ($rsPath as $arPathSection)
756 if (!empty($arGroupProps[$j]))
758 foreach ($arGroupProps[$j] as &
$key)
760 $field = $arAvailGroupFields_names[
$key][
'field'];
761 if (
'IC_PICTURE' ==
$key ||
'IC_DETAIL_PICTURE' ==
$key)
763 if (
'Y' == $export_files)
765 $arPathSection[$field] = __CSVExportFile($arPathSection[$field], $strExportPath, $strFilePath);
769 $arPathSection[$field] = CFile::GetFileArray($arPathSection[$field]);
770 if ($arPathSection[$field])
772 $arPathSection[$field] = $arPathSection[$field][
"SRC"];
776 $arPathSection[$field] =
'';
780 $arPath[
'~'.$key.$j] = $arPathSection[$field];
784 $arPathSection[
'IBLOCK_SECTION_ID'] = intval($arPathSection[
'IBLOCK_SECTION_ID']);
785 $arCacheChains[$arPathSection[
'ID']] = $arPathSection[
'IBLOCK_SECTION_ID'];
786 $arCacheSections[$arPathSection[
'ID']] =
$arPath;
790 unset($arPathSection, $rsPath);
794 if (!isset($arCacheResultSections[$arSection[
'ID']]))
796 $intCurSect = $arSection[
'ID'];
797 while (isset($arCacheChains[$intCurSect]))
800 $intCurSect = $arCacheChains[$intCurSect];
802 $arCacheResultSections[$arSection[
'ID']] =
$arPath;
806 $arPath = $arCacheResultSections[$arSection[
'ID']];
811 if (empty($arResSections))
812 $arResSections[] =
array();
816 $arResSections[] =
array();
819 $arResPrices =
array();
822 $arResPricesMap =
array();
825 $dbProductPrice = Catalog\PriceTable::getList(
array(
826 'select' =>
array(
'ID',
'CATALOG_GROUP_ID',
'PRICE',
'CURRENCY',
'QUANTITY_FROM',
'QUANTITY_TO',
'EXTRA_ID'),
827 'filter' =>
array(
'=PRODUCT_ID' => $arIBlockElement[
"ID"],
'@CATALOG_GROUP_ID' => $arCatalogGroups)
829 while ($arProductPrice = $dbProductPrice->fetch())
831 if (!isset($arResPricesMap[$arProductPrice[
"QUANTITY_FROM"].
"-".$arProductPrice[
"QUANTITY_TO"]]))
834 $arResPricesMap[$arProductPrice[
"QUANTITY_FROM"].
"-".$arProductPrice[
"QUANTITY_TO"]] = $mapIndex;
836 $intDiap = $arResPricesMap[$arProductPrice[
"QUANTITY_FROM"].
"-".$arProductPrice[
"QUANTITY_TO"]];
837 foreach ($arAvailValueFields_names as
$key => $value)
839 $arResPrices[$intDiap][$value[
'field'].
'_'.$arProductPrice[
"CATALOG_GROUP_ID"]] = $arProductPrice[$value[
'field']];
841 $arResPrices[$intDiap][
'QUANTITY_FROM'] = $arProductPrice[
"QUANTITY_FROM"];
842 $arResPrices[$intDiap][
'QUANTITY_TO'] = $arProductPrice[
"QUANTITY_TO"];
844 if (empty($arResPrices))
845 $arResPrices[] =
array();
849 $arResPrices[] =
array();
852 $arResProducts =
array();
855 foreach ($arAvailPriceFields_names as
$key => $value)
857 $arResProducts[$value[
'field']] = $arIBlockElement[$value[
'iblock_field']];
861 foreach ($arResSections as
$arPath)
863 foreach ($arResPrices as $arPrice)
866 foreach ($arNeedFields as $field_name)
868 if (strncmp($field_name,
"IE_", 3) == 0)
869 $arTuple[] = $arIBlockElement[
"~".mb_substr($field_name, 3)];
870 elseif (strncmp($field_name,
"IP_PROP", 7) == 0)
871 $arTuple[] = $arPropsValues[intval(mb_substr($field_name, 7))];
872 elseif (strncmp($field_name,
"IC_", 3) == 0)
874 $strKey = $field_name;
875 $arTuple[] = (isset(
$arPath[
'~'.$strKey]) ?
$arPath[
'~'.$strKey] :
'');
877 elseif (strncmp($field_name,
'CV_', 3) == 0)
879 $strKey = mb_substr($field_name, 3);
880 $arTuple[] = (isset($arPrice[$strKey]) ? $arPrice[$strKey] :
'');
882 elseif (strncmp($field_name,
'CP_', 3) == 0)
884 $arTuple[] = (!empty($arResProducts) ? $arResProducts[mb_substr($field_name, 3)] :
'');
887 __CSVArrayMultiply($arTuple, [], $csvFile, $currentFile);
894 unset($arIBlockElement, $dbIBlockElement);
901 $csvFile->CloseFile();
911 if (isset($USER_TMP))
const BX_CATALOG_FILENAME_REG
const CATALOG_DEFAULT_EXPORT_PATH
static sortByColumn(array &$array, $columns, $callbacks='', $defaultValueIfNotSetValue=null, $preserveKeys=false)
static getDefaultSettings($type, $extFormat=false)
static getSettingsFields($type, $extFormat=false)
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetFileArray($fileId, $uploadDir=false)
static MakeFileArray($path, $mimetype=false, $skipInternal=false, $external_id="")
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
global $arCatalogAvailPriceFields
global $defCatalogAvailValueFields
global $arCatalogAvailQuantityFields
if(! $ar_profile) $strFile
global $defCatalogAvailProdFields
global $defCatalogAvailQuantityFields
global $arCatalogAvailProdFields
global $defCatalogAvailCurrencies
if($ar_profile["DEFAULT_PROFILE"] !='Y') $firstStep
global $arCatalogAvailGroupFields
global $arCatalogAvailValueFields
global $defCatalogAvailPriceFields
global $defCatalogAvailGroupFields
if(!($arIBlock=$arIBlockres->Fetch())) $boolCatalog
if(empty($arRunErrors)) $CML2_LINK_IS_XML
if(!CCatalog::IsUserExists()) if(!function_exists( '__CSVArrayMultiply')) if(!function_exists('__CSVExportFile')) $strCatalogDefaultFolder
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Rel2Abs($curdir, $relpath)
GetMessage($name, $aReplace=null)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if(empty($arRunErrors)) $arUserTypeFormat
if( $site[ 'SERVER_NAME']==='') if($site['SERVER_NAME']==='') $arProperties