Yandex /** @global CDatabase $DB */ /** @global CUser $USER */ /** @global CMain $APPLICATION */ /** @global string $ACTION */ /** @global array $arOldSetupVars */ /** @global int $IBLOCK_ID */ /** @global string $SETUP_FILE_NAME */ /** @global string $SETUP_SERVER_NAME */ /** @global mixed $V */ /** @global mixed $XML_DATA */ /** @global string $SETUP_PROFILE_NAME */ use Bitrix\Main, Bitrix\Iblock, Bitrix\Catalog; IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/catalog/export_setup_templ.php'); IncludeModuleLangFile(__FILE__); global $APPLICATION, $USER; $arSetupErrors = array(); $strAllowExportPath = COption::GetOptionString("catalog", "export_default_path", "/bitrix/catalog_export/"); if (($ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY') && $STEP == 1) { if (isset($arOldSetupVars['IBLOCK_ID'])) $IBLOCK_ID = $arOldSetupVars['IBLOCK_ID']; if (isset($arOldSetupVars['SITE_ID'])) $SITE_ID = $arOldSetupVars['SITE_ID']; if (isset($arOldSetupVars['SETUP_FILE_NAME'])) $SETUP_FILE_NAME = str_replace($strAllowExportPath,'',$arOldSetupVars['SETUP_FILE_NAME']); if (isset($arOldSetupVars['COMPANY_NAME'])) $COMPANY_NAME = $arOldSetupVars['COMPANY_NAME']; if (isset($arOldSetupVars['SETUP_PROFILE_NAME'])) $SETUP_PROFILE_NAME = $arOldSetupVars['SETUP_PROFILE_NAME']; if (isset($arOldSetupVars['V'])) $V = $arOldSetupVars['V']; if (isset($arOldSetupVars['XML_DATA'])) { $XML_DATA = base64_encode($arOldSetupVars['XML_DATA']); } if (isset($arOldSetupVars['SETUP_SERVER_NAME'])) $SETUP_SERVER_NAME = $arOldSetupVars['SETUP_SERVER_NAME']; if (isset($arOldSetupVars['USE_HTTPS'])) $USE_HTTPS = $arOldSetupVars['USE_HTTPS']; if (isset($arOldSetupVars['FILTER_AVAILABLE'])) $filterAvalable = $arOldSetupVars['FILTER_AVAILABLE']; if (isset($arOldSetupVars['DISABLE_REFERERS'])) $disableReferers = $arOldSetupVars['DISABLE_REFERERS']; if (isset($arOldSetupVars['EXPORT_CHARSET'])) $exportCharset = $arOldSetupVars['EXPORT_CHARSET']; if (isset($arOldSetupVars['MAX_EXECUTION_TIME'])) $maxExecutionTime = $arOldSetupVars['MAX_EXECUTION_TIME']; if (isset($arOldSetupVars['CHECK_PERMISSIONS'])) $checkPermissions = $arOldSetupVars['CHECK_PERMISSIONS']; } if ($STEP > 1) { $IBLOCK_ID = (int)$IBLOCK_ID; $rsIBlocks = CIBlock::GetByID($IBLOCK_ID); if ($IBLOCK_ID <= 0 || !($arIBlock = $rsIBlocks->Fetch())) { $arSetupErrors[] = GetMessage("CET_ERROR_NO_IBLOCK1")." #".$IBLOCK_ID." ".GetMessage("CET_ERROR_NO_IBLOCK2"); } else { $bRightBlock = !CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_admin_display"); if ($bRightBlock) { $arSetupErrors[] = str_replace('#IBLOCK_ID#',$IBLOCK_ID,GetMessage("CET_ERROR_IBLOCK_PERM")); } } $SITE_ID = trim($SITE_ID); if ($SITE_ID === '') { $arSetupErrors[] = GetMessage('BX_CATALOG_EXPORT_YANDEX_ERR_EMPTY_SITE'); } else { $iterator = Main\SiteTable::getList(array( 'select' => array('LID'), 'filter' => array('=LID' => $SITE_ID, '=ACTIVE' => 'Y') )); $site = $iterator->fetch(); if (empty($site)) { $arSetupErrors[] = GetMessage('BX_CATALOG_EXPORT_YANDEX_ERR_BAD_SITE'); } } if (!isset($SETUP_FILE_NAME) || $SETUP_FILE_NAME == '') { $arSetupErrors[] = GetMessage("CET_ERROR_NO_FILENAME"); } elseif (preg_match(BX_CATALOG_FILENAME_REG, $strAllowExportPath.$SETUP_FILE_NAME)) { $arSetupErrors[] = GetMessage("CES_ERROR_BAD_EXPORT_FILENAME"); } elseif ($APPLICATION->GetFileAccessPermission($strAllowExportPath.$SETUP_FILE_NAME) < "W") { $arSetupErrors[] = str_replace("#FILE#", $strAllowExportPath.$SETUP_FILE_NAME, GetMessage('CET_YAND_RUN_ERR_SETUP_FILE_ACCESS_DENIED')); } $SETUP_SERVER_NAME = (isset($SETUP_SERVER_NAME) ? trim($SETUP_SERVER_NAME) : ''); $COMPANY_NAME = (isset($COMPANY_NAME) ? trim($COMPANY_NAME) : ''); if (empty($arSetupErrors)) { $bAllSections = false; $arSections = array(); if (!empty($V) && is_array($V)) { foreach ($V as $key => $value) { if (trim($value) == "0") { $bAllSections = true; break; } $value = (int)$value; if ($value > 0) $arSections[] = $value; } } if (!$bAllSections && !empty($arSections)) { $arCheckSections = array(); $rsSections = CIBlockSection::GetList(array(), array('IBLOCK_ID' => $IBLOCK_ID, 'ID' => $arSections), false, array('ID')); while ($arOneSection = $rsSections->Fetch()) { $arCheckSections[] = $arOneSection['ID']; } $arSections = $arCheckSections; } if (!$bAllSections && empty($arSections)) { $arSetupErrors[] = GetMessage("CET_ERROR_NO_GROUPS"); $V = array(); } } if (is_array($V)) { $V = array_unique(array_values($V)); $_REQUEST['V'] = $V; } $arCatalog = CCatalogSku::GetInfoByIBlock($IBLOCK_ID); if (CCatalogSku::TYPE_PRODUCT == $arCatalog['CATALOG_TYPE'] || CCatalogSku::TYPE_FULL == $arCatalog['CATALOG_TYPE']) { if (!isset($XML_DATA) || $XML_DATA == '') { $arSetupErrors[] = GetMessage('YANDEX_ERR_SKU_SETTINGS_ABSENT'); } } if (!isset($USE_HTTPS) || $USE_HTTPS != 'Y') $USE_HTTPS = 'N'; if (isset($_POST['FILTER_AVAILABLE']) && is_string($_POST['FILTER_AVAILABLE'])) $filterAvalable = $_POST['FILTER_AVAILABLE']; if (!isset($filterAvalable) || $filterAvalable != 'Y') $filterAvalable = 'N'; if (isset($_POST['DISABLE_REFERERS']) && is_string($_POST['DISABLE_REFERERS'])) $disableReferers = $_POST['DISABLE_REFERERS']; if (!isset($disableReferers) || $disableReferers != 'Y') $disableReferers = 'N'; if (isset($_POST['EXPORT_CHARSET']) && is_string($_POST['EXPORT_CHARSET'])) $exportCharset = $_POST['EXPORT_CHARSET']; if (!isset($exportCharset) || $exportCharset !== 'UTF-8') $exportCharset = 'windows-1251'; if (isset($_POST['MAX_EXECUTION_TIME']) && is_string($_POST['MAX_EXECUTION_TIME'])) $maxExecutionTime = $_POST['MAX_EXECUTION_TIME']; $maxExecutionTime = (!isset($maxExecutionTime) ? 0 : (int)$maxExecutionTime); if ($maxExecutionTime < 0) $maxExecutionTime = 0; if ($ACTION=="EXPORT_SETUP" || $ACTION=="EXPORT_EDIT" || $ACTION=="EXPORT_COPY") { if (!isset($SETUP_PROFILE_NAME) || $SETUP_PROFILE_NAME == '') $arSetupErrors[] = GetMessage("CET_ERROR_NO_PROFILE_NAME"); } if (!empty($arSetupErrors)) { $STEP = 1; } } $aMenu = array( array( "TEXT"=>GetMessage("CATI_ADM_RETURN_TO_LIST"), "TITLE"=>GetMessage("CATI_ADM_RETURN_TO_LIST_TITLE"), "LINK"=>"/bitrix/admin/cat_export_setup.php?lang=".LANGUAGE_ID, "ICON"=>"btn_list", ) ); $context = new CAdminContextMenu($aMenu); $context->Show(); if (!empty($arSetupErrors)) ShowError(implode('
', $arSetupErrors)); $actionParams = ""; if ($adminSidePanelHelper->isSidePanel()) { $actionParams = "?IFRAME=Y&IFRAME_TYPE=SIDE_SLIDER"; } ?>
"yand_edit1", "TAB" => GetMessage("CAT_ADM_MISC_EXP_TAB1"), "ICON" => "store", "TITLE" => GetMessage("CAT_ADM_MISC_EXP_TAB1_TITLE")), array("DIV" => "yand_edit2", "TAB" => GetMessage("CAT_ADM_MISC_EXP_TAB2"), "ICON" => "store", "TITLE" => GetMessage("CAT_ADM_MISC_EXP_TAB2_TITLE")), ); $tabControl = new CAdminTabControl("tabYandex", $aTabs, false, true); $tabControl->Begin(); $tabControl->BeginNextTab(); if ($STEP == 1) { if (!isset($SITE_ID)) $SITE_ID = ''; if (!isset($XML_DATA)) $XML_DATA = ''; if (!isset($filterAvalable) || $filterAvalable != 'Y') $filterAvalable = 'N'; if (!isset($USE_HTTPS) || $USE_HTTPS != 'Y') $USE_HTTPS = 'N'; if (!isset($disableReferers) || $disableReferers != 'Y') $disableReferers = 'N'; if (!isset($exportCharset) || $exportCharset !== 'UTF-8') $exportCharset = 'windows-1251'; if (!isset($SETUP_SERVER_NAME)) $SETUP_SERVER_NAME = ''; if (!isset($COMPANY_NAME)) $COMPANY_NAME = ''; if (!isset($SETUP_FILE_NAME)) $SETUP_FILE_NAME = 'yandex_'.mt_rand(0, 999999).'.php'; if (!isset($checkPermissions) || $checkPermissions != 'Y') $checkPermissions = 'N'; $siteList = array(); $iterator = Main\SiteTable::getList(array( 'select' => array('LID', 'NAME', 'SORT'), 'filter' => array('=ACTIVE' => 'Y'), 'order' => array('SORT' => 'ASC') )); while ($row = $iterator->fetch()) $siteList[$row['LID']] = $row['NAME']; unset($row, $iterator); $iblockIds = array(); $iblockSites = array(); $iblockMultiSites = array(); $iterator = Catalog\CatalogIblockTable::getList(array( 'select' => array( 'IBLOCK_ID', 'PRODUCT_IBLOCK_ID', 'IBLOCK_ACTIVE' => 'IBLOCK.ACTIVE', 'PRODUCT_IBLOCK_ACTIVE' => 'PRODUCT_IBLOCK.ACTIVE' ), 'filter' => array('') )); while ($row = $iterator->fetch()) { $row['PRODUCT_IBLOCK_ID'] = (int)$row['PRODUCT_IBLOCK_ID']; $row['IBLOCK_ID'] = (int)$row['IBLOCK_ID']; if ($row['PRODUCT_IBLOCK_ID'] > 0) { if ($row['PRODUCT_IBLOCK_ACTIVE'] == 'Y') $iblockIds[$row['PRODUCT_IBLOCK_ID']] = true; } else { if ($row['IBLOCK_ACTIVE'] == 'Y') $iblockIds[$row['IBLOCK_ID']] = true; } } unset($row, $iterator); if (!empty($iblockIds)) { $activeIds = array(); $iterator = Iblock\IblockSiteTable::getList(array( 'select' => array('IBLOCK_ID', 'SITE_ID', 'SITE_SORT' => 'SITE.SORT'), 'filter' => array('@IBLOCK_ID' => array_keys($iblockIds), '=SITE.ACTIVE' => 'Y'), 'order' => array('IBLOCK_ID' => 'ASC', 'SITE_SORT' => 'ASC') )); while ($row = $iterator->fetch()) { $id = (int)$row['IBLOCK_ID']; if (!isset($iblockSites[$id])) $iblockSites[$id] = array( 'ID' => $id, 'SITES' => array() ); $iblockSites[$id]['SITES'][] = array( 'ID' => $row['SITE_ID'], 'NAME' => $siteList[$row['SITE_ID']] ); if (!isset($iblockMultiSites[$id])) $iblockMultiSites[$id] = false; else $iblockMultiSites[$id] = true; $activeIds[$id] = true; } unset($id, $row, $iterator); if (empty($activeIds)) { $iblockIds = array(); $iblockSites = array(); $iblockMultiSites = array(); } else { $iblockIds = array_intersect_key($iblockIds, $activeIds); } unset($activeIds); } if (empty($iblockIds)) { } $currentList = array(); if ($IBLOCK_ID > 0 && isset($iblockIds[$IBLOCK_ID])) { $currentList = $iblockSites[$IBLOCK_ID]['SITES']; if ($SITE_ID === '') { $firstSite = reset($currentList); $SITE_ID = $firstSite['ID']; } } ?>
Fatal error: Uncaught Error: Call to undefined function GetMessage() in D:\ktt\ttepla.com\public_html\bitrix\modules\catalog\load\yandex_setup.php:351 Stack trace: #0 {main} thrown in D:\ktt\ttepla.com\public_html\bitrix\modules\catalog\load\yandex_setup.php on line 351