예제 #1
0
        switch ($_REQUEST['action']) {
            case "delete":
                SitemapRuntimeTable::clearByPid($ID);
                SitemapTable::delete($ID);
                break;
        }
    }
}
$dbSites = Bitrix\Main\SiteTable::getList(array('order' => array('DEF' => 'DESC', 'NAME' => 'ASC'), 'select' => array('NAME', 'LID')));
$arSites = array();
while ($arRes = $dbSites->fetch(Converter::getHtmlConverter())) {
    $arSites[$arRes['LID']] = $arRes;
}
$map = SitemapTable::getMap();
unset($map['SETTINGS']);
$sitemapList = SitemapTable::getList(array('order' => array($by => $order), "select" => array_keys($map)));
$data = new CAdminResult($sitemapList, $tableID);
$data->NavStart();
$arHeaders = array(array("id" => "ID", "content" => Loc::getMessage("SITEMAP_ID"), "sort" => "ID", "default" => true), array("id" => "TIMESTAMP_X", "content" => Loc::getMessage('SITEMAP_TIMESTAMP_X'), "sort" => "TIMESTAMP_X", "default" => true), array("id" => "NAME", "content" => Loc::getMessage('SITEMAP_NAME'), "sort" => "NAME", "default" => true), array("id" => "SITE_ID", "content" => Loc::getMessage('SITEMAP_SITE_ID'), "sort" => "SITE_ID", "default" => true), array("id" => "DATE_RUN", "content" => Loc::getMessage('SITEMAP_DATE_RUN'), "sort" => "DATE_RUN", "default" => true), array("id" => "RUN", "content" => "", "default" => true));
$adminList->AddHeaders($arHeaders);
$adminList->NavText($data->GetNavPrint(Loc::getMessage("PAGES")));
while ($sitemap = $data->NavNext()) {
    $id = intval($sitemap['ID']);
    $row =& $adminList->AddRow($sitemap["ID"], $sitemap, "seo_sitemap_pro_edit.php?ID=" . $sitemap["ID"] . "&lang=" . LANGUAGE_ID, Loc::getMessage("SITEMAP_EDIT_TITLE"));
    $row->AddViewField("ID", $sitemap['ID']);
    $row->AddViewField('TIMESTAMP_X', $sitemap['TIMESTAMP_X']);
    $row->AddViewField('DATE_RUN', $sitemap['DATE_RUN'] ? $sitemap['DATE_RUN'] : Loc::getMessage('SITEMAP_DATE_RUN_NEVER'));
    $row->AddViewField('SITE_ID', '<a href="site_edit.php?lang=' . LANGUAGE_ID . '&amp;LID=' . $sitemap['SITE_ID'] . '">[' . $sitemap['SITE_ID'] . '] ' . $arSites[$sitemap['SITE_ID']]['NAME'] . '</a>');
    $row->AddField("NAME", '<a href="seo_sitemap_pro_edit.php?ID=' . $sitemap["ID"] . '&amp;lang=' . LANGUAGE_ID . '" title="' . Loc::getMessage("SITEMAP_EDIT_TITLE") . '">' . Converter::getHtmlConverter()->encode($sitemap['NAME']) . '</a>');
    $row->AddField("RUN", '<input type="button" class="adm-btn-save" value="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SITEMAP_RUN')) . '" onclick="generateSitemap(' . $sitemap['ID'] . ')" name="save" id="sitemap_run_button_' . $sitemap['ID'] . '" />');
    //$row->AddInputField("NAME");
예제 #2
0
 if ($fileNameFiles == '') {
     $errors[] = Loc::getMessage('SEO_ERROR_SITEMAP_NO_VALUE', array('#FIELD#' => Loc::getMessage('SITEMAP_FILENAME_FILE')));
 }
 if ($bIBlock && $fileNameIblock == '') {
     $errors[] = Loc::getMessage('SEO_ERROR_SITEMAP_NO_VALUE', array('#FIELD#' => Loc::getMessage('SITEMAP_FILENAME_IBLOCK')));
 }
 if ($bForum && $fileNameForum == '') {
     $errors[] = Loc::getMessage('SEO_ERROR_SITEMAP_NO_VALUE', array('#FIELD#' => Loc::getMessage('SITEMAP_FILENAME_FORUM')));
 }
 if (empty($errors)) {
     $arSitemapSettings = SitemapTable::prepareSettings(array('FILE_MASK' => trim($_REQUEST['FILE_MASK']), 'ROBOTS' => $_REQUEST['ROBOTS'] == 'N' ? 'N' : 'Y', 'logical' => $_REQUEST['log'] == 'N' ? 'N' : 'Y', 'DIR' => $_REQUEST['DIR'], 'FILE' => $_REQUEST['FILE'], 'PROTO' => $_REQUEST['PROTO'], 'DOMAIN' => $_REQUEST['DOMAIN'], 'FILENAME_INDEX' => $fileNameIndex, 'FILENAME_FILES' => $fileNameFiles, 'FILENAME_IBLOCK' => $fileNameIblock, 'FILENAME_FORUM' => $fileNameForum, 'IBLOCK_ACTIVE' => $_REQUEST['IBLOCK_ACTIVE'], 'IBLOCK_LIST' => $_REQUEST['IBLOCK_LIST'], 'IBLOCK_SECTION' => $_REQUEST['IBLOCK_SECTION'], 'IBLOCK_ELEMENT' => $_REQUEST['IBLOCK_ELEMENT'], 'IBLOCK_SECTION_SECTION' => $_REQUEST['IBLOCK_SECTION_SECTION'], 'IBLOCK_SECTION_ELEMENT' => $_REQUEST['IBLOCK_SECTION_ELEMENT'], 'FORUM_ACTIVE' => $_REQUEST['FORUM_ACTIVE'], 'FORUM_TOPIC' => $_REQUEST['FORUM_TOPIC']));
     $arSiteMapFields = array('NAME' => trim($_REQUEST['NAME']), 'ACTIVE' => $_REQUEST['ACTIVE'] == 'N' ? 'N' : 'Y', 'SITE_ID' => $SITE_ID, 'SETTINGS' => serialize($arSitemapSettings));
     if ($ID > 0) {
         $result = SitemapTable::update($ID, $arSiteMapFields);
     } else {
         $result = SitemapTable::add($arSiteMapFields);
         $ID = $result->getId();
     }
     if ($result->isSuccess()) {
         $arSitemapIblock = array();
         SitemapIblockTable::clearBySitemap($ID);
         if (is_array($_REQUEST['IBLOCK_AUTO'])) {
             foreach ($_REQUEST['IBLOCK_AUTO'] as $iblockId => $auto) {
                 if ($auto === 'Y') {
                     $result = SitemapIblockTable::add(array('SITEMAP_ID' => $ID, 'IBLOCK_ID' => intval($iblockId)));
                 }
             }
         }
         SitemapForumTable::clearBySitemap($ID);
         if (is_array($_REQUEST['FORUM_AUTO'])) {
             foreach ($_REQUEST['FORUM_AUTO'] as $forumId => $auto) {
예제 #3
0
                    $arSitemapLinks = $robotsFile->getRules(RobotsFile::SITEMAP_RULE);
                    if (count($arSitemapLinks) > 1) {
                        foreach ($arSitemapLinks as $rule) {
                            if ($rule[1] != $sitemapUrl) {
                                $arExistedSitemaps[] = $rule[1];
                            }
                        }
                    }
                }
                $v = $arValueSteps['index'];
            }
        }
    }
    if ($v == $arValueSteps['index']) {
        $msg = Loc::getMessage('SITEMAP_RUN_FINISH');
        SitemapTable::update($ID, array('DATE_RUN' => new Bitrix\Main\Type\DateTime()));
    }
    echo SitemapRuntime::showProgress($msg, Loc::getMessage('SEO_SITEMAP_RUN_TITLE'), $v);
    if ($v < $arValueSteps['index']) {
        ?>
<script>
top.BX.runSitemap(<?php 
        echo $ID;
        ?>
, <?php 
        echo $v;
        ?>
, '<?php 
        echo $PID;
        ?>
', <?php