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


PHP BOL_AvatarService::getInstance方法代码示例

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


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

示例1: __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

示例2: __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

示例3: 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

示例4: 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

示例5: uploadTmpAvatar

 public function uploadTmpAvatar($file)
 {
     if (isset($file)) {
         $lang = OW::getLanguage();
         if (!UTIL_File::validateImage($file['name'])) {
             return array('result' => false, 'error' => $lang->text('base', 'not_valid_image'));
         }
         if (!empty($file['error'])) {
             $message = BOL_FileService::getInstance()->getUploadErrorMessage($file['error']);
         }
         if (!empty($message)) {
             return array('result' => false, 'error' => $message);
         }
         $filesize = OW::getConfig()->getValue('base', 'avatar_max_upload_size');
         if (empty($file['size']) || $filesize * 1024 * 1024 < $file['size']) {
             $message = OW::getLanguage()->text('base', 'upload_file_max_upload_filesize_error');
             return array('result' => false, 'error' => $message);
         }
         $avatarService = BOL_AvatarService::getInstance();
         $key = $avatarService->getAvatarChangeSessionKey();
         $uploaded = $avatarService->uploadUserTempAvatar($key, $file['tmp_name']);
         if (!$uploaded) {
             return array('result' => false, 'error' => $lang->text('base', 'upload_avatar_faild'));
         }
         $url = $avatarService->getTempAvatarUrl($key, 3);
         return array('result' => true, 'url' => $url);
     }
     return array('result' => false);
 }
开发者ID:ZyXelP,项目名称:oxwall,代码行数:29,代码来源:upload_tmp_avatar_trait.php

示例6: getList

 public function getList($params)
 {
     $data = OW::getEventManager()->call("guests.get_guests_list", array("userId" => OW::getUser()->getId()));
     if (empty($data)) {
         $this->assign("list", array());
         return;
     }
     $idList = array();
     $viewedMap = array();
     $timeMap = array();
     foreach ($data as $item) {
         $idList[] = $item["userId"];
         $viewedMap[$item["userId"]] = $item["viewed"];
         $timeMap[$item["userId"]] = UTIL_DateTime::formatDate($item["timeStamp"]);
     }
     OW::getEventManager()->call("guests.mark_guests_viewed", array("userId" => OW::getUser()->getId(), "guestIds" => $idList));
     $bookmarkList = OW::getEventManager()->call("bookmarks.get_mark_list", array("userId" => OW::getUser()->getId(), "idList" => $idList));
     $bookmarkList = empty($bookmarkList) ? array() : $bookmarkList;
     $avatarList = BOL_AvatarService::getInstance()->getDataForUserAvatars($idList, true, false);
     $onlineMap = BOL_UserService::getInstance()->findOnlineStatusForUserList($idList);
     foreach ($avatarList as $userId => $user) {
         $color = array('r' => '100', 'g' => '100', 'b' => '100');
         if (!empty($user['labelColor'])) {
             $_color = explode(', ', trim($user['labelColor'], 'rgba()'));
             $color = array('r' => $_color[0], 'g' => $_color[1], 'b' => $_color[2]);
         }
         $list[] = array("userId" => $userId, "displayName" => $user["title"], "avatarUrl" => $user["src"], "label" => $user["label"], "labelColor" => $color, "viewed" => $viewedMap[$userId], "online" => $onlineMap[$userId], "bookmarked" => !empty($bookmarkList[$userId]), "time" => $timeMap[$userId]);
     }
     $this->assign("list", $list);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:30,代码来源:guests.php

示例7: buildData

 protected function buildData($userIds, $group = null, $ignoreUserIds = array())
 {
     if (empty($userIds)) {
         return array();
     }
     $avatarData = BOL_AvatarService::getInstance()->getDataForUserAvatars($userIds, true, true, true, false);
     $infoList = $this->getInfoList($userIds);
     $onlineList = BOL_UserService::getInstance()->findOnlineStatusForUserList($userIds);
     $out = array();
     foreach ($userIds as $userId) {
         if (in_array($userId, $ignoreUserIds)) {
             continue;
         }
         $data = array();
         $data['id'] = $userId;
         $data['url'] = $avatarData[$userId]['url'];
         $data['avatar'] = $avatarData[$userId]['src'];
         $data['text'] = $avatarData[$userId]['title'];
         $data['info'] = '<span class="ow_live_on"></span>' . implode(' ', $infoList[$userId]);
         $data['online'] = $onlineList[$userId];
         $itemCmp = new MCOMPOSE_CMP_UserItem($data);
         $item = array();
         $item["id"] = self::ID_PREFIX . "_" . $userId;
         $item["text"] = $data['text'];
         $item['html'] = $itemCmp->render();
         $item['url'] = $data['url'];
         $item['count'] = null;
         if (!empty($group)) {
             $item['group'] = $group;
         }
         $out[self::ID_PREFIX . '_' . $userId] = $item;
     }
     return $out;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:34,代码来源:abstract_user_bridge.php

示例8: __construct

 /**
  * @return Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $paramObj)
 {
     parent::__construct();
     //echo "call";
     $avatarService = BOL_AvatarService::getInstance();
     $userId = OW::getUser()->getId();
     $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($userId), true, true, true, true, 2);
     // $avatars = BOL_AvatarService::getInstance()->getAvatarsUrlList(array($userId), 2);
     //        echo '<pre>';
     //        print_r($avatars);
     //        echo '</pre>';
     $this->assign('avatar', $avatars[$userId]);
     $event = new BASE_CLASS_EventCollector('base.on_avatar_toolbar_collect', array('userId' => $userId));
     OW::getEventManager()->trigger($event);
     $toolbarItems = $event->getData();
     //        echo '<pre>';
     //        print_r($toolbarItems);
     //        echo '</pre>';
     $tplToolbarItems = array();
     foreach ($toolbarItems as $item) {
         if (empty($item['title']) || empty($item['url']) || empty($item['iconClass'])) {
             continue;
         }
         $order = empty($item['order']) ? count($tplToolbarItems) + 1 : (int) $item['order'];
         if (!empty($tplToolbarItems[$order])) {
             $order = count($tplToolbarItems) + 1;
         }
         $tplToolbarItems[$order] = $item;
     }
     ksort($tplToolbarItems);
     $this->assign('toolbarItems', array_values($tplToolbarItems));
 }
开发者ID:hardikamutech,项目名称:hammu,代码行数:35,代码来源:my_avatar_widget.php

示例9: __construct

 public function __construct($userId)
 {
     parent::__construct();
     $cover = UHEADER_BOL_Service::getInstance()->findCoverByUserId($userId);
     if (empty($cover)) {
         $this->assign('error', OW::getLanguage()->text('uheader', 'cover_not_found'));
         return;
     }
     $src = UHEADER_BOL_Service::getInstance()->getCoverUrl($cover);
     $settings = $cover->getSettings();
     $height = $settings['dimensions']['height'];
     $width = $settings['dimensions']['width'];
     $top = 0;
     if ($height < self::MIN_HEIGHT) {
         $top = (self::MIN_HEIGHT - $height) / 2;
     }
     $avatarsData = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($userId));
     $this->assign('user', $avatarsData[$userId]);
     $this->assign('src', $src);
     $this->assign('top', $top);
     $this->assign('dimensions', $settings['dimensions']);
     $cmtParams = new BASE_CommentsParams('uheader', UHEADER_CLASS_CommentsBridge::ENTITY_TYPE);
     $cmtParams->setWrapInBox(false);
     $cmtParams->setEntityId($cover->id);
     $cmtParams->setOwnerId($userId);
     $cmtParams->setDisplayType(BASE_CommentsParams::DISPLAY_TYPE_TOP_FORM_WITH_PAGING);
     $photoCmts = new BASE_CMP_Comments($cmtParams);
     $this->addComponent('comments', $photoCmts);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:29,代码来源:cover_view.php

示例10: onBeforeRender

 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $userList = array();
     $userDtoList = array();
     $userService = BOL_UserService::getInstance();
     $questionService = BOL_QuestionService::getInstance();
     $userIdList = array_keys($this->userList);
     $userDataList = BOL_QuestionService::getInstance()->getQuestionData($userIdList, $this->fieldList);
     foreach ($userService->findUserListByIdList($userIdList) as $userDto) {
         $userDtoList[$userDto->id] = $userDto;
     }
     foreach ($this->userList as $userId => $fieldList) {
         $fields = array_diff(array_keys($fieldList), $this->fieldList);
         $fieldsData = $questionService->getQuestionData(array($userId), $fields);
         $userList[$userId]['fields'] = array_merge(!empty($userDataList[$userId]) ? $userDataList[$userId] : array(), !empty($fieldsData[$userId]) ? $fieldsData[$userId] : array(), $fieldList);
         $userList[$userId]['dto'] = $userDtoList[$userId];
     }
     $this->assign('userList', $userList);
     $this->assign('avatars', BOL_AvatarService::getInstance()->getAvatarsUrlList($userIdList, 2));
     $this->assign('onlineList', !empty($userIdList) ? $userService->findOnlineStatusForUserList($userIdList) : array());
     $this->assign('usernameList', $userService->getUserNamesForList($userIdList));
     $this->assign('displaynameList', $userService->getDisplayNamesForList($userIdList));
     $this->assign('displayActivity', $this->displayActivity);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:25,代码来源:user_list.php

示例11: importAvatars

 private function importAvatars($avatarUrl)
 {
     $avatarUrl = trim($avatarUrl);
     if (substr($avatarUrl, -1) === '/') {
         $avatarUrl = substr($avatarUrl, 0, -1);
     }
     $avatarDir = BOL_AvatarService::getInstance()->getAvatarsDir();
     $first = 0;
     $count = 150;
     while (true) {
         $list = BOL_UserService::getInstance()->findList($first, $count, true);
         $first += $count;
         if (empty($list)) {
             break;
         }
         foreach ($list as $user) {
             for ($size = 1; $size < 4; $size++) {
                 $path = BOL_AvatarService::getInstance()->getAvatarPath($user->id, $size);
                 $avatarName = str_replace($avatarDir, '', $path);
                 $content = file_get_contents($avatarUrl . '/' . $avatarName);
                 if (!empty($content)) {
                     OW::getStorage()->fileSetContent($path, $content);
                 }
             }
         }
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:27,代码来源:import.php

示例12: render

 public function render()
 {
     $defaultAvatarUrl = BOL_AvatarService::getInstance()->getDefaultAvatarUrl();
     $this->assign('defaultAvatarUrl', $defaultAvatarUrl);
     $js = "OW.Mailbox.conversationController = new MAILBOX_ConversationView();";
     OW::getDocument()->addOnloadScript($js, 3006);
     //TODO check this config
     $enableAttachments = OW::getConfig()->getValue('mailbox', 'enable_attachments');
     $this->assign('enableAttachments', $enableAttachments);
     $replyToMessageActionPromotedText = '';
     $isAuthorizedReplyToMessage = OW::getUser()->isAuthorized('mailbox', 'reply_to_message');
     $isAuthorizedReplyToMessage = $isAuthorizedReplyToMessage || OW::getUser()->isAuthorized('mailbox', 'send_chat_message');
     if (!$isAuthorizedReplyToMessage) {
         $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', 'reply_to_message');
         if ($status['status'] == BOL_AuthorizationService::STATUS_PROMOTED) {
             $replyToMessageActionPromotedText = $status['msg'];
         }
     }
     $this->assign('isAuthorizedReplyToMessage', $isAuthorizedReplyToMessage);
     $isAuthorizedReplyToChatMessage = OW::getUser()->isAuthorized('mailbox', 'reply_to_chat_message');
     if (!$isAuthorizedReplyToChatMessage) {
         $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', 'reply_to_chat_message');
         if ($status['status'] == BOL_AuthorizationService::STATUS_PROMOTED) {
             $replyToMessageActionPromotedText = $status['msg'];
         }
     }
     $this->assign('isAuthorizedReplyToChatMessage', $isAuthorizedReplyToChatMessage);
     $this->assign('replyToMessageActionPromotedText', $replyToMessageActionPromotedText);
     if ($isAuthorizedReplyToMessage) {
         $text = new WysiwygTextarea('mailbox_message');
         $text->setId('conversationTextarea');
         $this->assign('mailbox_message', $text->renderInput());
     }
     return parent::render();
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:35,代码来源:conversation.php

示例13: __construct

 /**
  * @return Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $paramObj)
 {
     parent::__construct();
     $avatarService = BOL_AvatarService::getInstance();
     $viewerId = OW::getUser()->getId();
     $userId = $paramObj->additionalParamList['entityId'];
     if ($viewerId == $userId) {
         $this->assign('owner', true);
         $this->assign('changeAvatarUrl', OW::getRouter()->urlForRoute('base_avatar_crop'));
     } else {
         $this->assign('owner', false);
     }
     $avatar = $avatarService->getAvatarUrl($userId, 2);
     $this->assign('avatar', $avatar ? $avatar : $avatarService->getDefaultAvatarUrl(2));
     $roles = BOL_AuthorizationService::getInstance()->getRoleListOfUsers(array($userId));
     $this->assign('role', !empty($roles[$userId]) ? $roles[$userId] : null);
     $userService = BOL_UserService::getInstance();
     $showPresence = true;
     // Check privacy permissions
     $eventParams = array('action' => 'base_view_my_presence_on_site', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
     try {
         OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
     } catch (RedirectException $e) {
         $showPresence = false;
     }
     $this->assign('isUserOnline', $userService->findOnlineUserById($userId) && $showPresence);
     $this->assign('userId', $userId);
     $this->assign('avatarSize', OW::getConfig()->getValue('base', 'avatar_big_size'));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:32,代码来源:user_avatar_widget.php

示例14: onBeforeRender

 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $avatarData = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($this->user->id));
     $avatarDto = BOL_AvatarService::getInstance()->findByUserId($this->user->id);
     $owner = false;
     if (OW::getUser()->getId() == $this->user->getId()) {
         $owner = true;
     }
     $isModerator = OW::getUser()->isAuthorized('base') || OW::getUser()->isAdmin();
     $avatarData[$this->user->id]['src'] = BOL_AvatarService::getInstance()->getAvatarUrl($this->user->getId(), 1, null, true, !($owner || $isModerator));
     $default_avatar['src'] = BOL_AvatarService::getInstance()->getDefaultAvatarUrl(1);
     $user = array();
     $user["avatar"] = !empty($avatarData[$this->user->id]['src']) ? $avatarData[$this->user->id] : $default_avatar;
     $user["displayName"] = $avatarData[$this->user->id]["title"];
     $this->assign("user", $user);
     $this->addComponent('toolbar', OW::getClassInstance("BASE_MCMP_ProfileActionToolbar", $this->user->id));
     $eventParams = array('action' => 'base_view_my_presence_on_site', 'ownerIdList' => array($this->user->id), 'viewerId' => OW::getUser()->getId());
     $permissions = OW::getEventManager()->getInstance()->call('privacy_check_permission_for_user_list', $eventParams);
     $showPresence = !(isset($permissions[$this->user->id]['blocked']) && $permissions[$this->user->id]['blocked'] == true);
     $this->assign("showPresence", $showPresence);
     $isOnline = null;
     $activityStamp = null;
     if ($showPresence) {
         $onlineInfo = BOL_UserService::getInstance()->findOnlineStatusForUserList(array($this->user->id));
         $isOnline = $onlineInfo[$this->user->id];
         $activityStamp = $this->user->activityStamp;
     }
     $this->assign("isOnline", $isOnline);
     $this->assign("avatarDto", $avatarDto);
     $this->assign("activityStamp", $activityStamp);
     $this->assign('owner', $owner);
     $this->assign('isModerator', $isModerator);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:34,代码来源:profile_header.php

示例15: __construct

    public function __construct($data)
    {
        $script = UTIL_JsGenerator::composeJsString('

        OWM.bind("mailbox.ready", function(readyStatus){
            if (readyStatus == 2){
                OWM.conversation = new MAILBOX_Conversation({$params});
                OWM.conversationView = new MAILBOX_MailConversationView({model: OWM.conversation});
            }
        });
        ', array('params' => $data));
        OW::getDocument()->addOnloadScript($script);
        OW::getLanguage()->addKeyForJs('mailbox', 'text_message_invitation');
        $form = new MAILBOX_MCLASS_NewMailMessageForm($data['conversationId'], $data['opponentId']);
        $this->addForm($form);
        $this->assign('data', $data);
        $this->assign('defaultAvatarUrl', BOL_AvatarService::getInstance()->getDefaultAvatarUrl());
        $firstMessage = MAILBOX_BOL_ConversationService::getInstance()->getFirstMessage($data['conversationId']);
        if (empty($firstMessage)) {
            $actionName = 'send_message';
        } else {
            $actionName = 'reply_to_message';
        }
        $isAuthorized = OW::getUser()->isAuthorized('mailbox', $actionName);
        if (!$isAuthorized) {
            $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', $actionName);
            if ($status['status'] == BOL_AuthorizationService::STATUS_PROMOTED) {
                $this->assign('sendAuthMessage', $status['msg']);
            } elseif ($status['status'] != BOL_AuthorizationService::STATUS_AVAILABLE) {
                $this->assign('sendAuthMessage', OW::getLanguage()->text('mailbox', $actionName . '_permission_denied'));
            }
        }
    }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:33,代码来源:mail_conversation.php


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