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


PHP BOL_UserService::getInstance方法代码示例

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


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

示例1: getList

 public function getList($params)
 {
     $service = SKADATEIOS_ABOL_Service::getInstance();
     $auth = array('photo.view' => $service->getAuthorizationActionStatus('photo', 'view'), 'base.search_users' => $service->getAuthorizationActionStatus('base', 'search_users'));
     $this->assign('auth', $auth);
     if ($auth["base.search_users"]["status"] != BOL_AuthorizationService::STATUS_AVAILABLE) {
         $this->assign("list", array());
         $this->assign("total", 0);
         return;
     }
     $_criteriaList = array_filter($params["criteriaList"]);
     $userId = OW::getUser()->getId();
     $userInfo = BOL_QuestionService::getInstance()->getQuestionData(array($userId), array("sex"));
     $_criteriaList["sex"] = !empty($userInfo[$userId]["sex"]) ? $userInfo[$userId]["sex"] : null;
     $questionList = BOL_QuestionService::getInstance()->findQuestionByNameList(array_keys($_criteriaList));
     $criteriaList = array();
     foreach ($_criteriaList as $questionName => $questionValue) {
         if (empty($questionList[$questionName])) {
             continue;
         }
         $criteriaList[$questionName] = $this->convertQuestionValue($questionList[$questionName]->presentation, $questionValue);
     }
     $idList = OW::getEventManager()->call("usearch.get_user_id_list", array("criterias" => $criteriaList, "limit" => array($params["first"], $params["count"])));
     $idList = empty($idList) ? array() : $idList;
     //$idList = BOL_UserService::getInstance()->findUserIdListByQuestionValues($criteriaList, $params["first"], $params["count"]);
     $total = BOL_UserService::getInstance()->countUsersByQuestionValues($params["criteriaList"]);
     $userData = BOL_AvatarService::getInstance()->getDataForUserAvatars($idList, false, false, true, true);
     $questionsData = BOL_QuestionService::getInstance()->getQuestionData($idList, array("googlemap_location", "birthdate"));
     foreach ($questionsData as $userId => $data) {
         $date = UTIL_DateTime::parseDate($data['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
         $userData[$userId]["ages"] = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
         $userData[$userId]["location"] = empty($data["googlemap_location"]["address"]) ? null : $data["googlemap_location"]["address"];
     }
     $photoList = array();
     $avatarList = array();
     foreach ($idList as $userId) {
         $bigAvatar = SKADATE_BOL_Service::getInstance()->findAvatarByUserId($userId);
         $avatarList[$userId] = $bigAvatar ? SKADATE_BOL_Service::getInstance()->getAvatarUrl($userId, $bigAvatar->hash) : BOL_AvatarService::getInstance()->getAvatarUrl($userId, 2);
         $event = new OW_Event('photo.getMainAlbum', array('userId' => $userId));
         OW::getEventManager()->trigger($event);
         $album = $event->getData();
         $photos = !empty($album['photoList']) ? $album['photoList'] : array();
         foreach ($photos as $photo) {
             $photoList[$userId][] = array("src" => $photo["url"]["main"]);
         }
     }
     $bookmarksList = OW::getEventManager()->call("bookmarks.get_mark_list", array("userId" => OW::getUser()->getId(), "idList" => $idList));
     $bookmarksList = empty($bookmarksList) ? array() : $bookmarksList;
     $list = array();
     foreach ($idList as $userId) {
         $list[] = array("userId" => $userId, "photos" => empty($photoList[$userId]) ? array() : $photoList[$userId], "avatar" => $avatarList[$userId], "name" => empty($userData[$userId]["title"]) ? "" : $userData[$userId]["title"], "label" => $userData[$userId]["label"], "labelColor" => $userData[$userId]["labelColor"], "location" => empty($userData[$userId]["location"]) ? "" : $userData[$userId]["location"], "ages" => $userData[$userId]["ages"], "bookmarked" => !empty($bookmarksList[$userId]));
     }
     $this->assign("list", $list);
     $this->assign("total", $total);
     $allowSendMessage = OW::getPluginManager()->isPluginActive('mailbox');
     $this->assign("actions", array("bookmark" => OW::getPluginManager()->isPluginActive('bookmarks'), "message" => $allowSendMessage, "wink" => OW::getPluginManager()->isPluginActive('winks')));
     BOL_AuthorizationService::getInstance()->trackAction("base", "search_users");
     $mailboxModes = OW::getEventManager()->call('mailbox.get_active_mode_list');
     $this->assign("mailboxModes", empty($mailboxModes) ? array() : $mailboxModes);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:60,代码来源:search.php

示例2: __construct

 /**
  * @return Constructor.
  */
 public function __construct($groupId)
 {
     parent::__construct();
     $service = GROUPS_BOL_Service::getInstance();
     $groupDto = $service->findGroupById($groupId);
     $group = array('title' => htmlspecialchars($groupDto->title), 'description' => $groupDto->description, 'time' => $groupDto->timeStamp, 'imgUrl' => empty($groupDto->imageHash) ? false : $service->getGroupImageUrl($groupDto), 'url' => OW::getRouter()->urlForRoute('groups-view', array('groupId' => $groupDto->id)), "id" => $groupDto->id);
     $imageUrl = empty($groupDto->imageHash) ? '' : $service->getGroupImageUrl($groupDto);
     OW::getDocument()->addMetaInfo('image', $imageUrl, 'itemprop');
     OW::getDocument()->addMetaInfo('og:image', $imageUrl, 'property');
     $createDate = UTIL_DateTime::formatDate($groupDto->timeStamp);
     $adminName = BOL_UserService::getInstance()->getDisplayName($groupDto->userId);
     $adminUrl = BOL_UserService::getInstance()->getUserUrl($groupDto->userId);
     $js = UTIL_JsGenerator::newInstance()->jQueryEvent('#groups_toolbar_flag', 'click', UTIL_JsGenerator::composeJsString('OW.flagContent({$entity}, {$id}, {$title}, {$href}, "groups+flags", {$ownerId});', array('entity' => GROUPS_BOL_Service::WIDGET_PANEL_NAME, 'id' => $groupDto->id, 'title' => $group['title'], 'href' => $group['url'], 'ownerId' => $groupDto->userId)));
     OW::getDocument()->addOnloadScript($js, 1001);
     $toolbar = array(array('label' => OW::getLanguage()->text('groups', 'widget_brief_info_create_date', array('date' => $createDate))), array('label' => OW::getLanguage()->text('groups', 'widget_brief_info_admin', array('name' => $adminName, 'url' => $adminUrl))));
     if ($service->isCurrentUserCanEdit($groupDto)) {
         $toolbar[] = array('label' => OW::getLanguage()->text('groups', 'edit_btn_label'), 'href' => OW::getRouter()->urlForRoute('groups-edit', array('groupId' => $groupId)));
     }
     if (OW::getUser()->isAuthenticated() && OW::getUser()->getId() != $groupDto->userId) {
         $toolbar[] = array('label' => OW::getLanguage()->text('base', 'flag'), 'href' => 'javascript://', 'id' => 'groups_toolbar_flag');
     }
     $event = new BASE_CLASS_EventCollector('groups.on_toolbar_collect', array('groupId' => $groupId));
     OW::getEventManager()->trigger($event);
     foreach ($event->getData() as $item) {
         $toolbar[] = $item;
     }
     $this->assign('toolbar', $toolbar);
     $this->assign('group', $group);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:32,代码来源:brief_info_content.php

示例3: crop

 /**
  * Action cropping avatar
  */
 public function crop()
 {
     $language = OW::getLanguage();
     $avatarService = BOL_AvatarService::getInstance();
     $userService = BOL_UserService::getInstance();
     $userId = OW_Auth::getInstance()->getUserId();
     $hasAvatar = $avatarService->userHasAvatar($userId);
     $this->assign('hasAvatar', $hasAvatar);
     if ($hasAvatar) {
         $this->assign('avatar', $avatarService->getAvatarUrl($userId, 2));
         $this->assign('original', $avatarService->getAvatarUrl($userId, 3));
     } else {
         $this->assign('default', $avatarService->getDefaultAvatarUrl(2));
     }
     $staticJsUrl = OW::getPluginManager()->getPlugin('base')->getStaticJsUrl();
     $staticCssUrl = OW::getPluginManager()->getPlugin('base')->getStaticCssUrl();
     OW::getDocument()->addScript($staticJsUrl . 'jquery.Jcrop.js');
     OW::getDocument()->addStyleSheet($staticCssUrl . 'jquery.Jcrop.css');
     OW::getDocument()->addScript($staticJsUrl . 'crop_avatar.js');
     $objParams = array('ajaxResponder' => $this->ajaxResponder, 'previewSize' => 100);
     $script = "\$(document).ready(function(){\n                var crop = new cropAvatar( " . json_encode($objParams) . ");\n                crop.initCrop();\n            }); ";
     OW::getDocument()->addOnloadScript($script);
     $profileEditUrl = OW::getRouter()->urlForRoute('base_edit');
     $js = new UTIL_JsGenerator();
     $js->newVariable('profileEditUrl', $profileEditUrl);
     $js->jQueryEvent('#button-profile-edit', 'click', 'window.location.href=profileEditUrl;');
     OW::getDocument()->addOnloadScript($js);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:31,代码来源:avatar.php

示例4: index

 public function index($params = array())
 {
     $userService = BOL_UserService::getInstance();
     $language = OW::getLanguage();
     $this->setPageHeading($language->text('hotlist', 'admin_heading_settings'));
     $this->setPageHeadingIconClass('ow_ic_gear_wheel');
     $settingsForm = new Form('settingsForm');
     $settingsForm->setId('settingsForm');
     $expiration_time = new TextField('expiration_time');
     $expiration_time->setRequired();
     $expiration_time->setLabel($language->text('hotlist', 'label_expiration_time'));
     $expiration_time_value = (int) OW::getConfig()->getValue('hotlist', 'expiration_time') / 86400;
     $expiration_time->setValue($expiration_time_value);
     $settingsForm->addElement($expiration_time);
     $submit = new Submit('save');
     $submit->addAttribute('class', 'ow_ic_save');
     $submit->setValue($language->text('hotlist', 'label_save_btn_label'));
     $settingsForm->addElement($submit);
     $this->addForm($settingsForm);
     if (OW::getRequest()->isPost()) {
         if ($settingsForm->isValid($_POST)) {
             $data = $settingsForm->getValues();
             OW::getConfig()->saveConfig('hotlist', 'expiration_time', $data['expiration_time'] * 86400);
             OW::getFeedback()->info($language->text('hotlist', 'settings_saved'));
             $this->redirect();
         }
     }
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:28,代码来源:admin.php

示例5: onUserRegister

 /**
  * find provider by id
  *
  * @param $userId
  * @return 
  */
 public function onUserRegister($userId = 0)
 {
     if (!$userId) {
         return null;
     }
     if (isset($_COOKIE['yncontactimporter_userId'])) {
         $refId = $_COOKIE['yncontactimporter_userId'];
         unset($_COOKIE['yncontactimporter_userId']);
         // check email and update isued
         $user = BOL_UserService::getInstance()->findUserById($userId);
         $email = $user->getEmail();
         if ($invitation = YNCONTACTIMPORTER_BOL_InvitationService::getInstance()->checkInvitedUser($email)) {
             $invitation->isUsed = 1;
             YNCONTACTIMPORTER_BOL_InvitationService::getInstance()->save($invitation);
         }
         // save joined
         $joined = new YNCONTACTIMPORTER_BOL_Joined();
         $joined->userId = $userId;
         $joined->inviterId = $refId;
         $this->joinedDao->save($joined);
         //invite friend
         $event = new OW_Event('friends.add_friend', array('requesterId' => $refId, 'userId' => $userId));
         OW::getEventManager()->trigger($event);
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:31,代码来源:joined_service.php

示例6: index

 /**
  * Finance list page controller
  *
  * @param array $params
  */
 public function index(array $params)
 {
     $service = BOL_BillingService::getInstance();
     $lang = OW::getLanguage();
     $page = isset($_GET['page']) ? $_GET['page'] : 1;
     $onPage = 20;
     $list = $service->getFinanceList($page, $onPage);
     $userIdList = array();
     foreach ($list as $sale) {
         if (isset($sale['userId']) && !in_array($sale['userId'], $userIdList)) {
             array_push($userIdList, $sale['userId']);
         }
     }
     $displayNames = BOL_UserService::getInstance()->getDisplayNamesForList($userIdList);
     $userNames = BOL_UserService::getInstance()->getUserNamesForList($userIdList);
     $this->assign('list', $list);
     $this->assign('displayNames', $displayNames);
     $this->assign('userNames', $userNames);
     $total = $service->countSales();
     // Paging
     $pages = (int) ceil($total / $onPage);
     $paging = new BASE_CMP_Paging($page, $pages, 10);
     $this->assign('paging', $paging->render());
     $this->assign('total', $total);
     $stats = $service->getTotalIncome();
     $this->assign('stats', $stats);
     OW::getDocument()->setHeading($lang->text('admin', 'page_title_finance'));
     OW::getDocument()->setHeadingIconClass('ow_ic_app');
 }
开发者ID:vazahat,项目名称:dudex,代码行数:34,代码来源:finance.php

示例7: __construct

 /**
  * @return Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $paramObj)
 {
     parent::__construct($paramObj);
     $userId = $paramObj->additionalParamList['entityId'];
     // privacy check
     $viewerId = OW::getUser()->getId();
     $ownerMode = $userId == $viewerId;
     $modPermissions = OW::getUser()->isAuthorized('newsfeed');
     if (!$ownerMode && !$modPermissions) {
         $privacyParams = array('action' => NEWSFEED_BOL_Service::PRIVACY_ACTION_VIEW_MY_FEED, 'ownerId' => $userId, 'viewerId' => $viewerId);
         $event = new OW_Event('privacy_check_permission', $privacyParams);
         try {
             OW::getEventManager()->trigger($event);
         } catch (RedirectException $e) {
             $this->setVisible(false);
             return;
         }
     }
     $feed = $this->createFeed('user', $userId);
     $isBloacked = BOL_UserService::getInstance()->isBlocked(OW::getUser()->getId(), $userId);
     if (OW::getUser()->isAuthenticated() && OW::getUser()->isAuthorized('base', 'add_comment')) {
         if ($isBloacked) {
             $feed->addStatusMessage(OW::getLanguage()->text("base", "user_block_message"));
         } else {
             $visibility = NEWSFEED_BOL_Service::VISIBILITY_FULL;
             $feed->addStatusForm('user', $userId, $visibility);
         }
     }
     $feed->setDisplayType(NEWSFEED_CMP_Feed::DISPLAY_TYPE_ACTIVITY);
     $this->setFeed($feed);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:34,代码来源:user_feed_widget.php

示例8: __construct

 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     /*if ( !GROUPS_BOL_Service::getInstance()->isCurrentUserCanViewList() )
             {
                 $this->setVisible(false);
     
                 return;
             }*/
     $userId = $params->additionalParamList['entityId'];
     $count = empty($params->customParamList['count']) ? 3 : (int) $params->customParamList['count'];
     // privacy check
     $viewerId = OW::getUser()->getId();
     $ownerMode = $userId == $viewerId;
     $modPermissions = OW::getUser()->isAuthorized('groups');
     if (!$ownerMode && !$modPermissions) {
         $privacyParams = array('action' => GROUPS_BOL_Service::PRIVACY_ACTION_VIEW_MY_GROUPS, 'ownerId' => $userId, 'viewerId' => $viewerId);
         $event = new OW_Event('privacy_check_permission', $privacyParams);
         try {
             OW::getEventManager()->trigger($event);
         } catch (RedirectException $e) {
             $this->setVisible(false);
             return;
         }
     }
     $userName = BOL_UserService::getInstance()->findUserById($userId)->getUsername();
     if (!$this->assignList($userId, $count)) {
         $this->setVisible($params->customizeMode);
         return;
     }
     $this->setSettingValue(self::SETTING_TOOLBAR, array(array('label' => OW::getLanguage()->text('groups', 'widget_user_groups_view_all'), 'href' => OW::getRouter()->urlForRoute('groups-user-groups', array('user' => $userName)))));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:32,代码来源:user_groups_widget.php

示例9: getList

 public function getList()
 {
     $users = null;
     $count = null;
     if ($this->friendsMode) {
         $count = OW::getEventManager()->call('plugin.friends.count_friends', array('userId' => $this->userId));
         $users = OW::getEventManager()->call('plugin.friends.get_friend_list', array('userId' => $this->userId, 'count' => 500));
     }
     $hideUsers = array();
     if (!empty($this->entityId)) {
         $sentNotifications = EQUESTIONS_BOL_NotificationService::getInstance()->findSentNotificationList($this->entityId, $this->userId, 'ask');
         foreach ($sentNotifications as $notification) {
             $hideUsers[] = $notification->userId;
         }
     }
     if ($count === null) {
         $count = BOL_UserService::getInstance()->count();
     }
     if ($users === null) {
         $users = array();
         $userDtos = BOL_UserService::getInstance()->findRecentlyActiveList(0, 500);
         foreach ($userDtos as $u) {
             if ($u->id != $this->userId) {
                 $users[] = $u->id;
             }
         }
     }
     $out = array();
     foreach ($users as $user) {
         if (!in_array($user, $hideUsers)) {
             $out[] = $user;
         }
     }
     return array('count' => $count - 1, 'idList' => $out);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:35,代码来源:user_selector.php

示例10: index

 /**
  * Controller's default action
  *
  * @param array $params
  */
 public function index(array $params)
 {
     if (!isset($params['sectionId']) || !($sectionId = (int) $params['sectionId'])) {
         throw new Redirect404Exception();
     }
     $forumSection = $this->forumService->findSectionById($sectionId);
     if (!$forumSection || $forumSection->isHidden) {
         throw new Redirect404Exception();
     }
     $userId = OW::getUser()->getId();
     $bcItems = array(array('href' => OW::getRouter()->urlForRoute('forum-default'), 'label' => OW::getLanguage()->text('forum', 'forum_index')), array('label' => $forumSection->name));
     $breadCrumbCmp = new BASE_CMP_Breadcrumb($bcItems);
     $this->addComponent('breadcrumb', $breadCrumbCmp);
     $sectionGroupList = $this->forumService->getSectionGroupList($userId, $sectionId);
     $authors = array();
     foreach ($sectionGroupList as $section) {
         foreach ($section['groups'] as $group) {
             if (!$group['lastReply']) {
                 continue;
             }
             $id = $group['lastReply']['userId'];
             if (!in_array($id, $authors)) {
                 array_push($authors, $id);
             }
         }
     }
     $this->assign('sectionGroupList', $sectionGroupList);
     $userNames = BOL_UserService::getInstance()->getUserNamesForList($authors);
     $this->assign('userNames', $userNames);
     $displayNames = BOL_UserService::getInstance()->getDisplayNamesForList($authors);
     $this->assign('displayNames', $displayNames);
     $this->addComponent('search', new FORUM_CMP_ForumSearch(array('scope' => 'section', 'sectionId' => $sectionId)));
     OW::getDocument()->setHeading(OW::getLanguage()->text('forum', 'forum'));
     OW::getDocument()->setHeadingIconClass('ow_ic_forum');
 }
开发者ID:vazahat,项目名称:dudex,代码行数:40,代码来源:section.php

示例11: ajaxRsp

 public function ajaxRsp()
 {
     if (!OW::getRequest()->isAjax()) {
         throw new Redirect403Exception();
     }
     $response = array();
     if (empty($_GET['userId']) || empty($_GET['command'])) {
         echo json_encode($response);
         exit;
     }
     $userId = (int) $_GET['userId'];
     $command = $_GET['command'];
     switch ($command) {
         case "suspend":
             BOL_UserService::getInstance()->suspend($userId);
             $response["info"] = OW::getLanguage()->text('base', 'user_feedback_profile_suspended');
             break;
         case "unsuspend":
             BOL_UserService::getInstance()->unsuspend($userId);
             $response["info"] = OW::getLanguage()->text('base', 'user_feedback_profile_unsuspended');
             break;
     }
     echo json_encode($response);
     exit;
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:25,代码来源:suspended_user.php

示例12: __construct

 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     //        $service = PostService::getInstance();
     //        $count = $params->customParamList['count'];
     //        $previewLength = $params->customParamList['previewLength'];
     //        $list = $service->findList(0, $count);
     /*
             if ( empty($list) && !OW::getUser()->isAuthorized('shoppro', 'add') && !$params->customizeMode )
             {
                 $this->setVisible(false);
     
                 return;
             }
     */
     $this->userId = OW::getUser()->getId();
     //citent login user (uwner)
     $this->feed_working_Id = $params->additionalParamList['entityId'];
     //set wotching user id
     $posts = array();
     $userService = BOL_UserService::getInstance();
     $postIdList = array();
     $commentInfo = array();
     $this->assign('commentInfo', $commentInfo);
     $this->assign('list', $posts);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:26,代码来源:menu_widget.php

示例13: __construct

 public function __construct($users, $size, $layout)
 {
     parent::__construct();
     $questionService = BOL_QuestionService::getInstance();
     $userService = BOL_UserService::getInstance();
     $this->uniqId = uniqid('ucl_');
     $idList = $this->fetchIdList($users);
     $qList = $questionService->getQuestionData($idList, array('sex', 'birthdate'));
     $displayNames = $userService->getDisplayNamesForList($idList);
     $urls = $userService->getUserUrlsForList($idList);
     $tplData = array();
     foreach ($idList as $userId) {
         $tplData[$userId] = array();
         $tplData[$userId]['displayName'] = empty($displayNames[$userId]) ? null : $displayNames[$userId];
         $tplData[$userId]['url'] = empty($urls[$userId]) ? null : $urls[$userId];
         $tplData[$userId]['sex'] = empty($qList[$userId]['sex']) || in_array($layout, array(3, 4)) ? null : strtolower(BOL_QuestionService::getInstance()->getQuestionValueLang('sex', $qList[$userId]['sex']));
         $tplData[$userId]['birthdate'] = null;
         if (!empty($qList[$userId]['birthdate']) && in_array($layout, array(1, 3))) {
             $date = UTIL_DateTime::parseDate($qList[$userId]['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
             $age = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
             $tplData[$userId]['birthdate'] = $age;
         }
         $avatar = BOL_AvatarService::getInstance()->getAvatarUrl($userId, 2);
         $tplData[$userId]['thumb'] = $avatar ? $avatar : BOL_AvatarService::getInstance()->getDefaultAvatarUrl(2);
     }
     $sizes = array('small' => 100, 'medium' => 150, 'big' => OW::getConfig()->getValue('base', 'avatar_big_size'));
     $this->assign('list', $tplData);
     $avatarSize = $sizes[$size];
     $this->assign('size', $size);
     $this->assign('uniqId', $this->uniqId);
     OW::getDocument()->addStyleDeclaration('.uc-avatar-size { width: ' . $avatarSize . 'px; height: ' . ($avatarSize + $avatarSize / 10) . 'px; }');
     OW::getDocument()->addStyleDeclaration('.uc-carousel-size { height: ' . ($avatarSize + 50) . 'px; }');
     OW::getDocument()->addStyleDeclaration('.uc-shape-waterWheel .uc-carousel { width: ' . ($avatarSize + 20) . 'px; }');
 }
开发者ID:vazahat,项目名称:dudex,代码行数:34,代码来源:users.php

示例14: __construct

 public function __construct($conversationData)
 {
     parent::__construct();
     $this->consoleItem = new BASE_CMP_ConsoleListItem();
     $this->convId = $conversationData['conversationId'];
     $userId = OW::getUser()->getId();
     $conversationService = MAILBOX_BOL_ConversationService::getInstance();
     $this->opponentId = $conversationData['opponentId'];
     $avatarUrl = BOL_AvatarService::getInstance()->getAvatarUrl($this->opponentId);
     $this->avatarUrl = $avatarUrl ? $avatarUrl : BOL_AvatarService::getInstance()->getDefaultAvatarUrl();
     $this->profileUrl = BOL_UserService::getInstance()->getUserUrl($this->opponentId);
     $this->displayName = BOL_UserService::getInstance()->getDisplayName($this->opponentId);
     $this->mode = $conversationData['mode'];
     $this->text = $conversationData['previewText'];
     $this->dateLabel = $conversationData['dateLabel'];
     $this->unreadMessageCount = $conversationService->countUnreadMessagesForConversation($this->convId, $userId);
     if ($this->mode == 'mail') {
         $this->url = $conversationService->getConversationUrl($this->convId);
         $this->addClass('ow_mailbox_request_item ow_cursor_default');
     }
     if ($this->mode == 'chat') {
         $this->url = 'javascript://';
         $this->addClass('ow_chat_request_item ow_cursor_default');
         $js = "\$('.consoleChatItem#mailboxConsoleMessageItem{$this->convId}').bind('click', function(){\n        var convId = \$(this).data('convid');\n        var opponentId = \$(this).data('opponentid');\n        OW.trigger('mailbox.open_dialog', {convId: convId, opponentId: opponentId, mode: 'chat', isSelected: true});\n        OW.Console.getItem('mailbox').hideContent();\n    });";
         OW::getDocument()->addOnloadScript($js);
     }
     if ($conversationData['conversationRead'] == 0) {
         $this->addClass('ow_console_new_message');
     }
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:30,代码来源:console_message_item.php

示例15: onConsolePagesCollect

 public function onConsolePagesCollect(BASE_CLASS_EventCollector $event)
 {
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'underscore-min.js', 'text/javascript', 3000);
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'backbone-min.js', 'text/javascript', 3000);
     //        OW::getDocument()->addScript( OW::getPluginManager()->getPlugin('base')->getStaticJsUrl().'backbone.js', 'text/javascript', 3000 );
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('mailbox')->getStaticJsUrl() . 'mobile_mailbox.js', 'text/javascript', 3000);
     $userListUrl = OW::getRouter()->urlForRoute('mailbox_user_list');
     $convListUrl = OW::getRouter()->urlForRoute('mailbox_conv_list');
     $authorizationResponderUrl = OW::getRouter()->urlFor('MAILBOX_CTRL_Ajax', 'authorization');
     $pingResponderUrl = OW::getRouter()->urlFor('MAILBOX_CTRL_Ajax', 'ping');
     $getHistoryResponderUrl = OW::getRouter()->urlFor('MAILBOX_CTRL_Ajax', 'getHistory');
     $userId = OW::getUser()->getId();
     $displayName = BOL_UserService::getInstance()->getDisplayName($userId);
     $avatarUrl = BOL_AvatarService::getInstance()->getAvatarUrl($userId);
     if (empty($avatarUrl)) {
         $avatarUrl = BOL_AvatarService::getInstance()->getDefaultAvatarUrl();
     }
     $profileUrl = BOL_UserService::getInstance()->getUserUrl($userId);
     $lastSentMessage = MAILBOX_BOL_ConversationService::getInstance()->getLastSentMessage($userId);
     $lastMessageTimestamp = (int) ($lastSentMessage ? $lastSentMessage->timeStamp : 0);
     $params = array('getHistoryResponderUrl' => $getHistoryResponderUrl, 'pingResponderUrl' => $pingResponderUrl, 'authorizationResponderUrl' => $authorizationResponderUrl, 'userListUrl' => $userListUrl, 'convListUrl' => $convListUrl, 'pingInterval' => 5000, 'lastMessageTimestamp' => $lastMessageTimestamp, 'user' => array('userId' => $userId, 'displayName' => $displayName, 'profileUrl' => $profileUrl, 'avatarUrl' => $avatarUrl));
     $js = UTIL_JsGenerator::composeJsString('OWM.Mailbox = new MAILBOX_Mobile({$params});', array('params' => $params));
     OW::getDocument()->addOnloadScript($js, 'text/javascript', 3000);
     $event->add(array('key' => 'convers', 'cmpClass' => 'MAILBOX_MCMP_ConsoleConversationsPage', 'order' => 2));
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:25,代码来源:event_handler.php


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