本文整理汇总了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;
}
示例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;
}
示例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;
}