Ejemplo n.º 1
0
 public function __construct(BASE_CommentsParams $params, $id, $formName)
 {
     parent::__construct();
     $language = OW::getLanguage();
     $form = new Form($formName);
     $textArea = new Textarea('commentText');
     $textArea->setHasInvitation(true);
     $textArea->setInvitation($language->text('base', 'comment_form_element_invitation_text'));
     $form->addElement($textArea);
     $hiddenEls = array('entityType' => $params->getEntityType(), 'entityId' => $params->getEntityId(), 'displayType' => $params->getDisplayType(), 'pluginKey' => $params->getPluginKey(), 'ownerId' => $params->getOwnerId(), 'cid' => $id, 'commentCountOnPage' => $params->getCommentCountOnPage(), 'isMobile' => 1);
     foreach ($hiddenEls as $name => $value) {
         $el = new HiddenField($name);
         $el->setValue($value);
         $form->addElement($el);
     }
     $submit = new Submit('comment-submit');
     $submit->setValue($language->text('base', 'comment_add_submit_label'));
     $form->addElement($submit);
     $form->setAjax(true);
     $form->setAction(OW::getRouter()->urlFor('BASE_CTRL_Comments', 'addComment'));
     //        $form->bindJsFunction(Form::BIND_SUBMIT, "function(){ $('#comments-" . $id . " .comments-preloader').show();}");
     //        $form->bindJsFunction(Form::BIND_SUCCESS, "function(){ $('#comments-" . $id . " .comments-preloader').hide();}");
     $this->addForm($form);
     OW::getDocument()->addOnloadScript("window.owCommentCmps['{$id}'].initForm('" . $textArea->getId() . "', '" . $submit->getId() . "');");
     $this->assign('form', true);
     $this->assign('id', $id);
 }
Ejemplo n.º 2
0
 /**
  * Class constructor
  * 
  * @param array $params
  *      string linkText
  */
 public function __construct(array $params = array())
 {
     parent::__construct();
     // add a form
     $form = new InsertVideoForm();
     $this->addForm($form);
 }
Ejemplo n.º 3
0
 public function __construct($list, $showOnline = true)
 {
     parent::__construct();
     $this->list = $list;
     $this->showOnline = $showOnline;
     $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getMobileCmpViewDir() . 'user_list.html');
 }
Ejemplo n.º 4
0
 public function __construct($params)
 {
     parent::__construct();
     $this->visiblePhotoCount = !empty($params['photoCount']) ? (int) $params['photoCount'] : 8;
     $checkAuth = isset($params['checkAuth']) ? (bool) $params['checkAuth'] : true;
     $wrap = isset($params['wrapBox']) ? (bool) $params['wrapBox'] : true;
     $boxType = isset($params['boxType']) ? $params['boxType'] : '';
     $showTitle = isset($params['showTitle']) ? (bool) $params['showTitle'] : true;
     $uniqId = isset($params['uniqId']) ? $params['uniqId'] : uniqid();
     if ($checkAuth && !OW::getUser()->isAuthorized('photo', 'view')) {
         $this->setVisible(false);
         return;
     }
     $photoService = PHOTO_BOL_PhotoService::getInstance();
     $latest = $photoService->findPhotoList('latest', 1, $this->visiblePhotoCount, NULL, PHOTO_BOL_PhotoService::TYPE_PREVIEW);
     $this->assign('latest', $latest);
     $featured = $photoService->findPhotoList('featured', 1, $this->visiblePhotoCount, NULL, PHOTO_BOL_PhotoService::TYPE_PREVIEW);
     $this->assign('featured', $featured);
     $toprated = $photoService->findPhotoList('toprated', 1, $this->visiblePhotoCount, NULL, PHOTO_BOL_PhotoService::TYPE_PREVIEW);
     $this->assign('toprated', $toprated);
     $items = array('latest', 'toprated');
     if ($featured) {
         $items[] = 'featured';
     }
     $menuItems = $this->getMenuItems($items, $uniqId);
     $this->assign('items', $menuItems);
     $this->assign('wrapBox', $wrap);
     $this->assign('boxType', $boxType);
     $this->assign('showTitle', $showTitle);
     $this->assign('url', OW::getEventManager()->call('photo.getAddPhotoURL', array('')));
     $this->assign('uniqId', $uniqId);
     $this->setTemplate(OW::getPluginManager()->getPlugin('photo')->getMobileCmpViewDir() . 'index_photo_list.html');
 }
Ejemplo n.º 5
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     if (!OW::getUser()->isAuthenticated()) {
         $this->setVisible(false);
     }
 }
Ejemplo n.º 6
0
 public function __construct($listType, $count, $exclude = null, $albumId = null)
 {
     parent::__construct();
     $this->photoService = PHOTO_BOL_PhotoService::getInstance();
     $this->photoAlbumService = PHOTO_BOL_PhotoAlbumService::getInstance();
     $checkPrivacy = !OW::getUser()->isAuthorized('photo');
     if ($albumId) {
         $photos = $this->photoService->getAlbumPhotos($albumId, 1, $count, $exclude);
     } else {
         $photos = $this->photoService->findPhotoList($listType, 1, $count, $checkPrivacy, $exclude);
     }
     $this->assign('photos', $photos);
     foreach ($photos as $photo) {
         array_push($exclude, $photo['id']);
     }
     if ($albumId) {
         $loadMore = $this->photoAlbumService->countAlbumPhotos($albumId, $exclude);
     } else {
         $loadMore = $this->photoService->countPhotos($listType, $checkPrivacy, $exclude);
     }
     if (!$loadMore) {
         $script = "OWM.trigger('photo.hide_load_more', {});";
         OW::getDocument()->addOnloadScript($script);
     }
 }
Ejemplo n.º 7
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->service = BOL_InvitationService::getInstance();
     $allInvitationCount = $this->service->findInvitationCount(OW::getUser()->getId());
     if (!$allInvitationCount) {
         $this->setVisible(false);
     }
 }
Ejemplo n.º 8
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     // console is not visible for guest users
     if (!OW::getUser()->isAuthenticated()) {
         $this->setVisible(false);
         return;
     }
 }
Ejemplo n.º 9
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->service = FRIENDS_BOL_Service::getInstance();
     $count = $this->service->count(null, OW::getUser()->getId(), FRIENDS_BOL_Service::STATUS_PENDING);
     if (!$count) {
         $this->setVisible(false);
     }
 }
Ejemplo n.º 10
0
 /**
  * Class constructor
  * 
  * @param array $params
  *      string linkText
  */
 public function __construct(array $params = array())
 {
     parent::__construct();
     $title = !empty($params['linkText']) ? trim(strip_tags($params['linkText'])) : null;
     // add a form
     $form = new InsertLinkForm();
     $form->setValues(array('title' => $title));
     $this->addForm($form);
 }
Ejemplo n.º 11
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->service = NOTIFICATIONS_BOL_Service::getInstance();
     $count = $this->service->findNotificationCount(OW::getUser()->getId());
     if (!$count) {
         $this->setVisible(false);
     }
 }
Ejemplo n.º 12
0
 public function __construct(array $params)
 {
     parent::__construct();
     $this->videoService = IVIDEO_BOL_Service::getInstance();
     $listType = isset($params['type']) ? $params['type'] : '';
     $count = isset($params['count']) ? $params['count'] : 5;
     $tag = isset($params['tag']) ? $params['tag'] : '';
     $userId = isset($params['userId']) ? $params['userId'] : null;
     $category = isset($params['category']) ? $params['category'] : null;
     $page = isset($_GET['page']) && (int) $_GET['page'] ? (int) $_GET['page'] : 1;
     $videosPerPage = (int) OW::getConfig()->getValue('ivideo', 'resultsPerPage');
     if ($userId) {
         $videos = $this->videoService->findUserVideosList($userId, $page, $videosPerPage);
         $records = $this->videoService->findUserVideosCount($userId);
     } else {
         if (strlen($tag)) {
             $videos = $this->videoService->findTaggedVideosList($tag, $page, $videosPerPage);
             $records = $this->videoService->findTaggedVideosCount($tag);
         } else {
             if (strlen($category)) {
                 $videos = $this->videoService->findCategoryVideosList($category, $page, $videosPerPage);
                 $records = $this->videoService->findCategoryVideosCount($category);
             } else {
                 $videos = $this->videoService->findVideosList($listType, $page, $videosPerPage);
                 $records = $this->videoService->findVideosCount($listType);
             }
         }
     }
     $this->assign('listType', $listType);
     if ($videos) {
         $this->assign('no_content', null);
         $this->assign('videos', $videos);
         $userIds = array();
         foreach ($videos as $video) {
             if (!in_array($video['owner'], $userIds)) {
                 array_push($userIds, $video['owner']);
             }
         }
         $names = BOL_UserService::getInstance()->getDisplayNamesForList($userIds);
         $this->assign('displayNames', $names);
         $usernames = BOL_UserService::getInstance()->getUserNamesForList($userIds);
         $this->assign('usernames', $usernames);
         $pages = (int) ceil($records / $videosPerPage);
         $paging = new BASE_CMP_Paging($page, $pages, 10);
         $this->assign('paging', $paging->render());
         $this->assign('count', $count);
     } else {
         $this->assign('no_content', OW::getLanguage()->text('ivideo', 'no_video_found'));
     }
     $this->assign('getUserFilesUrl', OW::getPluginManager()->getPlugin('ivideo')->getUserFilesUrl());
     $this->assign('videoPreviewWidth', OW::getConfig()->getValue('ivideo', 'videoPreviewWidth'));
     $this->assign('videoPreviewHeight', OW::getConfig()->getValue('ivideo', 'videoPreviewHeight'));
     $this->assign('posterImage', OW::getPluginManager()->getPlugin('ivideo')->getStaticUrl() . 'poster.jpg');
     $this->assign('defaultThumb', OW::getPluginManager()->getPlugin('ivideo')->getStaticUrl() . 'video.png');
 }
Ejemplo n.º 13
0
 /**
  * Constructor.
  */
 public function __construct($timestamp)
 {
     parent::__construct();
     $service = NOTIFICATIONS_BOL_Service::getInstance();
     $userId = OW::getUser()->getId();
     $notifications = $service->findNewNotificationList($userId, $timestamp);
     $items = NOTIFICATIONS_MCMP_ConsoleItems::prepareData($notifications);
     $this->assign('items', $items);
     // Mark as viewed
     $service->markNotificationsViewedByUserId($userId);
     $tpl = OW::getPluginManager()->getPlugin('notifications')->getMobileCmpViewDir() . 'console_items.html';
     $this->setTemplate($tpl);
 }
Ejemplo n.º 14
0
 /**
  * Constructor.
  */
 public function __construct($timestamp)
 {
     parent::__construct();
     $service = FRIENDS_BOL_Service::getInstance();
     $userId = OW::getUser()->getId();
     $requests = $service->findNewRequestList($userId, $timestamp);
     $items = FRIENDS_MCMP_ConsoleItems::prepareData($requests);
     $this->assign('items', $items);
     // Mark as viewed
     $service->markAllViewedByUserId($userId);
     $tpl = OW::getPluginManager()->getPlugin('friends')->getMobileCmpViewDir() . 'console_items.html';
     $this->setTemplate($tpl);
 }
Ejemplo n.º 15
0
 /**
  * Constructor.
  */
 public function __construct($timestamp)
 {
     parent::__construct();
     $service = BOL_InvitationService::getInstance();
     $userId = OW::getUser()->getId();
     $invitations = $service->findNewInvitationList($userId, $timestamp);
     $items = BASE_MCMP_ConsoleInvitations::prepareData($invitations);
     $this->assign('items', $items);
     // Mark as viewed
     $service->markViewedByUserId($userId);
     $tpl = OW::getPluginManager()->getPlugin('base')->getMobileCmpViewDir() . 'console_invitations.html';
     $this->setTemplate($tpl);
 }
Ejemplo n.º 16
0
 /**
  * Constructor.
  */
 public function __construct($ajax = true)
 {
     parent::__construct();
     if (OW::getUser()->isAuthenticated()) {
         $this->setVisible(false);
     }
     $form = BOL_UserService::getInstance()->getSignInForm('sign-in', false);
     if ($ajax) {
         $form->setAction(OW::getRouter()->urlFor('BASE_MCTRL_User', 'signIn'));
         $form->setAjax();
         $form->bindJsFunction(Form::BIND_SUCCESS, 'function(data){if( data.result ){OWM.info(data.message);setTimeout(function(){window.location.reload();}, 1000);}else{OWM.error(data.message);}}');
     }
     $this->addForm($form);
 }
Ejemplo n.º 17
0
 public function __construct($userId, $limit, $exclude)
 {
     parent::__construct();
     $this->photoAlbumService = PHOTO_BOL_PhotoAlbumService::getInstance();
     $user = BOL_UserService::getInstance()->findUserById($userId);
     $this->assign('username', $user->getUsername());
     $albums = $this->photoAlbumService->findUserAlbumList($user->id, 1, $limit, $exclude, true);
     $this->assign('albums', $albums);
     foreach ($albums as $album) {
         array_push($exclude, $album['dto']->id);
     }
     $loadMore = $this->photoAlbumService->countUserAlbums($userId, $exclude);
     if (!$loadMore) {
         $script = "OWM.trigger('photo.hide_load_more', {});";
         OW::getDocument()->addOnloadScript($script);
     }
 }
Ejemplo n.º 18
0
 /**
  * Constructor.
  */
 public function __construct($limit, $exclude = null)
 {
     parent::__construct();
     $service = NOTIFICATIONS_BOL_Service::getInstance();
     $userId = OW::getUser()->getId();
     $notifications = $service->findNotificationList($userId, time(), $exclude, $limit);
     $items = self::prepareData($notifications);
     $this->assign('items', $items);
     $notificationIdList = array();
     foreach ($items as $id => $item) {
         $notificationIdList[] = $id;
     }
     // Mark as viewed
     $service->markNotificationsViewedByUserId($userId);
     $exclude = is_array($exclude) ? array_merge($exclude, $notificationIdList) : $notificationIdList;
     $loadMore = (bool) $service->findNotificationCount($userId, null, $exclude);
     if (!$loadMore) {
         $script = "OWM.trigger('mobile.console_hide_notifications_load_more', {});";
         OW::getDocument()->addOnloadScript($script);
     }
 }
Ejemplo n.º 19
0
 /**
  * Constructor.
  */
 public function __construct($limit, $exclude = null)
 {
     parent::__construct();
     $service = FRIENDS_BOL_Service::getInstance();
     $userId = OW::getUser()->getId();
     $requests = $service->findRequestList($userId, time(), 0, $limit, $exclude);
     $items = self::prepareData($requests);
     $this->assign('items', $items);
     // Mark as viewed
     $service->markAllViewedByUserId($userId);
     $requestIdList = array();
     foreach ($requests as $id => $request) {
         $requestIdList[] = $id;
     }
     $exclude = is_array($exclude) ? array_merge($exclude, $requestIdList) : $requestIdList;
     $loadMore = (bool) $service->count(null, $userId, FRIENDS_BOL_Service::STATUS_PENDING, null, null, $exclude);
     if (!$loadMore) {
         $script = "OWM.trigger('mobile.console_hide_friends_load_more', {});";
         OW::getDocument()->addOnloadScript($script);
     }
 }
Ejemplo n.º 20
0
 public function __construct(BOL_User $user, $length = null)
 {
     parent::__construct();
     $this->user = $user;
     $this->length = $length;
 }
Ejemplo n.º 21
0
 public function __construct(BOL_User $user)
 {
     parent::__construct();
     $this->user = $user;
 }
Ejemplo n.º 22
0
 public function __construct($message)
 {
     parent::__construct();
     $this->assign('message', $message);
 }
Ejemplo n.º 23
0
 public function __construct($items)
 {
     parent::__construct();
     $this->assign('items', $items);
     OW::getDocument()->addOnloadScript('OWM.initWidgetMenu(' . json_encode($items) . ')');
 }
Ejemplo n.º 24
0
 public function __construct(BOL_User $user, $previewMode = false)
 {
     parent::__construct();
     $this->user = $user;
     $this->previewMode = $previewMode;
 }