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


PHP SJB_UserManager::getUserSIDsByUserGroupSID方法代码示例

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


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

示例1: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $user_group_sid = SJB_Request::getVar('sid', null);
     $errors = array();
     if (!is_null($user_group_sid)) {
         $action = SJB_Request::getVar("action", false);
         $product_sid = SJB_Request::getVar("product_sid", false);
         if ($action && $product_sid !== false) {
             switch ($action) {
                 case 'move_up':
                     SJB_ProductsManager::moveUpProductBySID($product_sid, $user_group_sid);
                     break;
                 case 'move_down':
                     SJB_ProductsManager::moveDownProductBySID($product_sid, $user_group_sid);
                     break;
                 case 'set_default_product':
                     SJB_UserGroupManager::setDefaultProduct($user_group_sid, $product_sid);
                     break;
             }
         }
         $user_group_info = SJB_UserGroupManager::getUserGroupInfoBySID($user_group_sid);
         $user_group_info = array_merge($user_group_info, $_REQUEST);
         $userGroup = new SJB_UserGroup($user_group_info);
         $userGroup->setSID($user_group_sid);
         $edit_user_group_form = new SJB_Form($userGroup);
         $form_is_submitted = SJB_Request::getVar('submit');
         if ($form_is_submitted && $edit_user_group_form->isDataValid($errors)) {
             SJB_UserGroupManager::saveUserGroup($userGroup);
             if ($form_is_submitted == 'save_info') {
                 SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/user-groups/');
             }
         }
         $productSIDs = SJB_ProductsManager::getProductsInfoByUserGroupSID($user_group_sid);
         $productsInfo = array();
         $user_sids_in_group = SJB_UserManager::getUserSIDsByUserGroupSID($user_group_sid);
         $user_group_product_user_number = array();
         foreach ($productSIDs as $product) {
             $productsInfo[] = $product;
             $user_sids_in_product = SJB_UserManager::getUserSIDsByProductSID($product['sid']);
             $user_number = count(array_intersect($user_sids_in_group, $user_sids_in_product));
             $user_group_product_user_number[$product['sid']] = $user_number;
         }
         $edit_user_group_form->registerTags($tp);
         $tp->assign('object_sid', $userGroup->getSID());
         $tp->assign('notifications', $userGroup->getNotifications());
         $tp->assign('notificationGroups', $userGroup->getNotificationsGroups());
         $tp->assign('user_group_sid', $user_group_sid);
         $tp->assign('user_group_products_info', $productsInfo);
         $tp->assign('user_group_product_user_number', $user_group_product_user_number);
         $tp->assign('form_fields', $edit_user_group_form->getFormFieldsInfo());
     } else {
         $errors['USER_GROUP_SID_NOT_SET'] = 1;
     }
     $tp->assign('user_group_info', isset($user_group_info) ? $user_group_info : null);
     $tp->assign('errors', $errors);
     $tp->assign('object_sid', $user_group_sid);
     $tp->display('edit_user_group.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:59,代码来源:edit_user_group.php

示例2: execute

 public function execute()
 {
     $access_type = SJB_Request::getVar('access_type');
     $listing_id = SJB_Request::getVar('listing_id');
     $user_group_id = SJB_Request::getVar('user_group_id');
     $employersGroupSID = SJB_UserGroupManager::getUserGroupSIDByID($user_group_id);
     $employersSIDs = SJB_UserManager::getUserSIDsByUserGroupSID($employersGroupSID);
     $employers = array();
     foreach ($employersSIDs as $emp) {
         $currEmp = SJB_UserManager::getUserInfoBySID($emp);
         if (isset($currEmp['CompanyName']) && $currEmp['CompanyName'] != '') {
             $employers[] = array('name' => $currEmp['CompanyName'], 'sid' => $emp);
         }
     }
     sort($employers);
     $tp = SJB_System::getTemplateProcessor();
     $listing_access_list = SJB_ListingManager::getListingAccessList($listing_id, $access_type);
     $tp->assign('listing_access_list', $listing_access_list);
     $tp->assign('employers', $employers);
     $tp->display('employers_list.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:21,代码来源:employers_list.php


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