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


PHP CExtranet::getExtranetSiteID方法代碼示例

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


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

示例1: prepareParams

 /**
  * Prepares component parameters.
  * @return $this
  * @throws ArgumentException
  */
 protected function prepareParams()
 {
     parent::prepareParams();
     if (!empty($this->arParams['STORAGE'])) {
         if (!$this->arParams['STORAGE'] instanceof Storage) {
             throw new ArgumentException('STORAGE must be instance of \\Bitrix\\Disk\\Storage');
         }
     } elseif (!empty($this->arParams['STORAGE_ID'])) {
         $this->arParams['STORAGE_ID'] = (int) $this->arParams['STORAGE_ID'];
     } else {
         if (empty($this->arParams['STORAGE_MODULE_ID'])) {
             throw new ArgumentException('STORAGE_MODULE_ID required');
         }
         if (empty($this->arParams['STORAGE_ENTITY_TYPE'])) {
             throw new ArgumentException('STORAGE_ENTITY_TYPE required');
         }
         if (!isset($this->arParams['STORAGE_ENTITY_ID'])) {
             throw new ArgumentException('STORAGE_ENTITY_ID required');
         }
     }
     if (empty($this->arParams['PATH_TO_USER'])) {
         $siteId = SITE_ID;
         $currentUser = User::buildFromArray($this->getUser()->getById($this->getUser()->getId())->fetch());
         $default = '/company/personal/user/#user_id#/';
         if ($currentUser->isExtranetUser()) {
             /** @noinspection PhpDynamicAsStaticMethodCallInspection */
             $siteId = \CExtranet::getExtranetSiteID();
             $default = '/extranet/contacts/personal/user/#user_id#/';
         }
         $this->arParams['PATH_TO_USER'] = strtolower(COption::getOptionString('intranet', 'path_user', $default, $siteId));
     }
     return $this;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:38,代碼來源:diskcomponent.php

示例2: getDestinations

 protected function getDestinations()
 {
     $isExtranetInstalled = Loader::includeModule("extranet");
     $members = array();
     if ($this->blogPostData["HAS_SOCNET_ALL"] != "Y") {
         /** @noinspection PhpDynamicAsStaticMethodCallInspection */
         $perm = \CBlogPost::getSocnetPermsName($this->entityId);
         foreach ($perm as $type => $v) {
             foreach ($v as $vv) {
                 if ($type == "SG") {
                     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
                     if ($socNetGroup = \CSocNetGroup::getByID($vv["ENTITY_ID"])) {
                         $name = $socNetGroup["~NAME"];
                         $link = \CComponentEngine::makePathFromTemplate($this->getPathToGroup(), array("group_id" => $vv["ENTITY_ID"]));
                         $groupSiteID = false;
                         /** @noinspection PhpDynamicAsStaticMethodCallInspection */
                         $queryGroupSite = \CSocNetGroup::getSite($vv["ENTITY_ID"]);
                         while ($groupSite = $queryGroupSite->fetch()) {
                             /** @noinspection PhpDynamicAsStaticMethodCallInspection */
                             if (!$isExtranetInstalled || $groupSite["LID"] != \CExtranet::getExtranetSiteID()) {
                                 $groupSiteID = $groupSite["LID"];
                                 break;
                             }
                         }
                         if ($groupSiteID) {
                             /** @noinspection PhpDynamicAsStaticMethodCallInspection */
                             $tmp = \CSocNetLogTools::processPath(array("GROUP_URL" => $link), $this->getUser()->getId(), $groupSiteID);
                             // user_id is not important parameter
                             $link = strlen($tmp["URLS"]["GROUP_URL"]) > 0 ? $tmp["URLS"]["GROUP_URL"] : $link;
                         }
                         $isExtranet = is_array($GLOBALS["arExtranetGroupID"]) && in_array($vv["ENTITY_ID"], $GLOBALS["arExtranetGroupID"]);
                         $members[] = array("NAME" => $name, "LINK" => $link, 'AVATAR_SRC' => Ui\Avatar::getGroup($socNetGroup['IMAGE_ID']), "IS_EXTRANET" => $isExtranet ? "Y" : "N");
                     }
                 } elseif ($type == "U") {
                     if (in_array("US" . $vv["ENTITY_ID"], $vv["ENTITY"])) {
                         array_unshift($members, array("NAME" => Loc::getMessage('DISK_UF_BLOG_POST_CONNECTOR_MEMBERS_ALL'), "LINK" => null, 'AVATAR_SRC' => Ui\Avatar::getDefaultGroup(), "IS_EXTRANET" => "N"));
                     } else {
                         $name = \CUser::formatName('#NAME# #LAST_NAME#', array("NAME" => $vv["~U_NAME"], "LAST_NAME" => $vv["~U_LAST_NAME"], "SECOND_NAME" => $vv["~U_SECOND_NAME"], "LOGIN" => $vv["~U_LOGIN"], "NAME_LIST_FORMATTED" => ""), false);
                         $isExtranet = is_array($GLOBALS["arExtranetUserID"]) && in_array($vv["ENTITY_ID"], $GLOBALS["arExtranetUserID"]);
                         $members[] = array("NAME" => $name, "LINK" => \CComponentEngine::makePathFromTemplate($this->getPathToUser(), array("user_id" => $vv["ENTITY_ID"])), 'AVATAR_SRC' => Ui\Avatar::getPerson($vv['U_PERSONAL_PHOTO']), "IS_EXTRANET" => $isExtranet ? "Y" : "N");
                     }
                 } elseif ($type == "DR") {
                     $members[] = array("NAME" => $vv["EL_NAME"], "LINK" => null, 'AVATAR_SRC' => Ui\Avatar::getDefaultGroup(), "IS_EXTRANET" => "N");
                 }
             }
         }
     } else {
         $members[] = array("NAME" => Loc::getMessage('DISK_UF_BLOG_POST_CONNECTOR_MEMBERS_ALL'), "LINK" => null, 'AVATAR_SRC' => Ui\Avatar::getDefaultGroup(), "IS_EXTRANET" => "N");
     }
     return $members;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:51,代碼來源:blogpostconnector.php

示例3: getPathToUserLib

 /**
  * @return string
  */
 private function getPathToUserLib()
 {
     $siteId = SITE_ID;
     if ($this->isExtranetUser()) {
         $siteId = CExtranet::getExtranetSiteID();
     }
     $pathToUserLib = COption::getOptionString('intranet', 'path_user', '/company/personal/user/#USER_ID#/', $siteId);
     if (!empty($pathToUserLib)) {
         $pathToUserLib = str_replace(array('#USER_ID#', '#user_id#'), $this->getUser()->getID(), $pathToUserLib);
         $pathToUserLib = $pathToUserLib . 'files/lib/';
     } else {
         $pathToUserLib = '/company/personal/user/' . $this->getUser()->getId() . '/files/lib/';
     }
     return $pathToUserLib;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:18,代碼來源:diskdispatcher.php


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