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


PHP SJB_UserManager::getUserGroupByUserSid方法代码示例

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


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

示例1: createInfoForCustomProduct

 public static function createInfoForCustomProduct($userSid, $productSid, $listingSid, $price, $name, $type)
 {
     $productName = SJB_ProductsManager::getProductNameBySid($productSid);
     $userGroupSid = SJB_UserManager::getUserGroupByUserSid($userSid);
     $productInfo = array('custom_item' => "{$name} ({$productName})", 'custom_info' => array('listing_id' => (int) $listingSid, 'type' => $type, 'extraDescription' => "({$productName})", 'productSid' => (int) $productSid), 'name' => $name, 'number_of_listings' => 1, 'QtyPeriod' => 1, 'price' => $price, 'pricing_type' => 'fixed', 'sid' => -1, 'product_type' => 'post_listings', 'user_group_sid' => $userGroupSid);
     $productInfo['serialized_extra_info'] = serialize($productInfo);
     return $productInfo;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:8,代码来源:ShoppingCart.php

示例2: removeSimilarHighlight

 /**
  * @param array $menu
  * @param $item
  * @param $menuKey
  * @param $itemKey
  */
 private function removeSimilarHighlight(array &$menu, $item, $menuKey, $itemKey)
 {
     if (in_array(SJB_System::getSystemSettings('SITE_URL') . $this->pageID, $item['highlight'])) {
         $highlight = '';
         $highlightPrefix = '/manage-';
         $userSid = SJB_Request::getVar('user_sid', 0);
         switch ($menuKey) {
             case 'Listing Configuration':
                 $fieldSID = SJB_Request::getVar('field_sid', false);
                 if ($fieldSID) {
                     $fieldInfo = SJB_ListingFieldManager::getFieldInfoBySID($fieldSID);
                     //remove unwanted highlights
                     if ($fieldInfo['listing_type_sid'] == 0 && $item['title'] == 'Listing Types' || $fieldInfo['listing_type_sid'] != 0 && $item['title'] == 'Common Fields') {
                         $highlight = $this->pageID;
                     }
                 }
                 break;
             case 'Listing Management':
                 if (preg_match('/manage-resume|job|[a-zA-Z0-9]+-listings/', $item['reference']) && !preg_match('/import|export|flagged-listings/', $item['reference'])) {
                     if (!($listingTypeId = SJB_Request::getVar('listing_type_id', null))) {
                         $listingId = SJB_Request::getVar('listing_id', null);
                         $listingInfo = SJB_ListingManager::getListingInfoBySID($listingId);
                         $listingTypeId = SJB_ListingTypeManager::getListingTypeIDBySID($listingInfo['listing_type_sid']);
                     }
                     $highlight = strtolower($listingTypeId);
                 }
                 break;
             case 'Users':
                 $highlightPrefix = '/manage-users/';
                 if ($userSid) {
                     $userGroupSid = SJB_UserManager::getUserGroupByUserSid($userSid);
                     $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($userGroupSid);
                     if (preg_match($highlightPrefix, $item['reference'])) {
                         $highlight = strtolower($userGroupInfo['id']);
                     }
                 } else {
                     if ($role = SJB_Request::getVar('role', null)) {
                         $type = SJB_Request::getVar('type', null);
                         // for user permissions
                         if ($type == 'user') {
                             $role = SJB_UserManager::getUserGroupByUserSid($role);
                             $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($role);
                             $highlight = strtolower($userGroupInfo['id']);
                         } else {
                             if (in_array($type, array('group', 'guest'))) {
                                 $highlightPrefix = 'user-';
                                 $highlight = 'group';
                             }
                         }
                     } else {
                         //retrieve user group from uri
                         if (preg_match('|./(\\w*)/?|u', urldecode(SJB_Navigator::getURI()), $userGroupHub)) {
                             $highlight = array_pop($userGroupHub);
                         }
                         //remove unwanted highlights
                         if ($this->pageID == '/email-log/') {
                             $highlight = $this->pageID;
                         }
                     }
                 }
                 break;
             case 'System Configuration':
                 //remove unwanted highlights
                 if ($this->pageID == '/email-log/' && $userSid) {
                     $highlight = $this->pageID;
                 }
                 break;
             default:
         }
         if (!$highlight || strpos($item['reference'], $highlightPrefix . $highlight) !== false) {
             if (!isset($this->handledHighlightGroups[$highlightPrefix])) {
                 $this->handledHighlightGroups[$highlightPrefix] = true;
                 $handledHighlightGroups[$highlightPrefix] = true;
                 $menu[$menuKey][$itemKey]['active'] = true;
                 $menu[$menuKey]['active'] = true;
             }
         }
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:85,代码来源:menu_block.php


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