Example #1
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $questionNames = array();
     if ($this->previewMode) {
         $questions = BOL_QuestionService::getInstance()->findViewQuestionsForAccountType($this->user->accountType);
         foreach ($questions as $question) {
             if ($question["name"] == OW::getConfig()->getValue('base', 'display_name_question')) {
                 continue;
             }
             $questionNames[$question['sectionName']][] = $question["name"];
         }
     }
     $questions = BASE_CMP_UserViewWidget::getUserViewQuestions($this->user->id, OW::getUser()->isAdmin(), reset($questionNames));
     $data = array();
     foreach ($questions['data'][$this->user->id] as $key => $value) {
         $data[$key] = $value;
         if (is_array($value)) {
             $data[$key] = implode(', ', $value);
         }
     }
     $this->assign("displaySections", !$this->previewMode);
     $this->assign('questionArray', $questions['questions']);
     $this->assign('questionData', $data);
     $this->assign('questionLabelList', $questions['labels']);
 }
Example #2
0
 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);
 }
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $limit = MBOL_ConsoleService::SECTION_ITEMS_LIMIT;
     $this->addComponent('itemsCmp', new BASE_MCMP_ConsoleInvitations($limit));
     $this->assign('loadMore', $this->service->findInvitationCount(OW::getUser()->getId()) > $limit);
     $params = array('cmdUrl' => OW::getRouter()->urlFor('BASE_MCTRL_Invitations', 'command'));
     $script = 'var invitationsConsole = new OWM_InvitationsConsole(' . json_encode($params) . ');';
     OW::getDocument()->addOnloadScript($script);
 }
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $sections = MBOL_ConsoleService::getInstance()->getPageSections('notifications');
     $tplSections = array();
     foreach ($sections as $section) {
         $tplSections[] = $section['item'];
     }
     $this->assign('items', $tplSections);
 }
Example #5
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $limit = MBOL_ConsoleService::SECTION_ITEMS_LIMIT;
     $this->addComponent('itemsCmp', new FRIENDS_MCMP_ConsoleItems($limit));
     $this->assign('loadMore', $this->service->count(null, OW::getUser()->getId(), FRIENDS_BOL_Service::STATUS_PENDING) > $limit);
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('friends')->getStaticJsUrl() . 'mobile.js');
     $params = array('acceptUrl' => OW::getRouter()->urlFor('FRIENDS_MCTRL_Action', 'accept'), 'ignoreUrl' => OW::getRouter()->urlFor('FRIENDS_MCTRL_Action', 'ignore'));
     $script = 'var friendsConsole = new OWM_FriendsConsole(' . json_encode($params) . ');';
     OW::getDocument()->addOnloadScript($script);
 }
Example #6
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $limit = self::SECTION_ITEMS_LIMIT;
     $this->addComponent('itemsCmp', new NOTIFICATIONS_MCMP_ConsoleItems($limit));
     $this->assign('loadMore', $this->service->findNotificationCount(OW::getUser()->getId()) > $limit);
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('notifications')->getStaticUrl() . 'mobile.js');
     $params = array('limit' => $limit);
     $script = 'var notificationsConsole = new OWM_NotificationsConsole(' . json_encode($params) . ');';
     OW::getDocument()->addOnloadScript($script);
 }
Example #7
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $content = $this->getAboutMeContent();
     if ($content === null) {
         $this->setVisible(false);
         return;
     }
     $this->assign('aboutMe', $content);
     $this->assign('aboutUrl', OW::getRouter()->urlForRoute('base_about_profile', array('username' => $this->user->username)));
     $this->assign("previewMode", !empty($this->length));
 }
Example #8
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $event = new BASE_CLASS_EventCollector(self::EVENT_NAME, array('userId' => $this->user->id));
     OW::getEventManager()->trigger($event);
     $addedData = $event->getData();
     if (empty($addedData)) {
         $this->setVisible(false);
         return;
     }
     $this->initMenu($addedData);
 }
Example #9
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $userId = OW::getUser()->getId();
     $userService = BOL_UserService::getInstance();
     $this->assign('username', $userService->getDisplayName($userId));
     $this->assign('url', $userService->getUserUrl($userId));
     $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($userId));
     $this->assign('avatarUrl', $avatars[$userId]['src']);
     $script = '$(".owm_sidebar_profile_logout").click(function(){
         document.location.href = ' . json_encode(OW::getRouter()->urlForRoute('base_sign_out')) . ';
     });';
     OW::getDocument()->addOnloadScript($script);
 }
Example #10
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $avatarData = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($this->user->id));
     $user = array();
     $user["avatar"] = $avatarData[$this->user->id];
     $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("activityStamp", $activityStamp);
 }
Example #11
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $this->process($this->list, $this->showOnline);
 }
Example #12
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $pages = MBOL_ConsoleService::getInstance()->getPages();
     $this->assign('pages', $pages);
 }