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


PHP CIntranetUtils::GetIBlockTopSection方法代码示例

本文整理汇总了PHP中CIntranetUtils::GetIBlockTopSection方法的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils::GetIBlockTopSection方法的具体用法?PHP CIntranetUtils::GetIBlockTopSection怎么用?PHP CIntranetUtils::GetIBlockTopSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIntranetUtils的用法示例。


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

示例1: CPHPCache

}
$cacheDir = SITE_ID . '/intranet/user_info/';
$obUserCache = new CPHPCache();
if ($obUserCache->InitCache($cacheTtl, $cacheID, $cacheDir)) {
    $cacheData = $obUserCache->GetVars();
    $arResult['CURRENT_USER'] = $cacheData['CURRENT_USER'];
    $arResult['ONLY_MINE'] = $cacheData['ONLY_MINE'];
    unset($cacheData);
} else {
    global $CACHE_MANAGER;
    $CACHE_MANAGER->StartTagCache($cacheDir);
    if ($arParams['bShowFilter']) {
        $dbCurrentUser = CUser::GetByID($GLOBALS['USER']->GetID());
        $arResult['CURRENT_USER'] = $dbCurrentUser->Fetch();
        if ($arParams['bShowFilter'] = !!$arResult['CURRENT_USER']['UF_DEPARTMENT']) {
            $arResult['CURRENT_USER']['DEPARTMENT_TOP'] = CIntranetUtils::GetIBlockTopSection($arResult['CURRENT_USER']['UF_DEPARTMENT']);
            if (intval($arResult['DEPARTMENT']) == $arResult['CURRENT_USER']['DEPARTMENT_TOP']) {
                $arResult['ONLY_MINE'] = 'Y';
            }
        }
    }
    $CACHE_MANAGER->RegisterTag('bx_user_intranet_info_' . $arResult['CURRENT_USER']['ID']);
    $CACHE_MANAGER->EndTagCache();
}
if ($obUserCache->StartDataCache()) {
    $obUserCache->EndDataCache(array('CURRENT_USER' => $arResult['CURRENT_USER'], 'ONLY_MINE' => $arResult['ONLY_MINE']));
}
foreach ($arResult['USERS'] as $key => $arUser) {
    if ($arUser['PERSONAL_PHOTO']) {
        $imageFile = CFile::GetFileArray($arUser['PERSONAL_PHOTO']);
        if ($imageFile !== false) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:result_modifier.php

示例2: GetListItemChangesSinceToken

 function GetListItemChangesSinceToken($listName, $viewFields = '', $query = '', $rowLimit = 0, $changeToken = '')
 {
     global $APPLICATION, $USER;
     if (!($listName_original = CIntranetUtils::checkGUID($listName))) {
         return new CSoapFault('Data error', 'Wrong GUID - ' . $listName);
     }
     if (!$USER->IsAdmin() && (!defined("IS_EXTRANET") || IS_EXTRANET != "Y")) {
         $rsUsers = CUser::GetList($by = "id", $order = "asc", array("ID" => $USER->GetID()), array("SELECT" => array("UF_DEPARTMENT")));
         if ($arUser = $rsUsers->Fetch()) {
             if (intval($arUser["UF_DEPARTMENT"][0]) > 0) {
                 $bUserIntranet = true;
             }
         }
         if (!$bUserIntranet) {
             return new CSoapFault('Data error', 'User has no permissions to read intranet contacts');
         }
     }
     $listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
     $arFilter = array('ACTIVE' => 'Y');
     $page = 1;
     $bUpdateFields = false;
     $tsLastFieldsChange = COption::GetOptionString('intranet', 'ws_contacts_last_fields_change', false);
     $this->bGetImages = COption::GetOptionString('intranet', 'ws_contacts_get_images', 'Y') == 'Y';
     if (strlen($changeToken) > 0) {
         if ($pos = strpos($changeToken, ';')) {
             list($newChangeToken, $page, $last_change) = explode(';', $changeToken);
             $page++;
             $changeToken = $newChangeToken;
         }
         $arFilter['TIMESTAMP_X_1'] = ConvertTimeStamp($changeToken, 'FULL');
         if (!$arFilter['TIMESTAMP_X_1']) {
             return new CSoapFault('Params error', 'Wrong changeToken: ' . $changeToken);
         }
         if ($tsLastFieldsChange !== false && $tsLastFieldsChange > $changeToken) {
             $bUpdateFields = true;
         }
     }
     if (CModule::IncludeModule('extranet') && defined("IS_EXTRANET") && IS_EXTRANET == "Y") {
         $arFilter["GROUPS_ID"] = array(COption::GetOptionInt("extranet", "extranet_group"));
     }
     if (!CModule::IncludeModule('extranet') || defined("IS_EXTRANET") && IS_EXTRANET == "Y" && defined("IS_EMPLOYEES") && IS_EMPLOYEES == "Y" || (!defined("IS_EXTRANET") || IS_EXTRANET != "Y")) {
         $arFilter["!UF_DEPARTMENT"] = false;
     } else {
         $arFilter["UF_DEPARTMENT"] = false;
     }
     // it's needed to check is current user an intranet user if he requested intranet script
     $arListParams = array("SELECT" => array("UF_DEPARTMENT"));
     if ($rowLimit > 0) {
         $arListParams["NAV_PARAMS"] = array("nPageSize" => $rowLimit, "bShowAll" => false, "iNumPage" => $page);
     }
     $obUsers = CUser::GetList($by = 'id', $order = 'asc', $arFilter, $arListParams);
     if (!isset($last_change)) {
         $last_change = 0;
     }
     $data = new CXMLCreator('listitems');
     $data->setAttribute('MinTimeBetweenSyncs', 0);
     $data->setAttribute('RecommendedTimeBetweenSyncs', 180);
     $data->setAttribute('TimeStamp', $this->__makeDateTime());
     $data->setAttribute('EffectivePermMask', 'FullMask');
     $data->addChild($obChanges = new CXMLCreator('Changes'));
     if ((!$changeToken || $bUpdateFields) && $page <= 1) {
         $arGetListResult = $this->GetList($listName);
         $obChanges->addChild($arGetListResult['GetListResult']);
     }
     //TODO: the next thing is to do something like this for all deleted events.
     //$obChanges->addChild($obId = new CXMLCreator('Id'));
     //$obId->setAttribute('ChangeType', 'Delete');
     //$obId->setData('702');
     //<Id ChangeType="Delete">14</Id>
     $data->addChild($obData = new CXMLCreator('rs:data'));
     $counter = 0;
     if (CModule::IncludeModule('extranet') && defined("IS_EXTRANET") && IS_EXTRANET == "Y") {
         $arUsersInMyGroupsID = CExtranet::GetMyGroupsUsers(CExtranet::GetExtranetSiteID());
         $arPublicUsersID = CExtranet::GetPublicUsers();
     }
     while ($arUser = $obUsers->Fetch()) {
         if (CModule::IncludeModule('extranet') && !CExtranet::IsExtranetAdmin()) {
             if (defined("IS_EXTRANET") && IS_EXTRANET == "Y" && (!in_array($arUser["ID"], $arUsersInMyGroupsID) && !in_array($arUser["ID"], $arPublicUsersID) || $arUser["ID"] == $USER->GetID())) {
                 continue;
             }
         }
         if (is_array($arUser['UF_DEPARTMENT']) && count($arUser['UF_DEPARTMENT']) > 0) {
             if ($this->arDepartmentsCache[$arUser['UF_DEPARTMENT'][0]]) {
                 $arUser['WORK_COMPANY'] = $this->arDepartmentsTopCache[$arUser['UF_DEPARTMENT'][0]];
                 $arUser['UF_DEPARTMENT'] = $this->arDepartmentsCache[$arUser['UF_DEPARTMENT'][0]];
             } else {
                 $dbRes = CIBlockSection::GetByID($arUser['UF_DEPARTMENT'][0]);
                 if ($arRes = $dbRes->Fetch()) {
                     if (!defined("IS_EXTRANET") || IS_EXTRANET != "Y" || defined("IS_EMPLOYEES") && IS_EMPLOYEES == "Y") {
                         $arUser['DEPARTMENT'] = $this->arDepartmentsCache[$arUser['UF_DEPARTMENT'][0]] = $arRes['NAME'];
                     }
                     // this case crashes inner cache of top departments
                     //if (!$arUser['WORK_COMPANY'])
                     //{
                     if ($top_section = CIntranetUtils::GetIBlockTopSection($arUser['UF_DEPARTMENT'])) {
                         $dbRes = CIBlockSection::GetByID($top_section);
                         if ($arRes = $dbRes->Fetch()) {
                             $arUser['WORK_COMPANY'] = $this->arDepartmentsTopCache[$arUser['UF_DEPARTMENT'][0]] = $arRes['NAME'];
                         }
                     }
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:ws_contacts.php


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