當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSite::getDefSite方法代碼示例

本文整理匯總了PHP中CSite::getDefSite方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSite::getDefSite方法的具體用法?PHP CSite::getDefSite怎麽用?PHP CSite::getDefSite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSite的用法示例。


在下文中一共展示了CSite::getDefSite方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadDataProcesses

 protected function loadDataProcesses()
 {
     $this->arResult['SYSTEM_PROCESSES'] = array();
     $this->arResult['USER_PROCESSES'] = array();
     try {
         $defaultSiteId = CSite::getDefSite();
         $iterator = CSite::getByID($defaultSiteId);
         $site = $iterator->fetch();
         $defaultLang = $site ? $site['LANGUAGE_ID'] : 'en';
         if ($defaultLang == 'ua') {
             $defaultLang = 'ru';
         }
         \Bitrix\Lists\Importer::loadDataProcesses($defaultLang, true, $this->arResult['SYSTEM_PROCESSES']);
         \Bitrix\Lists\Importer::loadDataProcesses($defaultLang, false, $this->arResult['USER_PROCESSES']);
         $this->checkForIblock($this->arResult['SYSTEM_PROCESSES']);
         $this->checkForIblock($this->arResult['USER_PROCESSES']);
     } catch (Exception $e) {
         $this->errors[] = $e->getMessage();
     }
     if (empty($this->arResult['SYSTEM_PROCESSES']) && empty($this->arResult['USER_PROCESSES'])) {
         $this->errors[] = Loc::getMessage('CC_LCP_NOT_PROCESSES');
     }
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:23,代碼來源:class.php

示例2: getUserStorageId

 /**
  * @return array
  * @throws Exception
  */
 protected function getUserStorageId()
 {
     if ($this->enableDiskModule) {
         $storage = \Bitrix\Disk\Driver::getInstance()->getStorageByUserId($this->getUser()->getId());
         if (!$storage) {
             $storage = \Bitrix\Disk\Driver::getInstance()->addUserStorage($this->getUser()->getId());
         }
         if ($storage) {
             return array('IBLOCK_ID' => $storage->getId(), 'IBLOCK_SECTION_ID' => $storage->getRootObjectId());
         }
     }
     $userFilesOptions = COption::getOptionString('webdav', 'user_files', null);
     if ($userFilesOptions == null) {
         throw new Exception('Where are options "user_files"?');
     }
     $userFilesOptions = unserialize($userFilesOptions);
     $iblockId = $userFilesOptions[CSite::getDefSite()]['id'];
     $userSectionId = CWebDavIblock::getRootSectionIdForUser($iblockId, $this->getUser()->getId());
     if (!$userSectionId) {
         throw new Exception('Wrong section for user ' . $this->getUser()->getLastName());
     }
     return array('IBLOCK_ID' => $iblockId, 'IBLOCK_SECTION_ID' => $userSectionId);
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:27,代碼來源:diskdispatcher.php


注:本文中的CSite::getDefSite方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。