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


PHP CBXFeatures::isFeatureEnabled方法代码示例

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


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

示例1: getUserGroupWithStorage

 protected function getUserGroupWithStorage()
 {
     if (!\CBXFeatures::isFeatureEnabled("Workgroups")) {
         return array();
     }
     if (!Loader::includeModule('socialnetwork')) {
         return array();
     }
     $userId = $this->getUser()->getId();
     $currentPossibleUserGroups = $currentUserGroups = array();
     $cache = Cache::createInstance();
     $cacheTtl = defined('BX_COMP_MANAGED_CACHE') ? 3153600 : 3600 * 4;
     $cachePath = "/disk/uf/{$userId}";
     if ($cache->initCache($cacheTtl, 'group_storage_list_' . SITE_ID . '_' . $userId, $cachePath)) {
         list($currentUserGroups) = $cache->getVars();
     } else {
         $cache->startDataCache();
         $taggedCache = Application::getInstance()->getTaggedCache();
         $taggedCache->startTagCache($cachePath);
         $diskSecurityContext = new DiskSecurityContext($userId);
         $storages = Storage::getReadableList($diskSecurityContext, array('filter' => array('STORAGE.ENTITY_TYPE' => ProxyType\Group::className())));
         foreach ($storages as $storage) {
             $currentPossibleUserGroups[$storage->getEntityId()] = $storage;
         }
         unset($storage);
         $query = \CSocNetUserToGroup::getList(array('GROUP_NAME' => 'ASC'), array('USER_ID' => $userId, 'GROUP_ID' => array_keys($currentPossibleUserGroups)), false, false, array('GROUP_ID', 'GROUP_NAME', 'GROUP_ACTIVE', 'GROUP_CLOSED', 'ROLE'));
         while ($row = $query->getNext()) {
             if ($row['GROUP_ACTIVE'] == 'Y' && $row['GROUP_CLOSED'] == 'N' && $row['ROLE'] != SONET_ROLES_BAN && $row['ROLE'] != SONET_ROLES_REQUEST && isset($currentPossibleUserGroups[$row['GROUP_ID']])) {
                 $taggedCache->registerTag("sonet_features_G_{$row['GROUP_ID']}");
                 $taggedCache->registerTag("sonet_group_{$row['GROUP_ID']}");
                 $currentUserGroups[$row['GROUP_ID']] = array('STORAGE' => $currentPossibleUserGroups[$row['GROUP_ID']], 'NAME' => $row['GROUP_NAME']);
             }
         }
         $taggedCache->registerTag("sonet_user2group_U{$userId}");
         $taggedCache->endTagCache();
         $cache->endDataCache(array($currentUserGroups));
     }
     return $currentUserGroups;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:39,代码来源:controller.php

示例2: getUserGroupWithStorage

 protected function getUserGroupWithStorage()
 {
     if (!\CBXFeatures::isFeatureEnabled("Workgroups")) {
         return array();
     }
     if (!Loader::includeModule('socialnetwork')) {
         return array();
     }
     $userId = $this->getUser()->getId();
     $currentPossibleUserGroups = $currentUserGroups = array();
     $diskSecurityContext = new DiskSecurityContext($this->getUser()->getId());
     $storages = Storage::getReadableList($diskSecurityContext, array('filter' => array('STORAGE.ENTITY_TYPE' => ProxyType\Group::className())));
     foreach ($storages as $storage) {
         $currentPossibleUserGroups[$storage->getEntityId()] = $storage;
     }
     unset($storage);
     $query = \CSocNetUserToGroup::getList(array('GROUP_NAME' => 'ASC'), array('USER_ID' => $userId, 'GROUP_ID' => array_keys($currentPossibleUserGroups)), false, false, array('GROUP_ID', 'GROUP_NAME', 'GROUP_ACTIVE', 'GROUP_CLOSED', 'ROLE'));
     while ($row = $query->getNext()) {
         if ($row['GROUP_ACTIVE'] == 'Y' && $row['GROUP_CLOSED'] == 'N' && $row['ROLE'] != SONET_ROLES_BAN && $row['ROLE'] != SONET_ROLES_REQUEST && isset($currentPossibleUserGroups[$row['GROUP_ID']])) {
             $currentUserGroups[$row['GROUP_ID']] = array('STORAGE' => $currentPossibleUserGroups[$row['GROUP_ID']], 'NAME' => $row['GROUP_NAME']);
         }
     }
     return $currentUserGroups;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:24,代码来源:controller.php


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