if ($ID > 0) { $dbSitemap = SitemapTable::getById($ID); $arSitemap = $dbSitemap->fetch(); if (!is_array($arSitemap)) { require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php"; ShowError(Loc::getMessage("SEO_ERROR_SITEMAP_NOT_FOUND")); require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php"; } else { if ($_REQUEST['action'] == 'delete' && check_bitrix_sessid()) { SitemapRuntimeTable::clearByPid($ID); SitemapTable::delete($ID); LocalRedirect(BX_ROOT . "/admin/seo_sitemap.php?lang=" . LANGUAGE_ID); } $arSitemap['SETTINGS'] = unserialize($arSitemap['SETTINGS']); $arSitemap['SETTINGS']['IBLOCK_AUTO'] = array(); $dbRes = SitemapIblockTable::getList(array("filter" => array("SITEMAP_ID" => $ID), "select" => array("IBLOCK_ID"))); while ($arRes = $dbRes->fetch()) { $arSitemap['SETTINGS']['IBLOCK_AUTO'][$arRes['IBLOCK_ID']] = 'Y'; } $dbRes = SitemapEntityTable::getList(array("filter" => array("SITEMAP_ID" => $ID))); while ($arRes = $dbRes->fetch()) { if (!is_array($arSitemap['SETTINGS'][$arRes["ENTITY_TYPE"] . '_AUTO'])) { $arSitemap['SETTINGS'][$arRes["ENTITY_TYPE"] . '_AUTO'] = array(); } $arSitemap['SETTINGS'][$arRes["ENTITY_TYPE"] . '_AUTO'][$arRes['ENTITY_ID']] = 'Y'; } if (empty($arSitemap['SETTINGS']['FILENAME_FORUM'])) { $arSitemap['SETTINGS']['FILENAME_FORUM'] = "sitemap_forum_#FORUM_ID#.xml"; } $SITE_ID = $arSitemap['SITE_ID']; }