当前位置: 首页>>代码示例>>PHP>>正文


PHP Main\SiteTable类代码示例

本文整理汇总了PHP中Bitrix\Main\SiteTable的典型用法代码示例。如果您正苦于以下问题:PHP SiteTable类的具体用法?PHP SiteTable怎么用?PHP SiteTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SiteTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getDefaultSiteId

 public static function getDefaultSiteId()
 {
     static $result = null;
     if ($result === null) {
         $res = \Bitrix\Main\SiteTable::getList(array('filter' => array('DEF' => 'Y'), 'select' => array('LID')));
         if ($item = $res->fetch()) {
             $result = $item['LID'];
         }
     }
     return $result;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:11,代码来源:helper.php

示例2: getList

 /**
  * @param string $dbName
  * @return array List of all sites & their params
  */
 public static function getList($dbName = false)
 {
     if (!$dbName) {
         $connection = \Bitrix\Main\Application::getConnection();
         $dbName = $connection->getDbName();
     }
     $result = array();
     $shellAdapter = new ShellAdapter();
     $execRes = $shellAdapter->syncExec("sudo -u root /opt/webdir/bin/bx-sites -o json -a list -d " . $dbName);
     $sitesData = $shellAdapter->getLastOutput();
     if ($execRes) {
         $arData = json_decode($sitesData, true);
         if (isset($arData["params"])) {
             $result = $arData["params"];
         }
         $rsSite = \Bitrix\Main\SiteTable::getList();
         while ($site = $rsSite->fetch()) {
             foreach ($result as $siteId => $siteInfo) {
                 $docRoot = strlen($site["DOC_ROOT"]) > 0 ? $site["DOC_ROOT"] : \Bitrix\Main\Application::getDocumentRoot();
                 if ($siteInfo["DocumentRoot"] == $docRoot) {
                     $result[$siteId]["NAME"] = $site["NAME"] . " (" . $site["LID"] . ") ";
                 } else {
                     $result[$siteId]["NAME"] = $siteId;
                 }
             }
         }
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:33,代码来源:sitesdata.php

示例3: acrit_exportpro

 function acrit_exportpro()
 {
     require __DIR__ . '/version.php';
     $path = str_replace("\\", "/", __FILE__);
     $path = substr($path, 0, strlen($path) - strlen("/index.php"));
     include $path . "/version.php";
     if (is_array($arModuleVersion) && array_key_exists("VERSION", $arModuleVersion)) {
         $this->MODULE_VERSION = $arModuleVersion["VERSION"];
         $this->MODULE_VERSION_DATE = $arModuleVersion["VERSION_DATE"];
     }
     $this->MODULE_NAME = GetMessage('ACRIT_EXPORTPRO_MODULE_NAME');
     $this->MODULE_DESCRIPTION = GetMessage('ACRIT_EXPORTPRO_MODULE_DESC');
     $this->PARTNER_NAME = GetMessage("ACRIT_EXPORTPRO_PARTNER_NAME");
     $this->PARTNER_URI = GetMessage("ACRIT_EXPORTPRO_PARTNER_URI");
     $app = \Bitrix\Main\Application::getInstance();
     $dbSite = \Bitrix\Main\SiteTable::getList();
     while ($arSite = $dbSite->Fetch()) {
         if (!$arSite['DOC_ROOT']) {
             $this->siteArray[$arSite['LID']] = $app->getDocumentRoot() . $arSite['DIR'];
         } else {
             $this->siteArray[$arSite['LID']] = $arSite['DOC_ROOT'];
         }
         $this->siteArray[$arSite['LID']] = \Bitrix\Main\IO\Path::normalize($this->siteArray[$arSite['LID']]);
     }
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:25,代码来源:index.php

示例4: __construct

	public function __construct($fileName, $settings)
	{
		$this->settings = array(
			'SITE_ID' => $settings['SITE_ID'],
			'PROTOCOL' => $settings['PROTOCOL'] == 'https' ? 'https' : 'http',
			'DOMAIN' => $settings['DOMAIN'],
		);

		$site = SiteTable::getRow(array("filter" => array("LID" => $this->settings['SITE_ID'])));

		$this->siteRoot = Path::combine(
			SiteTable::getDocumentRoot($this->settings['SITE_ID']),
			$site['DIR']
		);

		if(substr($fileName, -strlen(self::FILE_EXT)) != self::FILE_EXT)
		{
			$fileName .= self::FILE_EXT;
		}

		if($this->partFile == '')
		{
			$this->partFile = $fileName;
		}

		$this->pathPhysical = null; // hack for object reconstuct during file splitting

		parent::__construct($this->siteRoot.'/'.$fileName, $this->settings['SITE_ID']);

		$this->partChanged = $this->isExists() && !$this->isSplitNeeded();
	}
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:sitemapfile.php

示例5: seoSitemapGetFilesData

function seoSitemapGetFilesData($PID, $arSitemap, $arCurrentDir, $sitemapFile)
{
    global $NS;
    $arDirList = array();
    if ($arCurrentDir['ACTIVE'] == SitemapRuntimeTable::ACTIVE) {
        $list = \CSeoUtils::getDirStructure($arSitemap['SETTINGS']['logical'] == 'Y', $arSitemap['SITE_ID'], $arCurrentDir['ITEM_PATH']);
        foreach ($list as $dir) {
            $dirKey = "/" . ltrim($dir['DATA']['ABS_PATH'], "/");
            if ($dir['TYPE'] == 'F') {
                if (!isset($arSitemap['SETTINGS']['FILE'][$dirKey]) || $arSitemap['SETTINGS']['FILE'][$dirKey] == 'Y') {
                    if (preg_match($arSitemap['SETTINGS']['FILE_MASK_REGEXP'], $dir['FILE'])) {
                        $f = new IO\File($dir['DATA']['PATH'], $arSitemap['SITE_ID']);
                        $sitemapFile->addFileEntry($f);
                        $NS['files_count']++;
                    }
                }
            } else {
                if (!isset($arSitemap['SETTINGS']['DIR'][$dirKey]) || $arSitemap['SETTINGS']['DIR'][$dirKey] == 'Y') {
                    $arDirList[] = $dirKey;
                }
            }
        }
    } else {
        $len = strlen($arCurrentDir['ITEM_PATH']);
        if (!empty($arSitemap['SETTINGS']['DIR'])) {
            foreach ($arSitemap['SETTINGS']['DIR'] as $dirKey => $checked) {
                if ($checked == 'Y') {
                    if (strncmp($arCurrentDir['ITEM_PATH'], $dirKey, $len) === 0) {
                        $arDirList[] = $dirKey;
                    }
                }
            }
        }
        if (!empty($arSitemap['SETTINGS']['FILE'])) {
            foreach ($arSitemap['SETTINGS']['FILE'] as $dirKey => $checked) {
                if ($checked == 'Y') {
                    if (strncmp($arCurrentDir['ITEM_PATH'], $dirKey, $len) === 0) {
                        $fileName = IO\Path::combine(SiteTable::getDocumentRoot($arSitemap['SITE_ID']), $dirKey);
                        if (!is_dir($fileName)) {
                            $f = new IO\File($fileName, $arSitemap['SITE_ID']);
                            if ($f->isExists() && !$f->isSystem() && preg_match($arSitemap['SETTINGS']['FILE_MASK_REGEXP'], $f->getName())) {
                                $sitemapFile->addFileEntry($f);
                                $NS['files_count']++;
                            }
                        }
                    }
                }
            }
        }
    }
    if (count($arDirList) > 0) {
        foreach ($arDirList as $dirKey) {
            $arRuntimeData = array('PID' => $PID, 'ITEM_PATH' => $dirKey, 'PROCESSED' => SitemapRuntimeTable::UNPROCESSED, 'ACTIVE' => SitemapRuntimeTable::ACTIVE, 'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_DIR);
            SitemapRuntimeTable::add($arRuntimeData);
        }
    }
    SitemapRuntimeTable::update($arCurrentDir['ID'], array('PROCESSED' => SitemapRuntimeTable::PROCESSED));
}
开发者ID:Satariall,项目名称:izurit,代码行数:58,代码来源:seo_sitemap_run.php

示例6: getParamsStructure

 public static function getParamsStructure()
 {
     $siteList = array();
     $rsSite = \Bitrix\Main\SiteTable::getList();
     while ($site = $rsSite->fetch()) {
         $siteList[$site["LID"]] = $site["NAME"] . " (" . $site["LID"] . ")";
     }
     return array("SITE_ID" => array("TYPE" => "ENUM", 'MULTIPLE' => 'Y', "DEFAULT" => SITE_ID, "LABEL" => Loc::getMessage("SALE_DLVR_RSTR_BY_SITE_SITE_ID"), "OPTIONS" => $siteList));
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:9,代码来源:bysite.php

示例7: getRewriteRules

 /**
  * Returns urlrewrite array
  *
  * @param string $site Site ID.
  * @return array
  */
 private static function getRewriteRules($site)
 {
     $docRoot = rtrim(\Bitrix\Main\SiteTable::getDocumentRoot($site), '/');
     $rewriteRules = array();
     $arUrlRewrite =& $rewriteRules;
     $rewriteFile = new \Bitrix\Main\IO\File($docRoot . '/urlrewrite.php');
     if ($rewriteFile->isExists()) {
         include $rewriteFile->getPath();
     }
     return $rewriteRules;
 }
开发者ID:vim84,项目名称:b-markt,代码行数:17,代码来源:adminhelper.php

示例8: installBitrix24MailService

 public function installBitrix24MailService()
 {
     if (CModule::IncludeModule("mail")) {
         $result = \Bitrix\Main\SiteTable::getList();
         while (($site = $result->fetch()) !== false) {
             if (CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite($site['LID'])) {
                 continue;
             }
             \Bitrix\Mail\MailServicesTable::add(array('SITE_ID' => $site['LID'], 'ACTIVE' => 'Y', 'NAME' => 'bitrix24', 'SERVICE_TYPE' => 'controller'));
         }
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:12,代码来源:index.php

示例9: __construct

 public function __construct($path, $siteId = null)
 {
     if (empty($path)) {
         throw new InvalidPathException($path);
     }
     $this->originalPath = $path;
     $this->path = Path::normalize($path);
     if ($siteId === null) {
         $this->documentRoot = Main\Application::getDocumentRoot();
     } else {
         $this->documentRoot = Main\SiteTable::getDocumentRoot($siteId);
     }
     if (empty($this->path)) {
         throw new InvalidPathException($path);
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:16,代码来源:filesystementry.php

示例10: delete

 public static function delete($id)
 {
     //We know for sure that languages and sites can refer to the culture.
     //Other entities should place CultureOnBeforeDelete event handler.
     $result = new Entity\DeleteResult();
     $res = LanguageTable::getList(array('filter' => array('=CULTURE_ID' => $id)));
     while ($language = $res->fetch()) {
         $result->addError(new Entity\EntityError(Loc::getMessage("culture_err_del_lang", array("#LID#" => $language["LID"]))));
     }
     $res = \Bitrix\Main\SiteTable::getList(array('filter' => array('=CULTURE_ID' => $id)));
     while ($site = $res->fetch()) {
         $result->addError(new Entity\EntityError(Loc::getMessage("culture_err_del_site", array("#LID#" => $site["LID"]))));
     }
     if (!$result->isSuccess()) {
         return $result;
     }
     return parent::delete($id);
 }
开发者ID:Satariall,项目名称:izurit,代码行数:18,代码来源:culture.php

示例11: checkFields

 public static function checkFields(Entity\Result $result, $primary, array $data)
 {
     parent::checkFields($result, $primary, $data);
     if (isset($data['SITE_ID'])) {
         $selectResult = \Bitrix\Main\SiteTable::getByPrimary($data['SITE_ID']);
         if (!$selectResult->fetch()) {
             $field = static::getEntity()->getField('SITE_ID');
             $result->addError(new Entity\FieldError($field, Localization\Loc::getMessage('MAIN_ENTITY_FIELD_INVALID', array('#FIELD_TITLE#' => $field->getTitle())), Entity\FieldError::INVALID_VALUE));
         }
     }
     if (!empty($data['ICON'])) {
         if (!is_scalar($data['ICON']) || !preg_match('/[0-9]+/', $data['ICON'])) {
             $field = static::getEntity()->getField('ICON');
             $result->addError(new Entity\FieldError($field, Localization\Loc::getMessage('MAIN_ENTITY_FIELD_INVALID', array('#FIELD_TITLE#' => $field->getTitle())), Entity\FieldError::INVALID_VALUE));
         }
     }
     return $result;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:18,代码来源:mailservices.php

示例12: getDocumentRoot

 public static function getDocumentRoot($siteId = null)
 {
     if ($siteId === null) {
         $context = Application::getInstance()->getContext();
         $siteId = $context->getSite();
     }
     if (!isset(self::$documentRootCache[$siteId])) {
         $ar = SiteTable::getRow(array("filter" => array("LID" => $siteId)));
         if ($ar && ($docRoot = $ar["DOC_ROOT"]) && strlen($docRoot) > 0) {
             if (!IO\Path::isAbsolute($docRoot)) {
                 $docRoot = IO\Path::combine(Application::getDocumentRoot(), $docRoot);
             }
             self::$documentRootCache[$siteId] = $docRoot;
         } else {
             self::$documentRootCache[$siteId] = Application::getDocumentRoot();
         }
     }
     return self::$documentRootCache[$siteId];
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:19,代码来源:site.php

示例13: initializeSite

 protected function initializeSite()
 {
     $request = $this->getRequest();
     $currentDirectory = $request->getRequestedPageDirectory();
     $currentDomain = $request->getHttpHost(false);
     $site = SiteTable::getByDomainAndPath($currentDomain, $currentDirectory);
     if ($site === false) {
         $siteList = SiteTable::getList(array('filter' => array('ACTIVE' => 'Y'), 'order' => array('DEF' => 'DESC', 'SORT' => 'ASC'), 'select' => array('*', 'ID' => 'LID')));
         $site = $siteList->fetch();
     }
     if ($site === false) {
         throw new SystemException("Site not found");
     }
     $culture = Context\Culture::wakeUp($site["CULTURE_ID"]);
     if ($culture === null) {
         $culture = new Context\Culture();
     }
     $this->site = new Context\Site($site);
     $this->site->setCulture($culture);
     $this->setContextCulture($culture, $this->site->getLanguage());
 }
开发者ID:Satariall,项目名称:izurit,代码行数:21,代码来源:publicpage.php

示例14: actionAdd

 protected static function actionAdd($name, $arFields)
 {
     if ($name == 'ADDELEMENT') {
         if (!self::checkElement($arFields)) {
             return;
         }
         // we don't have the GLOBAL_ACTIVE flag in $arFields so we should check it manually
         if (is_array($arFields['IBLOCK_SECTION']) && count($arFields['IBLOCK_SECTION']) > 0) {
             $arNewSections = array();
             $arFilter = array('ID' => $arFields['IBLOCK_SECTION'], 'IBLOCK_ID' => $arFields['IBLOCK_ID'], 'GLOBAL_ACTIVE' => 'Y');
             $dbRes = \CIBlockSection::getList(array(), $arFilter, false, array('ID'));
             while ($ar = $dbRes->fetch()) {
                 $arNewSections[] = $ar['ID'];
             }
             if (count($arNewSections) <= 0) {
                 // element is added to inactive sections
                 return;
             }
             $arFields['IBLOCK_SECTION'] = $arNewSections;
         }
     } elseif ($name == 'ADDSECTION') {
         $dbRes = \CIBlockSection::getList(array(), array('ID' => $arFields['ID'], 'GLOBAL_ACTIVE' => 'Y'), false, array('ID'));
         if (!$dbRes->fetch()) {
             // section is added to inactive branch
             return;
         }
     }
     $arSitemaps = SitemapIblockTable::getByIblock($arFields, $name == 'ADDSECTION' ? SitemapIblockTable::TYPE_SECTION : SitemapIblockTable::TYPE_ELEMENT);
     $arFields['TIMESTAMP_X'] = ConvertTimeStamp(false, "FULL");
     if (isset($arFields['IBLOCK_SECTION']) && is_array($arFields['IBLOCK_SECTION']) && count($arFields['IBLOCK_SECTION']) > 0) {
         $arFields['IBLOCK_SECTION_ID'] = min($arFields['IBLOCK_SECTION']);
     }
     if (count($arSitemaps) > 0) {
         $arSiteDirs = array();
         $dbSite = SiteTable::getList(array('select' => array('LID', 'DIR')));
         while ($arSite = $dbSite->fetch()) {
             $arSiteDirs[$arSite['LID']] = $arSite['DIR'];
         }
         foreach ($arSitemaps as $arSitemap) {
             $arFields['LANG_DIR'] = $arSiteDirs[$arSitemap['SITE_ID']];
             $rule = array('url' => $name == 'ADDSECTION' ? \CIBlock::replaceDetailUrl($arSitemaps[0]['SECTION_PAGE_URL'], $arFields, false, "S") : \CIBlock::replaceDetailUrl($arSitemaps[0]['DETAIL_PAGE_URL'], $arFields, false, "E"), 'lastmod' => MakeTimeStamp($arFields['TIMESTAMP_X']));
             $fileName = str_replace(array('#IBLOCK_ID#', '#IBLOCK_CODE#', '#IBLOCK_XML_ID#'), array($arFields['IBLOCK_ID'], $arSitemap['IBLOCK_CODE'], $arSitemap['IBLOCK_XML_ID']), $arSitemap['SITEMAP_FILE_IBLOCK']);
             $sitemapFile = new SitemapFile($fileName, $arSitemap);
             $sitemapFile->appendIblockEntry($rule['url'], $rule['lastmod']);
             $sitemapIndex = new SitemapIndex($arSitemap['SITEMAP_FILE'], $arSitemap);
             $sitemapIndex->appendIndexEntry($sitemapFile);
             if ($arSitemap['ROBOTS'] == 'Y') {
                 $robotsFile = new RobotsFile($arSitemap['SITE_ID']);
                 $robotsFile->addRule(array(RobotsFile::SITEMAP_RULE, $sitemapIndex->getUrl()));
             }
         }
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:53,代码来源:sitemapiblock.php

示例15: InstallDB

 function InstallDB()
 {
     global $APPLICATION;
     global $DB;
     global $errors;
     $bitrix24 = ModuleManager::isModuleInstalled('bitrix24');
     if (!$DB->Query("SELECT 'x' FROM b_catalog_group", true)) {
         $errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/catalog/install/db/" . strtolower($DB->type) . "/install.sql");
     }
     if (!empty($errors)) {
         $APPLICATION->ThrowException(implode("", $errors));
         return false;
     }
     ModuleManager::registerModule('catalog');
     $eventManager = \Bitrix\Main\EventManager::getInstance();
     $eventManager->registerEventHandler('sale', 'onBuildCouponProviders', 'catalog', '\\Bitrix\\Catalog\\DiscountCouponTable', 'couponManager');
     RegisterModuleDependences("iblock", "OnIBlockDelete", "catalog", "CCatalog", "OnIBlockDelete");
     RegisterModuleDependences("iblock", "OnIBlockElementDelete", "catalog", "CCatalogProduct", "OnIBlockElementDelete");
     RegisterModuleDependences("iblock", "OnIBlockElementDelete", "catalog", "CPrice", "OnIBlockElementDelete");
     RegisterModuleDependences("iblock", "OnIBlockElementDelete", "catalog", "CCatalogStoreProduct", "OnIBlockElementDelete");
     RegisterModuleDependences("iblock", "OnIBlockElementDelete", "catalog", "CCatalogDocs", "OnIBlockElementDelete");
     RegisterModuleDependences("iblock", "OnBeforeIBlockElementDelete", "catalog", "CCatalogDocs", "OnBeforeIBlockElementDelete");
     RegisterModuleDependences("currency", "OnCurrencyDelete", "catalog", "CPrice", "OnCurrencyDelete");
     RegisterModuleDependences("main", "OnGroupDelete", "catalog", "CCatalogProductGroups", "OnGroupDelete");
     RegisterModuleDependences("iblock", "OnAfterIBlockElementUpdate", "catalog", "CCatalogProduct", "OnAfterIBlockElementUpdate");
     RegisterModuleDependences("currency", "OnModuleUnInstall", "catalog", "", "CurrencyModuleUnInstallCatalog");
     RegisterModuleDependences("iblock", "OnBeforeIBlockDelete", "catalog", "CCatalog", "OnBeforeCatalogDelete", 300);
     RegisterModuleDependences("iblock", "OnBeforeIBlockElementDelete", "catalog", "CCatalog", "OnBeforeIBlockElementDelete", 10000);
     RegisterModuleDependences("main", "OnEventLogGetAuditTypes", "catalog", "CCatalogEvent", "GetAuditTypes");
     RegisterModuleDependences('main', 'OnBuildGlobalMenu', 'catalog', 'CCatalogAdmin', 'OnBuildGlobalMenu');
     RegisterModuleDependences('main', 'OnAdminListDisplay', 'catalog', 'CCatalogAdmin', 'OnAdminListDisplay');
     RegisterModuleDependences('main', 'OnBuildGlobalMenu', 'catalog', 'CCatalogAdmin', 'OnBuildSaleMenu');
     RegisterModuleDependences("catalog", "OnCondCatControlBuildList", "catalog", "CCatalogCondCtrlGroup", "GetControlDescr", 100);
     RegisterModuleDependences("catalog", "OnCondCatControlBuildList", "catalog", "CCatalogCondCtrlIBlockFields", "GetControlDescr", 200);
     RegisterModuleDependences("catalog", "OnCondCatControlBuildList", "catalog", "CCatalogCondCtrlIBlockProps", "GetControlDescr", 300);
     RegisterModuleDependences("catalog", "OnDocumentBarcodeDelete", "catalog", "CCatalogStoreDocsElement", "OnDocumentBarcodeDelete");
     RegisterModuleDependences("catalog", "OnBeforeDocumentDelete", "catalog", "CCatalogStoreDocsBarcode", "OnBeforeDocumentDelete");
     RegisterModuleDependences("catalog", "OnCatalogStoreDelete", "catalog", "CCatalogDocs", "OnCatalogStoreDelete");
     RegisterModuleDependences("iblock", "OnBeforeIBlockPropertyDelete", "catalog", "CCatalog", "OnBeforeIBlockPropertyDelete");
     RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "catalog", "CCatalogCondCtrlBasketProductFields", "GetControlDescr", 1100);
     RegisterModuleDependences("sale", "OnCondSaleControlBuildList", "catalog", "CCatalogCondCtrlBasketProductProps", "GetControlDescr", 1200);
     RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "catalog", "CCatalogActionCtrlBasketProductFields", "GetControlDescr", 1200);
     RegisterModuleDependences("sale", "OnCondSaleActionsControlBuildList", "catalog", "CCatalogActionCtrlBasketProductProps", "GetControlDescr", 1300);
     RegisterModuleDependences("sale", "OnExtendBasketItems", "catalog", "CCatalogDiscount", "ExtendBasketItems", 100);
     RegisterModuleDependences('iblock', 'OnModuleUnInstall', 'catalog', 'CCatalog', 'OnIBlockModuleUnInstall');
     if (!$bitrix24) {
         CAgent::AddAgent('\\Bitrix\\Catalog\\CatalogViewedProductTable::clearAgent();', 'catalog', 'N', (int) COption::GetOptionString("catalog", "viewed_period") * 24 * 3600);
     }
     $this->InstallTasks();
     $arCount = $DB->Query("select count(ID) as COUNT from b_catalog_measure", true)->Fetch();
     if (is_array($arCount) && isset($arCount['COUNT']) && intval($arCount['COUNT']) <= 0) {
         $DB->Query("insert into b_catalog_measure (CODE, SYMBOL_INTL, SYMBOL_LETTER_INTL, IS_DEFAULT) values(6, 'm', 'MTR', 'N')", true);
         $DB->Query("insert into b_catalog_measure (CODE, SYMBOL_INTL, SYMBOL_LETTER_INTL, IS_DEFAULT) values(112, 'l', 'LTR', 'N')", true);
         $DB->Query("insert into b_catalog_measure (CODE, SYMBOL_INTL, SYMBOL_LETTER_INTL, IS_DEFAULT) values(163, 'g', 'GRM', 'N')", true);
         $DB->Query("insert into b_catalog_measure (CODE, SYMBOL_INTL, SYMBOL_LETTER_INTL, IS_DEFAULT) values(166, 'kg', 'KGM', 'N')", true);
         $DB->Query("insert into b_catalog_measure (CODE, SYMBOL_INTL, SYMBOL_LETTER_INTL, IS_DEFAULT) values(796, 'pc. 1', 'PCE. NMB', 'Y')", true);
     }
     if (!$bitrix24) {
         $languageID = '';
         $siteIterator = SiteTable::getList(array('select' => array('LID', 'LANGUAGE_ID'), 'filter' => array('=DEF' => 'Y', '=ACTIVE' => 'Y')));
         if ($site = $siteIterator->fetch()) {
             $languageID = (string) $site['LANGUAGE_ID'];
         }
         if ($languageID == '') {
             $languageID = 'en';
         }
         if ($languageID == 'ru') {
             $mess = Loc::getMessage('CATALOG_INSTALL_PROFILE_IRR2', null, 'ru');
             if ($mess == '') {
                 $mess = 'irr.ru';
             }
             $strQuery = "select COUNT(CE.ID) as CNT from b_catalog_export CE where CE.IS_EXPORT = 'Y' and CE.FILE_NAME ='yandex' and CE.NAME = '" . $DB->ForSql($mess) . "'";
             $rsProfiles = $DB->Query($strQuery, true);
             if (false !== $rsProfiles) {
                 $arProfile = $rsProfiles->Fetch();
                 if ((int) $arProfile['CNT'] == 0) {
                     $arFields = array('FILE_NAME' => 'yandex', 'NAME' => $mess, 'DEFAULT_PROFILE' => 'N', 'IN_MENU' => 'N', 'IN_AGENT' => 'N', 'IN_CRON' => 'N', 'NEED_EDIT' => 'Y', 'IS_EXPORT' => 'Y');
                     $arInsert = $DB->PrepareInsert("b_catalog_export", $arFields);
                     $strQuery = "INSERT INTO b_catalog_export(" . $arInsert[0] . ") VALUES(" . $arInsert[1] . ")";
                     $DB->Query($strQuery, true);
                 }
             }
         }
     }
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:86,代码来源:index.php


注:本文中的Bitrix\Main\SiteTable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。