Example #1
0
 public function __construct(BASE_CLASS_WidgetParameter $paramsObj)
 {
     parent::__construct();
     $params = $paramsObj->customParamList;
     $addParams = $paramsObj->additionalParamList;
     if (empty($addParams['entityId']) || !OW::getUser()->isAuthenticated() || !OW::getUser()->isAuthorized('eventx', 'view_event')) {
         $this->setVisible(false);
         return;
     } else {
         $userId = $addParams['entityId'];
     }
     $eventParams = array('action' => 'event_view_attend_events', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
     try {
         OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
     } catch (RedirectException $e) {
         $this->setVisible(false);
         return;
     }
     $language = OW::getLanguage();
     $eventService = EVENTX_BOL_EventService::getInstance();
     $userEvents = $eventService->findUserParticipatedPublicEvents($userId, null, $params['events_count']);
     if (empty($userEvents)) {
         $this->setVisible(false);
         return;
     }
     $this->assign('my_events', $eventService->getListingDataWithToolbar($userEvents));
     $toolbarArray = array();
     if ($eventService->findUserParticipatedPublicEventsCount($userId) > $params['events_count']) {
         $url = OW::getRequest()->buildUrlQueryString(OW::getRouter()->urlForRoute('eventx.view_event_list', array('list' => 'user-participated-events')), array('userId' => $userId));
         $toolbarArray = array(array('href' => $url, 'label' => $language->text('eventx', 'view_all_label')));
     }
     $this->assign('toolbars', $toolbarArray);
 }
Example #2
0
    public function __construct(BASE_CLASS_WidgetParameter $objParams)
    {
        parent::__construct();
        $uniqName = $objParams->widgetDetails->uniqName;
        $this->assign('uniqName', $uniqName);
        $service = SLIDESHOW_BOL_Service::getInstance();
        $slides = $service->getSlideList($uniqName);
        $this->assign('slides', $slides);
        if ($slides) {
            $url = OW::getPluginManager()->getPlugin('slideshow')->getStaticJsUrl() . 'slides.min.jquery.js';
            OW::getDocument()->addScript($url);
            $settings = $objParams->customParamList;
            $params = array('sizes' => $service->getSizes($slides), 'pagination' => $settings['navigation'] ? "true" : "false", 'interval' => $settings['interval'], 'uniqname' => $uniqName, 'effect' => $settings['effect'], 'preloadImage' => OW::getThemeManager()->getThemeImagesUrl() . '/ajax_preloader_content.gif');
            $url = OW::getPluginManager()->getPlugin('slideshow')->getStaticJsUrl() . 'slideshow.js';
            OW::getDocument()->addScript($url);
            $id = uniqid();
            $script = 'var slideshow' . $id . ' = new slideshow(' . json_encode($params) . '); slideshow' . $id . '.init();';
            if ($objParams->customizeMode) {
                $script .= 'OW.WidgetPanel.bind("move", function(e) {
		            if ( e.widgetName == "' . $uniqName . '" ) {
		               OW.WidgetPanel.reloadWidget("' . $uniqName . '", function(markup, data){});
		            }
		        });';
            }
            OW::getDocument()->addOnloadScript($script);
        }
    }
Example #3
0
 public function __construct(BASE_CLASS_WidgetParameter $paramObject)
 {
     parent::__construct();
     $this->assign('url', OW::getRouter()->urlForRoute('base_join'));
     $this->assign('label', !empty($paramObject->customParamList['buttonLabel']) ? $paramObject->customParamList['buttonLabel'] : OW::getLanguage()->text('base', 'join_index_join_button'));
     $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getMobileCmpViewDir() . 'join_now_widget.html');
 }
Example #4
0
 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);
 }
Example #5
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $groupId = $params->additionalParamList['entityId'];
     $userId = OW::getUser()->getId();
     $service = GROUPS_BOL_Service::getInstance();
     $feedService = GROUPRSS_BOL_FeedService::getInstance();
     $whoCanAdd = OW::getConfig()->getValue('grouprss', 'actionMember');
     if ($whoCanAdd == 'admin' && !OW::getUser()->isAdmin()) {
         $this->setVisible(false);
         return;
     }
     $mypaths = explode("/", UTIL_Url::selfUrl());
     $groupId = strtolower(end($mypaths));
     if ($groupId == 'customize') {
         $groupId = strtolower(prev($mypaths));
     }
     if ($whoCanAdd == 'creator' && $feedService->getGroupCreater($groupId) !== $userId) {
         $this->setVisible(false);
         return;
     }
     if ($whoCanAdd == 'both') {
         if (!OW::getUser()->isAdmin() && $feedService->getGroupCreater($groupId) !== $userId) {
             $this->setVisible(false);
             return;
         }
     }
     $this->assign('groupId', (int) $groupId);
 }
Example #6
0
 /**
  * @return Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $paramObj)
 {
     parent::__construct();
     $service = GROUPS_BOL_Service::getInstance();
     $groupId = (int) $paramObj->additionalParamList['entityId'];
     $this->addComponent('briefInfo', new GROUPS_CMP_BriefInfoContent($groupId));
 }
Example #7
0
 /**
  * @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'));
 }
Example #8
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCmpViewDir() . 'users_widget.html');
     $randId = UTIL_HtmlTag::generateAutoId('base_users_widget');
     $this->assign('widgetId', $randId);
     $data = $this->getData($params);
     $menuItems = array();
     $dataToAssign = array();
     if (!empty($data)) {
         foreach ($data as $key => $item) {
             $contId = "{$randId}_users_widget_{$key}";
             $toolbarId = !empty($item['toolbar']) ? "{$randId}_toolbar_{$key}" : false;
             $menuItems[$key] = array('label' => $item['menu-label'], 'id' => "{$randId}_users_widget_menu_{$key}", 'contId' => $contId, 'active' => !empty($item['menu_active']), 'toolbarId' => $toolbarId);
             $usersCmp = $this->getUsersCmp($item['userIds']);
             $dataToAssign[$key] = array('users' => $usersCmp->render(), 'active' => !empty($item['menu_active']), 'toolbar' => !empty($item['toolbar']) ? $item['toolbar'] : array(), 'toolbarId' => $toolbarId, 'contId' => $contId);
         }
     }
     $this->assign('data', $dataToAssign);
     $displayMenu = true;
     if (count($data) == 1 && !$this->forceDisplayMenu) {
         $displayMenu = false;
     }
     if (!$params->customizeMode && (count($data) != 1 || $this->forceDisplayMenu)) {
         $menu = $this->getMenuCmp($menuItems);
         if (!empty($menu)) {
             $this->addComponent('menu', $menu);
         }
     }
 }
Example #9
0
 public function __construct(BASE_CLASS_WidgetParameter $paramObject)
 {
     parent::__construct();
     $text = OW::getLanguage()->text('base', 'welcome_widget_content');
     $text = str_replace('</li>', "</li>\n", $text);
     //if the tags are written in a line it is necessary to make a compulsory hyphenation?
     $photoKey = str_replace('{$key}', self::KEY_PHOTO_UPLOAD, self::PATTERN);
     $avatarKey = str_replace('{$key}', self::KEY_CHANGE_AVATAR, self::PATTERN);
     if (OW::getPluginManager()->isPluginActive('photo') && mb_stripos($text, self::KEY_PHOTO_UPLOAD) !== false) {
         $label = OW::getLanguage()->text('photo', 'upload_photos');
         $js = OW::getEventManager()->call('photo.getAddPhotoURL');
         $langLabel = $this->getLangLabel($photoKey, $text, self::KEY_PHOTO_UPLOAD);
         if ($langLabel != NULL) {
             $label = $langLabel;
         }
         $text = preg_replace($photoKey, '<li><a href="javascript://" onclick="' . $js . '();">' . $label . '</a></li>', $text);
     } else {
         $text = preg_replace($photoKey, '', $text);
     }
     if (mb_stripos($text, self::KEY_CHANGE_AVATAR) !== false) {
         $label = OW::getLanguage()->text('base', 'avatar_change');
         $js = ' $("#welcomeWinget_loadAvatarChangeCmp").click(function(){' . 'document.avatarFloatBox = OW.ajaxFloatBox("BASE_CMP_AvatarChange", [], {width: 749, title: ' . json_encode($label) . '});' . '});';
         OW::getDocument()->addOnloadScript($js);
         $langLabel = $this->getLangLabel($avatarKey, $text, self::KEY_CHANGE_AVATAR);
         if ($langLabel != NULL) {
             $label = $langLabel;
         }
         $text = preg_replace($avatarKey, '<li><a id="welcomeWinget_loadAvatarChangeCmp" href="javascript://">' . $label . '</a></li>', $text);
     } else {
         $text = preg_replace($avatarKey, '', $text);
     }
     $this->assign('text', $text);
 }
Example #10
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $service = FRIENDS_BOL_Service::getInstance();
     $userId = $params->additionalParamList['entityId'];
     $count = (int) $params->customParamList['count'];
     $idList = $service->findUserFriendsInList($userId, 0, $count);
     $total = $service->countFriends($userId);
     $userService = BOL_UserService::getInstance();
     $eventParams = array('action' => 'friends_view', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
     try {
         OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
     } catch (RedirectException $e) {
         $this->setVisible(false);
         return;
     }
     if (empty($idList) && !$params->customizeMode) {
         $this->setVisible(false);
         return;
     }
     if (!empty($idList)) {
         $this->addComponent('userList', new BASE_CMP_AvatarUserList($idList));
     }
     $username = BOL_UserService::getInstance()->getUserName($userId);
     $toolbar = array();
     if ($total > $count) {
         $toolbar = array(array('label' => OW::getLanguage()->text('base', 'view_all'), 'href' => OW::getRouter()->urlForRoute('friends_user_friends', array('user' => $username))));
     }
     $this->assign('toolbar', $toolbar);
 }
Example #11
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $count = (int) $params->customParamList['count'];
     $service = SKAPI_BOL_Service::getInstance();
     $userId = OW::getUser()->getId();
     $guests = $service->findGuestsForUser($userId, 1, $count);
     if (!$guests) {
         $this->setVisible(false);
         return;
     }
     $userIdList = array();
     foreach ($guests as $guest) {
         array_push($userIdList, $guest->guestId);
     }
     $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars($userIdList);
     foreach ($avatars as &$item) {
         $item['class'] = 'ow_guest_avatar';
     }
     $event = new OW_Event('bookmarks.is_mark', array(), $avatars);
     OW::getEventManager()->trigger($event);
     if ($event->getData()) {
         $avatars = $event->getData();
     }
     $this->assign('avatars', $avatars);
     $this->assign('guests', $guests);
     $total = $service->countGuestsForUser($userId);
     if ($total > $count) {
         $toolbar = array('label' => OW::getLanguage()->text('base', 'view_all'), 'href' => OW::getRouter()->urlForRoute('skapi.list'));
         $this->setSettingValue(self::SETTING_TOOLBAR, array($toolbar));
     }
 }
Example #12
0
 /**
  * @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));
 }
Example #13
0
 /**
  * @param BASE_CLASS_WidgetParameter $params
  * @return \BASE_CMP_UserViewWidget
  */
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $userId = $params->additionalParamList['entityId'];
     $viewerId = OW::getUser()->getId();
     $ownerMode = $userId == $viewerId;
     $adminMode = OW::getUser()->isAdmin() || OW::getUser()->isAuthorized('base');
     $isSuperAdmin = BOL_AuthorizationService::getInstance()->isSuperModerator($userId);
     $user = BOL_UserService::getInstance()->findUserById($userId);
     $accountType = $user->accountType;
     $questionService = BOL_QuestionService::getInstance();
     $questions = self::getUserViewQuestions($userId, $adminMode);
     $questionArray = $questions['questions'];
     $questionData = $questions['data'];
     $questionLabelList = $questions['labels'];
     $sections = array_keys($questionArray);
     $template = OW::getPluginManager()->getPlugin('base')->getViewDir() . 'components' . DS . 'user_view_widget_table.html';
     $userViewPresntation = OW::getConfig()->getValue('base', 'user_view_presentation');
     if ($userViewPresntation === self::USER_VIEW_PRESENTATION_TABS) {
         $template = OW::getPluginManager()->getPlugin('base')->getViewDir() . 'components' . DS . 'user_view_widget_tabs.html';
         OW::getDocument()->addOnloadScript(" view = new UserViewWidget(); ");
         $jsDir = OW::getPluginManager()->getPlugin("base")->getStaticJsUrl();
         OW::getDocument()->addScript($jsDir . "user_view_widget.js");
         $this->addMenu($sections);
     }
     $script = ' $(".profile_hidden_field").bind( "mouseover.hiddenfield",
                     function() {
                     OW.showTip($(this), {side: "top", hideEvent: "mouseout",  timeout:0, show: "' . OW::getLanguage()->text('base', 'base_invisible_profile_field_tooltip') . '"});
                 } );';
     OW::getDocument()->addOnloadScript($script);
     $this->setTemplate($template);
     $accountTypes = $questionService->findAllAccountTypes();
     if (!isset($sections[0])) {
         $sections[0] = 0;
     }
     if (count($accountTypes) > 1) {
         if (!isset($questionArray[$sections[0]])) {
             $questionArray[$sections[0]] = array();
         }
         array_unshift($questionArray[$sections[0]], array('name' => 'accountType', 'presentation' => 'select'));
         $questionData[$userId]['accountType'] = $questionService->getAccountTypeLang($accountType);
     }
     if (!isset($questionData[$userId])) {
         $questionData[$userId] = array();
     }
     $this->assign('firstSection', $sections[0]);
     $this->assign('questionArray', $questionArray);
     $this->assign('questionData', $questionData[$userId]);
     $this->assign('ownerMode', $ownerMode);
     $this->assign('adminMode', $adminMode);
     $this->assign('superAdminProfile', $isSuperAdmin);
     $this->assign('profileEditUrl', OW::getRouter()->urlForRoute('base_edit'));
     if ($adminMode && !$ownerMode) {
         $this->assign('profileEditUrl', OW::getRouter()->urlForRoute('base_edit_user_datails', array('userId' => $userId)));
     }
     $this->assign('avatarUrl', BOL_AvatarService::getInstance()->getAvatarUrl($userId));
     $this->assign('displayName', BOL_UserService::getInstance()->getDisplayName($userId));
     $this->assign('questionLabelList', $questionLabelList);
     $this->assign('userId', $userId);
 }
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     if (!BOL_AuthorizationService::getInstance()->isModerator() && !OW::getUser()->isAdmin()) {
         $this->setVisible(false);
         return;
     }
     $uniqId = uniqid("mp-");
     $this->assign("uniqId", $uniqId);
     $event = new BASE_CLASS_EventCollector(self::EVENT_COLLECT_CONTENTS);
     OW::getEventManager()->trigger($event);
     $tplContents = array();
     $activeTab = null;
     foreach ($event->getData() as $content) {
         $tplContent = array_merge(array("name" => null, "content" => null, "active" => false), $content);
         $activeTab = $tplContent["active"] ? $tplContent["name"] : $activeTab;
         $tplContents[$tplContent["name"]] = $tplContent;
     }
     if (empty($tplContents)) {
         $this->setVisible(false);
         return;
     }
     if ($activeTab === null) {
         $firstTab = reset($tplContents);
         $activeTab = $firstTab["name"];
         $tplContents[$activeTab]["active"] = true;
     }
     $this->assign("items", $tplContents);
 }
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $lang = OW::getLanguage();
     $service = OCSTOPUSERS_BOL_Service::getInstance();
     $limit = $params->customParamList['userCount'];
     $list = $service->findList(1, $limit);
     if ($list) {
         $this->assign('list', $list);
         $total = $service->countUsers();
         $this->assign('total', $total);
         $idList = array();
         $scores = array();
         $rates = array();
         foreach ($list as $user) {
             array_push($idList, $user['dto']->id);
             $scores[$user['dto']->id] = $user['score'];
             $rates[$user['dto']->id] = $user['rates'];
         }
         $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars($idList);
         foreach ($avatars as $userId => &$av) {
             $av['title'] .= ' - ' . $lang->text('ocstopusers', 'rate_info', array('rates' => $rates[$userId], 'score' => floatval($scores[$userId])));
         }
         $this->assign('avatars', $avatars);
         $this->assign('scores', $scores);
         if ($total > $limit) {
             $toolbar = array(array('href' => OW::getRouter()->urlForRoute('ocstopusers.list'), 'label' => OW::getLanguage()->text('base', 'view_all')));
             $this->setSettingValue(self::SETTING_TOOLBAR, $toolbar);
         }
     } else {
         $this->assign('list', null);
     }
 }
Example #16
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $lang = OW::getLanguage();
     $service = OCSSITESTATS_BOL_Service::getInstance();
     $this->assign('data', $service->getStatistics());
     $this->assign('zeroValues', OW::getConfig()->getValue('ocssitestats', 'zero_values'));
 }
Example #17
0
 /**
  * @return Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $paramObj)
 {
     parent::__construct();
     $clipService = VWLS_BOL_ClipService::getInstance();
     $count = isset($paramObj->customParamList['clipCount']) ? (int) $paramObj->customParamList['clipCount'] : 4;
     $lang = OW::getLanguage();
     $this->assign('showTitles', $paramObj->customParamList['showTitles']);
     /**        $latest = $clipService->findClipsList('latest', 1, $count);
             if ( $latest )
             {
                 $latest[0]['code'] = $this->prepareClipCode($latest[0]['code'], $latest[0]['provider']);
             }
             $this->assign('latest', $latest);
     */
     $online = $clipService->findClipsList('online', 1, $count);
     if ($online) {
         $online[0]['code'] = $this->prepareClipCode($online[0]['code'], $latest[0]['provider']);
     }
     $this->assign('online', $online);
     $userId = OW::getUser()->getId();
     $this->assign('userId', $userId);
     if (!$latest && !OW::getUser()->isAuthorized('vwls', 'add')) {
         $this->setVisible(false);
         return;
     }
     /**        $featured = $clipService->findClipsList('featured', 1, $count);
             if ( $featured )
             {
                 $featured[0]['code'] = $this->prepareClipCode($featured[0]['code'], $featured[0]['provider']);
             }
             $this->assign('featured', $featured);
     */
     $toprated = $clipService->findClipsList('toprated', 1, $count);
     if ($toprated) {
         $toprated[0]['code'] = $this->prepareClipCode($toprated[0]['code'], $toprated[0]['provider']);
     }
     $this->assign('toprated', $toprated);
     $menuItems['latest'] = array('label' => $lang->text('vwls', 'menu_latest'), 'id' => 'vwls-widget-menu-latest', 'contId' => 'vwls-widget-latest', 'active' => true);
     /**        if ( $featured )
             {
                 $menuItems['featured'] = array(
                     'label' => $lang->text('vwls', 'menu_featured'),
                     'id' => 'vwls-widget-menu-featured',
                     'contId' => 'vwls-widget-featured',
                 );
             }
     */
     $menuItems['toprated'] = array('label' => $lang->text('vwls', 'menu_toprated'), 'id' => 'vwls-widget-menu-toprated', 'contId' => 'vwls-widget-toprated');
     if (!$paramObj->customizeMode) {
         $this->addComponent('menu', new BASE_CMP_WidgetMenu($menuItems));
     }
     $this->assign('items', $menuItems);
     $toolbars = self::getToolbar();
     $this->assign('toolbars', $toolbars);
     if ($latest) {
         $this->setSettingValue(self::SETTING_TOOLBAR, $toolbars['latest']);
     }
 }
Example #18
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $service = LinkService::getInstance();
     $userId = $params->additionalParamList['entityId'];
     if ($userId != OW::getUser()->getId() && !OW::getUser()->isAuthorized('links', 'view')) {
         $this->setVisible(false);
         return;
     }
     /* Check privacy permissions */
     $eventParams = array('action' => LinkService::PRIVACY_ACTION_VIEW_LINKS, 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
     try {
         OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
     } catch (RedirectException $ex) {
         $this->setVisible(false);
         return;
     }
     /* */
     if ($service->countUserLinks($userId) == 0 && !$params->customizeMode) {
         $this->setVisible(false);
         return;
     }
     $this->assign('displayname', BOL_UserService::getInstance()->getDisplayName($userId));
     $this->assign('username', BOL_UserService::getInstance()->getUsername($userId));
     $list = array();
     $count = $params->customParamList['count'];
     $userLinkList = $service->findUserLinkList($userId, 0, $count);
     $idList = array();
     foreach ($userLinkList as $item) {
         /* Check privacy permissions */
         if ($item->userId != OW::getUser()->getId() && !OW::getUser()->isAuthorized('links')) {
             $eventParams = array('action' => LinkService::PRIVACY_ACTION_VIEW_LINKS, 'ownerId' => $item->userId, 'viewerId' => OW::getUser()->getId());
             try {
                 OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
             } catch (RedirectException $ex) {
                 continue;
             }
         }
         /* */
         $list[] = $item;
         $idList[] = $item->id;
     }
     $commentInfo = array();
     if (!empty($idList)) {
         $commentInfo = BOL_CommentService::getInstance()->findCommentCountForEntityList('link', $idList);
         $tb = array();
         foreach ($list as $key => $item) {
             if (mb_strlen($item->getDescription()) > 100) {
                 $item->setDescription(UTIL_String::truncate($item->getDescription(), 100, '...'));
             }
             $list[$key]->setDescription(strip_tags($item->getDescription()));
             $tb[$item->getId()] = array(array('label' => '<span class="ow_txt_value">' . $commentInfo[$item->getId()] . '</span> ' . OW::getLanguage()->text('links', 'comments'), 'href' => OW::getRouter()->urlForRoute('link', array('id' => $item->getId()))), array('label' => UTIL_DateTime::formatDate($item->getTimestamp()), 'class' => 'ow_ic_date'));
         }
         $this->assign('tb', $tb);
     }
     $this->assign('list', $list);
     $this->setSettingValue(self::SETTING_TOOLBAR, array(array('label' => OW::getLanguage()->text('base', 'view_all'), 'href' => OW::getRouter()->urlForRoute('links-user', array('user' => BOL_UserService::getInstance()->getUserName($userId))))));
 }
Example #19
0
 /**
  * @return Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $groupId = $params->additionalParamList['entityId'];
     $count = empty($params->customParamList['count']) ? 9 : (int) $params->customParamList['count'];
     if ($this->assignList($groupId, $count)) {
         $this->setSettingValue(self::SETTING_TOOLBAR, array(array('label' => OW::getLanguage()->text('groups', 'widget_users_view_all'), 'href' => OW::getRouter()->urlForRoute('groups-user-list', array('groupId' => $groupId)))));
     }
 }
Example #20
0
 public static function processSettingList($settings, $place, $isAdmin)
 {
     if ($place != BOL_ComponentService::PLACE_DASHBOARD && !OW::getUser()->isAdmin()) {
         $settings['content'] = UTIL_HtmlTag::stripJs($settings['content']);
         //$settings['content'] = UTIL_HtmlTag::stripTags($settings['content'], array('frame'), array(), true, true);
     } else {
         $settings['content'] = UTIL_HtmlTag::sanitize($settings['content']);
     }
     return parent::processSettingList($settings, $place, $isAdmin);
 }
Example #21
0
 /**
  * Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $paramObj)
 {
     parent::__construct();
     $cmp = new ADS_CMP_Ads(array('position' => 'sidebar'));
     if (!$cmp->isVisible()) {
         $this->setVisible(false);
     } else {
         $this->addComponent('ads', $cmp);
     }
 }
Example #22
0
 public static function validateSettingList($settingList)
 {
     parent::validateSettingList($settingList);
     if ($settingList["list"] == "by_role" && empty($settingList["roles"])) {
         throw new WidgetSettingValidateException(OW::getLanguage()->text("ucarousel", "widget_settings_list_roles_error"), 'roles');
     }
     if ($settingList["list"] == "by_account_type" && empty($settingList["account_types"])) {
         throw new WidgetSettingValidateException(OW::getLanguage()->text("ucarousel", "widget_settings_list_roles_account_types"), 'account_types');
     }
 }
Example #23
0
 /**
  * @return Constructor.
  */
 public function __construct(BASE_CLASS_WidgetParameter $paramObj, $template = null)
 {
     parent::__construct();
     $template = empty($template) ? 'feed_widget' : $template;
     $this->setTemplate(OW::getPluginManager()->getPlugin('newsfeed')->getCmpViewDir() . $template . '.html');
     $this->feedParams['customizeMode'] = $paramObj->customizeMode;
     $this->feedParams['viewMore'] = $paramObj->customParamList['view_more'];
     $this->feedParams['displayCount'] = (int) $paramObj->customParamList['count'];
     $this->feedParams['displayCount'] = $this->feedParams['displayCount'] > 20 ? 20 : $this->feedParams['displayCount'];
 }
Example #24
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $list = OCSFAQ_BOL_FaqService::getInstance()->getFeaturedQuestionList();
     if (!$list) {
         $this->setVisible(false);
     }
     $this->assign('list', $list);
     $this->assign('expand', OW::getConfig()->getValue('ocsfaq', 'expand_answers'));
 }
Example #25
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     if (!OW::getUser()->isAuthorized('ocssitestats', 'view_stats')) {
         $this->setVisible(false);
         return;
     }
     $service = OCSSITESTATS_BOL_Service::getInstance();
     $this->assign('data', $service->getStatistics());
     $this->assign('zeroValues', OW::getConfig()->getValue('ocssitestats', 'zero_values'));
 }
Example #26
0
 public function __construct(BASE_CLASS_WidgetParameter $paramObject)
 {
     parent::__construct();
     $params = $paramObject->customParamList;
     if (!empty($params['content'])) {
         $this->content = $paramObject->customizeMode && !empty($_GET['disable-js']) ? UTIL_HtmlTag::stripJs($params['content']) : $params['content'];
     }
     if (isset($params['nl_to_br'])) {
         $this->nl2br = (bool) $params['nl_to_br'];
     }
 }
Example #27
0
 public static function validateSettingList($settingList)
 {
     parent::validateSettingList($settingList);
     $validationMessage = OW::getLanguage()->text('photo', 'cmp_widget_photo_count_msg');
     if (!preg_match('/^\\d+$/', $settingList['photoCount'])) {
         throw new WidgetSettingValidateException($validationMessage, 'photoCount');
     }
     if ($settingList['photoCount'] > 100) {
         throw new WidgetSettingValidateException($validationMessage, 'photoCount');
     }
 }
Example #28
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $userId = (int) $params->additionalParamList['entityId'];
     if (!SPONSORS_BOL_Service::getInstance()->isMemberSponsor($userId)) {
         $this->setVisible(false);
         return;
     }
     $this->setSettingValue(self::SETTING_TOOLBAR, array(array('label' => OW::getLanguage()->text('sponsors', 'become_sponsor'), 'href' => OW::getRouter()->urlForRoute('sponsors_sponsor'))));
     $this->assign('sponsorImageUrl', OW::getPluginManager()->getPlugin('sponsors')->getUserFilesUrl() . "defaultSponsor.jpg");
 }
Example #29
0
 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     if (!OW::getUser()->isAuthorized('yncontactimporter', 'invite')) {
         $this->setVisible(false);
         return;
     }
     //load css
     $cssUrl = OW::getPluginManager()->getPlugin('yncontactimporter')->getStaticCssUrl() . 'yncontactimporter.css';
     OW::getDocument()->addStyleSheet($cssUrl);
     $limit = (int) $params->customParamList['count'];
     if (!$limit) {
         $limit = 5;
     }
     $providers = YNCONTACTIMPORTER_BOL_ProviderService::getInstance()->getAllProviders(array('limit' => $limit, 'enable' => 1));
     $arr_providers = array();
     foreach ($providers as $provider) {
         if (in_array($provider->name, array('facebook', 'twitter', 'linkedin'))) {
             $core = new YNCONTACTIMPORTER_CLASS_Core();
             if (!$core->checkSocialBridgePlugin($provider->name)) {
                 continue;
             }
         }
         $item = array();
         $item['title'] = $provider->title;
         $item['name'] = $provider->name;
         $item['id'] = $provider->id;
         $item['logo'] = OW::getPluginManager()->getPlugin('yncontactimporter')->getStaticUrl() . "img/" . $provider->name . ".png";
         $arr_providers[] = $item;
     }
     $this->assign('providers', $arr_providers);
     $this->assign('viewMore', OW::getRouter()->urlForRoute('yncontactimporter-import'));
     $this->assign('authorization', OW::getLanguage()->text('yncontactimporter', 'authorization'));
     $this->assign('import_your_contacts', OW::getLanguage()->text('yncontactimporter', 'import_your_contacts'));
     $this->assign("uploadCSVTitle", OW::getLanguage()->text('yncontactimporter', 'upload_csv_file'));
     //check show more
     $this->assign("showMore", 0);
     if ($limit < 9) {
         $this->assign("showMore", 1);
     }
     //get config
     $width = '30px';
     $height = '30px';
     $configs = OW::getConfig()->getValues('yncontactimporter');
     if (isset($configs['logo_width'])) {
         $width = $configs['logo_width'] . "px";
     }
     if (isset($configs['logo_height'])) {
         $height = $configs['logo_height'] . "px";
     }
     $this->assign("width", $width);
     $this->assign("height", $height);
     OW::getLanguage()->importPluginLangs(OW::getPluginManager()->getPlugin('yncontactimporter')->getRootDir() . 'langs.zip', 'yncontactimporter');
 }
Example #30
0
 public function __construct(BASE_CLASS_WidgetParameter $param)
 {
     parent::__construct();
     $event = new BASE_CLASS_EventCollector(self::EVENT_NAME);
     OW::getEventManager()->trigger($event);
     $items = $event->getData();
     $this->assign('data', $items);
     if (empty($items)) {
         $this->setVisible(false);
     }
 }