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


PHP CAccess::GetLastRecentlyUsed方法代码示例

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


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

示例1: GetFormHtml

 public function GetFormHtml($arParams = false)
 {
     global $USER;
     if (is_array($arParams["user"]) && $arParams["user"]["disabled"] == "true") {
         return false;
     }
     if (!$USER->CanDoOperation('view_all_users')) {
         return false;
     }
     $elements = "";
     $arFinderParams = array("PROVIDER" => $this->id, "TYPE" => 2);
     $arLRU = CAccess::GetLastRecentlyUsed($this->id);
     if (!empty($arLRU)) {
         foreach ($arLRU as $i => $val) {
             $arLRU[$i] = substr($val, 1);
         }
         $nameFormat = CSite::GetNameFormat(false);
         //be careful with field list because of CUser::FormatName()
         $res = CUser::GetList($by = "LAST_NAME", $order = "asc", array("ID" => implode("|", $arLRU)), array("FIELDS" => array('ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL')));
         while ($arUser = $res->Fetch()) {
             $arItem = array("ID" => "U" . $arUser["ID"], "NAME" => CUser::FormatName($nameFormat, $arUser, true, false));
             $elements .= CFinder::GetFinderItem($arFinderParams, $arItem);
         }
     }
     $arPanels = array(array("NAME" => GetMessage("authprov_last"), "ELEMENTS" => $elements), array("NAME" => GetMessage("authprov_search"), "ELEMENTS" => CFinder::GetFinderItem(array("TYPE" => "text"), array("TEXT" => GetMessage("authprov_user"))), "SEARCH" => "Y"));
     $html = CFinder::GetFinderAppearance($arFinderParams, $arPanels);
     return array("HTML" => $html);
 }
开发者ID:ASDAFF,项目名称:open_bx,代码行数:28,代码来源:authproviders.php

示例2: GetFormHtml

 public function GetFormHtml($arParams = false)
 {
     global $USER;
     if (!$USER->CanDoOperation('view_all_users')) {
         return false;
     }
     $elements = "";
     $arFinderParams = array("PROVIDER" => $this->id, "TYPE" => 2);
     $arLRU = CAccess::GetLastRecentlyUsed($this->id);
     if (!empty($arLRU)) {
         foreach ($arLRU as $i => $val) {
             $arLRU[$i] = substr($val, 1);
         }
         $res = CUser::GetList($by = "LAST_NAME", $order = "asc", array("ID" => implode("|", $arLRU)));
         while ($arUser = $res->Fetch()) {
             $arItem = array("ID" => "U" . $arUser["ID"], "NAME" => CUser::FormatName(CSite::GetNameFormat(false), $arUser, true, false));
             $elements .= CFinder::GetFinderItem($arFinderParams, $arItem);
         }
     }
     $arPanels = array(array("NAME" => GetMessage("authprov_last"), "ELEMENTS" => $elements), array("NAME" => GetMessage("authprov_search"), "ELEMENTS" => CFinder::GetFinderItem(array("TYPE" => "text"), array("TEXT" => GetMessage("authprov_user"))), "SEARCH" => "Y"));
     $html = CFinder::GetFinderAppearance($arFinderParams, $arPanels);
     return array("HTML" => $html);
 }
开发者ID:,项目名称:,代码行数:23,代码来源:

示例3: GetFormHtml

 public function GetFormHtml($arParams = false)
 {
     global $USER;
     if (is_array($arParams["socnetgroups"]) && $arParams["socnetgroups"]["disabled"] == "true") {
         return false;
     }
     $currElements = '';
     if (is_array($arParams[$this->id]) && ($group_id = intval($arParams[$this->id]["group_id"])) > 0) {
         $arFinderParams = array("PROVIDER" => $this->id, "TYPE" => 4);
         $arFilter = array("ID" => $group_id, "ACTIVE" => "Y");
         if (!CSocNetUser::IsCurrentUserModuleAdmin($arParams["SITE_ID"])) {
             $arFilter["CHECK_PERMISSIONS"] = $USER->GetID();
         }
         $rsGroups = CSocNetGroup::GetList(array(), $arFilter);
         if ($arGroup = $rsGroups->Fetch()) {
             $arItem = array("ID" => "SG" . $arGroup['ID'], "AVATAR" => '/bitrix/js/main/core/images/access/avatar-user-everyone.png', "NAME" => $arGroup['NAME'], "DESC" => $arGroup['DESCRIPTION'], "OPEN" => "Y", "CHECKBOX" => array("#ID#_A" => GetMessage("authprov_sg_a"), "#ID#_E" => GetMessage("authprov_sg_e"), "#ID#_K" => GetMessage("authprov_sg_k")));
             if ($arGroup["IMAGE_ID"]) {
                 $imageFile = CFile::GetFileArray($arGroup["IMAGE_ID"]);
                 if ($imageFile !== false) {
                     $arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_PROPORTIONAL, false);
                     $arItem["AVATAR"] = $arFileTmp["src"];
                 }
             }
             $currElements .= CFinder::GetFinderItem($arFinderParams, $arItem);
         }
     }
     $elements = "";
     $arFinderParams = array("PROVIDER" => $this->id, "TYPE" => 3);
     $arLRU = CAccess::GetLastRecentlyUsed($this->id);
     if (!empty($arLRU)) {
         $arLast = array();
         $arLastID = array();
         $arElements = array();
         foreach ($arLRU as $val) {
             if (preg_match('/^SG([0-9]+)_([A-Z])/', $val, $match)) {
                 $arLast[$match[2]][$match[1]] = $match[1];
                 $arLastID[$match[1]] = $match[1];
             }
         }
         if (!empty($arLastID)) {
             $arFilter = array("ID" => $arLastID, "ACTIVE" => "Y");
             if ($arParams["SITE_ID"] != '') {
                 $arFilter["SITE_ID"] = $arParams["SITE_ID"];
             }
             if (!CSocNetUser::IsCurrentUserModuleAdmin($arParams["SITE_ID"])) {
                 $arFilter["CHECK_PERMISSIONS"] = $USER->GetID();
             }
             $rsGroups = CSocNetGroup::GetList(array("NAME" => "ASC"), $arFilter);
             while ($arGroup = $rsGroups->Fetch()) {
                 $arItem = array("ID" => $arGroup['ID'], "AVATAR" => '/bitrix/js/main/core/images/access/avatar-user-everyone.png', "NAME" => $arGroup['NAME'], "DESC" => $arGroup['DESCRIPTION']);
                 if ($arGroup["IMAGE_ID"]) {
                     $imageFile = CFile::GetFileArray($arGroup["IMAGE_ID"]);
                     if ($imageFile !== false) {
                         $arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_PROPORTIONAL, false);
                         $arItem["AVATAR"] = $arFileTmp["src"];
                     }
                 }
                 $arElements[$arItem['ID']] = $arItem;
             }
             foreach ($arLRU as $val) {
                 if (preg_match('/^SG([0-9]+)_([A-Z])/', $val, $match)) {
                     $arItem = $arElements[$match[1]];
                     if ($match[2] == 'K') {
                         $arItem['ID'] = 'SG' . $arElements[$match[1]]['ID'] . '_K';
                         $arItem['NAME'] = $arElements[$match[1]]['NAME'] . ': ' . GetMessage("authprov_sg_k");
                     } else {
                         if ($match[2] == 'E') {
                             $arItem['ID'] = 'SG' . $arElements[$match[1]]['ID'] . '_E';
                             $arItem['NAME'] = $arElements[$match[1]]['NAME'] . ': ' . GetMessage("authprov_sg_e");
                         } else {
                             if ($match[2] == 'A') {
                                 $arItem['ID'] = 'SG' . $arElements[$match[1]]['ID'] . '_A';
                                 $arItem['NAME'] = $arElements[$match[1]]['NAME'] . ': ' . GetMessage("authprov_sg_a");
                             }
                         }
                     }
                     $elements .= CFinder::GetFinderItem($arFinderParams, $arItem);
                 }
             }
         }
     }
     $arFinderParams = array("PROVIDER" => $this->id, "TYPE" => 4);
     $arFilter = array("USER_ID" => $USER->GetID(), "<=ROLE" => SONET_ROLES_USER, "GROUP_ACTIVE" => "Y");
     if ($arParams["SITE_ID"] != '') {
         $arFilter["GROUP_SITE_ID"] = $arParams["SITE_ID"];
     }
     $rsGroups = CSocNetUserToGroup::GetList(array("GROUP_NAME" => "ASC"), $arFilter, false, array(), array("ID", "GROUP_ID", "GROUP_NAME", "GROUP_DESCRIPTION", "GROUP_IMAGE_ID"));
     $myElements = '';
     while ($arGroup = $rsGroups->Fetch()) {
         $arItem = array("ID" => "SG" . $arGroup['GROUP_ID'], "AVATAR" => $arGroup['GROUP_IMAGE_ID'], "NAME" => $arGroup['GROUP_NAME'], "DESC" => $arGroup['GROUP_DESCRIPTION'], "CHECKBOX" => array("#ID#_A" => GetMessage("authprov_sg_a"), "#ID#_E" => GetMessage("authprov_sg_e"), "#ID#_K" => GetMessage("authprov_sg_k")));
         if ($arGroup["GROUP_IMAGE_ID"]) {
             $imageFile = CFile::GetFileArray($arGroup["GROUP_IMAGE_ID"]);
             if ($imageFile !== false) {
                 $arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_PROPORTIONAL, false);
                 $arItem["AVATAR"] = $arFileTmp["src"];
             }
         }
         $myElements .= CFinder::GetFinderItem($arFinderParams, $arItem);
     }
     $arPanels = array();
//.........这里部分代码省略.........
开发者ID:rasuldev,项目名称:torino,代码行数:101,代码来源:authproviders.php

示例4: GetFormHtml

 public function GetFormHtml($arParams = false)
 {
     global $USER;
     if (!$USER->IsAuthorized()) {
         return false;
     }
     $elements = '';
     $arElement = array();
     $arElements = array();
     $arLRU = CAccess::GetLastRecentlyUsed($this->id);
     if (!empty($arLRU)) {
         $arFinderParams = array('PROVIDER' => $this->id, 'TYPE' => 3);
         $arLast = array();
         $arLastID = array();
         foreach ($arLRU as $val) {
             if (substr($val, 0, 2) == 'DR') {
                 $id = substr($val, 2);
                 $arLast['DR'][] = $id;
                 $arLastID[$id] = $id;
             } else {
                 if (substr($val, 0, 1) == 'D') {
                     $id = substr($val, 1);
                     $arLast['D'][] = $id;
                     $arLastID[$id] = $id;
                 } else {
                     if (substr($val, 0, 2) == 'IU') {
                         $arLast['U'][] = substr($val, 2);
                     }
                 }
             }
         }
         $dbRes = CIBlockSection::GetList(array('ID' => 'ASC'), array('IBLOCK_ID' => COption::GetOptionInt('intranet', 'iblock_structure'), 'ID' => $arLastID), false, array('ID', 'NAME'));
         while ($arSection = $dbRes->Fetch()) {
             $arElement[$arSection['ID']] = $arSection;
         }
         if (!empty($arLast['DR'])) {
             foreach ($arLast['DR'] as $value) {
                 $arItem = array("ID" => 'DR' . $arElement[$value]['ID'], "NAME" => $arElement[$value]['NAME'] . ': ' . GetMessage("authprov_check_dr"), "AVATAR" => '/bitrix/js/main/core/images/access/avatar-user-everyone.png');
                 $arElements['DR' . $value] = CFinder::GetFinderItem($arFinderParams, $arItem);
             }
         }
         if (!empty($arLast['D'])) {
             foreach ($arLast['D'] as $value) {
                 $arItem = array("ID" => 'D' . $arElement[$value]['ID'], "NAME" => $arElement[$value]['NAME'] . ': ' . GetMessage("authprov_check_d"), "AVATAR" => '/bitrix/js/main/core/images/access/avatar-user-everyone.png');
                 $arElements['D' . $value] = CFinder::GetFinderItem($arFinderParams, $arItem);
             }
         }
         if (!empty($arLast['U'])) {
             //be careful with field list because of CUser::FormatName()
             $res = CUser::GetList($by = "LAST_NAME", $order = "asc", array("ID" => implode("|", $arLast['U'])), array("FIELDS" => array('ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL', 'PERSONAL_PHOTO', 'PERSONAL_GENDER', 'WORK_POSITION', 'PERSONAL_PROFESSION')));
             while ($arUser = $res->Fetch()) {
                 $arPhoto = array('IMG' => '');
                 if (!$arUser['PERSONAL_PHOTO']) {
                     switch ($arUser['PERSONAL_GENDER']) {
                         case "M":
                             $suffix = "male";
                             break;
                         case "F":
                             $suffix = "female";
                             break;
                         default:
                             $suffix = "unknown";
                     }
                     $arUser['PERSONAL_PHOTO'] = COption::GetOptionInt("socialnetwork", "default_user_picture_" . $suffix, false, SITE_ID);
                 }
                 if ($arUser['PERSONAL_PHOTO'] > 0) {
                     $arPhoto = CIntranetUtils::InitImage($arUser['PERSONAL_PHOTO'], 30);
                 }
                 $arItem = array("ID" => "IU" . $arUser["ID"], "NAME" => CUser::FormatName(CSite::GetNameFormat(false), $arUser, true, false), "AVATAR" => $arPhoto['CACHE']['src'], "DESC" => $arUser['WORK_POSITION'] ? $arUser['WORK_POSITION'] : $arUser['PERSONAL_PROFESSION']);
                 $elements .= CFinder::GetFinderItem($arFinderParams, $arItem);
             }
         }
         foreach ($arLRU as $val) {
             $elements .= $arElements[$val];
         }
     }
     $arFinderParams = array('PROVIDER' => 'intranet', 'TYPE' => 'structure');
     $obCache = new CPHPCache();
     $IBlockID = COption::GetOptionInt('intranet', 'iblock_structure');
     $arSecFilter = array('IBLOCK_ID' => $IBlockID);
     $arStructure = array();
     $arSections = array();
     if (!CModule::IncludeModule('extranet') || CExtranet::IsIntranetUser()) {
         $cache_id = md5(serialize($arSecFilter));
         $cacheDir = '/intranet';
         if ($obCache->InitCache(30 * 86400, $cache_id, $cacheDir)) {
             $vars = $obCache->GetVars();
             $arSections = $vars["SECTIONS"];
             $arStructure = $vars["STRUCTURE"];
         } elseif ($obCache->StartDataCache()) {
             global $CACHE_MANAGER;
             $CACHE_MANAGER->StartTagCache($cacheDir);
             $CACHE_MANAGER->RegisterTag("iblock_id_" . $IBlockID);
             $dbRes = CIBlockSection::GetTreeList($arSecFilter);
             while ($arRes = $dbRes->Fetch()) {
                 $iblockSectionID = intval($arRes['IBLOCK_SECTION_ID']);
                 if (!is_array($arStructure[$iblockSectionID])) {
                     $arStructure[$iblockSectionID] = array($arRes['ID']);
                 } else {
                     $arStructure[$iblockSectionID][] = $arRes['ID'];
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:authproviders.php


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