$arParams["NAME_TEMPLATE"] = CSite::GetNameFormat(); } $arSubDeps = CIntranetUtils::getSubordinateDepartments($USER->GetID(), true); if ($arParams["GROUP_ID_FOR_SITE"] && CModule::IncludeModule("extranet") && CModule::IncludeModule("socialnetwork")) { $arSites = array(); $rsGroupSite = CSocNetGroup::GetSite($arParams["GROUP_ID_FOR_SITE"]); while ($arGroupSite = $rsGroupSite->Fetch()) { $arSites[] = $arGroupSite["LID"]; } $extranetSiteId = CExtranet::GetExtranetSiteID(); if ($extranetSiteId && in_array($extranetSiteId, $arSites)) { $GLOBALS['GROUP_SITE_ID'] = $extranetSiteId; } } $arManagers = array(); if (($arDepartments = CIntranetUtils::getUserDepartments($USER->GetID())) && is_array($arDepartments) && count($arDepartments) > 0) { $arManagers = array_keys(CIntranetUserSelectorHelper::getDepartmentManagersId($arDepartments, $USER->getID(), true)); } $iBlockId = COption::GetOptionInt('intranet', 'iblock_structure'); $arSecFilter = array('IBLOCK_ID' => $iBlockId); if ($bSubordinateOnly) { if (!$arSubDeps) { $arSubDeps = array(-1); } $arSecFilter["ID"] = $arSubDeps; } $arStructure = $arSections = array(); if ($arParams["DISPLAY_TAB_STRUCTURE"] == 'Y' && (!CModule::IncludeModule('extranet') || CExtranet::IsIntranetUser())) { $arStructure = CIntranetUtils::getSubStructure(0, 1); $arSections = $arStructure['DATA']; $arStructure = $arStructure['TREE'];