public static function CheckNeedRun($bGetSectionStatus = true) { $arExcludeSites = CPullOptions::GetExcludeSites(); if (isset($arExcludeSites[SITE_ID])) { return false; } global $CACHE_MANAGER; $bAdminSection = false; if (defined("ADMIN_SECTION") && ADMIN_SECTION == true) { $bAdminSection = true; } $arResult = array(); $res = $CACHE_MANAGER->Read(2592000, "pull_cnr"); if ($res) { $arResult = $CACHE_MANAGER->Get("pull_cnr"); } if (!$res) { $arResult = array('ADMIN_SECTION' => false, 'PUBLIC_SECTION' => false); $arModule = self::GetDependentModule(); foreach ($arModule as $moduleId => $options) { if (isset($options['ADMIN_SECTION']) && $options['ADMIN_SECTION'] == 'Y') { $arResult['ADMIN_SECTION'] = true; } if (isset($options['PUBLIC_SECTION']) && $options['PUBLIC_SECTION'] == 'Y') { $arResult['PUBLIC_SECTION'] = true; } } $CACHE_MANAGER->Set("pull_cnr", $arResult); } return $bGetSectionStatus ? $arResult[$bAdminSection ? 'ADMIN_SECTION' : 'PUBLIC_SECTION'] : $arResult; }
$arDependentModule = Array(); $ar = CPullOptions::GetDependentModule(); foreach ($ar as $key => $value) $arDependentModule[] = $value['MODULE_ID']; $dbSites = CSite::GetList(($b = ""), ($o = ""), Array("ACTIVE" => "Y")); $arSites = array(); $aSubTabs = array(); while ($site = $dbSites->Fetch()) { $site["ID"] = htmlspecialcharsbx($site["ID"]); $site["NAME"] = htmlspecialcharsbx($site["NAME"]); $arSites[$site["ID"]] = $site; } $arExcludeSites = CPullOptions::GetExcludeSites(); ?> <tr> <td width="40%"><?=GetMessage("PULL_OPTIONS_STATUS")?>:</td> <td width="60%"> <? if(CPullOptions::ModuleEnable()): ?> <span style="color:green; font-weight: bold"><?=GetMessage("PULL_OPTIONS_STATUS_Y")?></span> <? else: ?> <span style="color:gray; font-weight: bold"><?=GetMessage("PULL_OPTIONS_STATUS_N")?></span> <? endif; ?> </td> </tr> <? if(CPullOptions::ModuleEnable()): ?> <tr> <td width="40%"><?=GetMessage("PULL_OPTIONS_USE")?>:</td> <td width="60%"><?=implode(", ", $arDependentModule)?></td>