public function __construct($list, $offset, $count)
 {
     parent::__construct();
     $this->assign('list', $list);
     $this->assign('count', $count);
     $this->assign('loadMore', $count - $offset > BOL_AvatarService::AVATAR_CHANGE_GALLERY_LIMIT);
 }
 public function __construct($params = array())
 {
     parent::__construct();
     $service = BOL_BillingService::getInstance();
     $gateway = $service->findGatewayByKey($params['gateway']);
     if (!$gateway || $gateway->dynamic) {
         $this->setVisible(false);
         return;
     }
     $event = new BASE_CLASS_EventCollector('base.billing_add_gateway_product');
     OW::getEventManager()->trigger($event);
     $data = $event->getData();
     $eventProducts = array();
     if ($data) {
         foreach ($data as $plugin) {
             foreach ($plugin as $product) {
                 $id = $service->addGatewayProduct($gateway->id, $product['pluginKey'], $product['entityType'], $product['entityId']);
                 $product['id'] = $id;
                 $eventProducts[] = $product;
             }
         }
     }
     $products = $service->findGatewayProductList($gateway->id);
     foreach ($eventProducts as &$prod) {
         $prod['productId'] = !empty($products[$prod['id']]) ? $products[$prod['id']]['dto']->productId : null;
         $prod['plugin'] = !empty($products[$prod['id']]) ? $products[$prod['id']]['plugin'] : null;
     }
     $this->assign('products', $eventProducts);
     $this->assign('actionUrl', OW::getRouter()->urlFor('BASE_CTRL_Billing', 'saveGatewayProduct'));
     $this->assign('backUrl', urlencode(OW::getRouter()->getBaseUrl() . OW::getRouter()->getUri()));
 }
Example #3
0
 public function __construct($layout, $params)
 {
     parent::__construct();
     if (empty($params['available'])) {
         if (!empty($params['msg'])) {
             $msg = $params['msg'];
         } else {
             $msg = OW::getLanguage()->text('base', 'authorization_failed_feedback');
         }
         $this->assign('authError', $msg);
         return;
     }
     switch ($layout) {
         case 'page':
             $class = ' ow_photoview_info_onpage';
             break;
         default:
             if ((bool) OW::getConfig()->getValue('photo', 'photo_view_classic')) {
                 $class = ' ow_photoview_pint_mode';
             } else {
                 $class = '';
             }
             break;
     }
     $this->assign('class', $class);
     $this->assign('layout', $layout);
 }
Example #4
0
 /**
  * Constructor.
  *
  * @param BASE_CommentsParams $params
  */
 public function __construct(BASE_CommentsParams $params)
 {
     parent::__construct();
     $this->params = $params;
     $this->batchData = $params->getBatchData();
     $this->staticData = empty($this->batchData['_static']) ? array() : $this->batchData['_static'];
     $this->batchData = isset($this->batchData[$params->getEntityType()][$params->getEntityId()]) ? $this->batchData[$params->getEntityType()][$params->getEntityId()] : array();
     srand(time());
     $this->id = $params->getEntityType() . $params->getEntityId() . rand(1, 10000);
     $this->cmpContextId = "comments-{$this->id}";
     $this->assign('cmpContext', $this->cmpContextId);
     $this->assign('wrapInBox', $params->getWrapInBox());
     $this->assign('topList', in_array($params->getDisplayType(), array(BASE_CommentsParams::DISPLAY_TYPE_WITH_LOAD_LIST, BASE_CommentsParams::DISPLAY_TYPE_WITH_LOAD_LIST_MINI)));
     $this->assign('bottomList', $params->getDisplayType() == BASE_CommentsParams::DISPLAY_TYPE_WITH_PAGING);
     $this->assign('mini', $params->getDisplayType() == BASE_CommentsParams::DISPLAY_TYPE_WITH_LOAD_LIST_MINI);
     $this->isAuthorized = OW::getUser()->isAuthorized($params->getPluginKey(), 'add_comment') && $params->getAddComment();
     if (!$this->isAuthorized) {
         $errorMessage = $params->getErrorMessage();
         if (empty($errorMessage)) {
             $status = BOL_AuthorizationService::getInstance()->getActionStatus($params->getPluginKey(), 'add_comment');
             $errorMessage = OW::getUser()->isAuthenticated() ? $status['msg'] : OW::getLanguage()->text('base', 'comments_add_login_message');
         }
         $this->assign('authErrorMessage', $errorMessage);
     }
     $this->initForm();
 }
Example #5
0
 public function __construct($userId)
 {
     parent::__construct();
     $this->userId = $userId;
     $this->uniqId = uniqid("hint-");
     $this->cover = $this->getCover();
 }
Example #6
0
 /**
  * Constructor.
  */
 public function __construct($ajax = false)
 {
     parent::__construct();
     $form = new Form('sign-in');
     $form->setAction("");
     $username = new TextField('identity');
     $username->setRequired(true);
     $username->setHasInvitation(true);
     $username->setInvitation(OW::getLanguage()->text('base', 'component_sign_in_login_invitation'));
     $form->addElement($username);
     $password = new PasswordField('password');
     $password->setHasInvitation(true);
     $password->setInvitation('password');
     $password->setRequired(true);
     $form->addElement($password);
     $remeberMe = new CheckboxField('remember');
     $remeberMe->setValue(true);
     $remeberMe->setLabel(OW::getLanguage()->text('base', 'sign_in_remember_me_label'));
     $form->addElement($remeberMe);
     $submit = new Submit('submit');
     $submit->setValue(OW::getLanguage()->text('base', 'sign_in_submit_label'));
     $form->addElement($submit);
     $this->addForm($form);
     if ($ajax) {
         $form->setAjaxResetOnSuccess(false);
         $form->setAjax();
         $form->setAction(OW::getRouter()->urlFor('BASE_CTRL_User', 'ajaxSignIn'));
         $form->bindJsFunction(Form::BIND_SUCCESS, 'function(data){if( data.result ){if(data.message){OW.info(data.message);}setTimeout(function(){window.location.reload();}, 1000);}else{OW.error(data.message);}}');
         $this->assign('forgot_url', OW::getRouter()->urlForRoute('base_forgot_password'));
     }
     $this->assign('joinUrl', OW::getRouter()->urlForRoute('base_join'));
 }
Example #7
0
 public function __construct(array $aParams)
 {
     parent::__construct();
     //print_r($aParams); exit;
     foreach ($aParams['items'] as $k => $v) {
         $aParams['items'][$k]['media_parent'] = isset($aParams['items'][$k]['media_parent']) ? $aParams['items'][$k]['media_parent'] : '';
         $aParams['items'][$k]['title_decode'] = urldecode($aParams['items'][$k]['title']);
         $aParams['items'][$k]['update_page_param'] = http_build_query(array('service' => $aParams['items'][$k]['provider'], 'media' => 'photo', 'media_parent' => $aParams['items'][$k]['media_parent'], 'extra' => 'aid', 'aid' => $aParams['items'][$k]['aid']));
         //$aParams['items'][$k]['brief_title'] = substr($aParams['items'][$k]['title_decode'], 0, 20);
         $aParams['items'][$k]['status_text'] = OW::getLanguage()->text("ynmediaimporter", 'import_status_' . $aParams['items'][$k]['status']);
         $aParams['items'][$k]['json'] = json_encode($aParams['items'][$k]);
     }
     //print_r($aParams); exit;
     if (isset($aParams['items'])) {
         $this->assign('items', $aParams['items']);
     }
     if (isset($aParams['params'])) {
         $this->assign('params', $aParams['params']);
         $this->assign('params_json', json_encode($aParams['params']));
     }
     if (isset($aParams['item_count'])) {
         $this->assign('item_count', $aParams['item_count']);
     }
     if (isset($aParams['userId'])) {
         $this->assign('userId', $aParams['userId']);
     }
 }
Example #8
0
 public function __construct($userId, $options)
 {
     parent::__construct();
     $this->userId = $userId;
     $this->uniqId = uniqid("uhg-");
     $this->options = $options;
 }
Example #9
0
 public function __construct($userId, $tabKey)
 {
     parent::__construct();
     $this->bridge = UHEADER_CLASS_PhotoBridge::getInstance();
     $this->userId = $userId;
     $this->tabKey = $tabKey;
 }
Example #10
0
 public function __construct($userId)
 {
     parent::__construct();
     $data = OW::getEventManager()->call("photo.entity_albums_find", array("entityType" => "user", "entityId" => $userId));
     $albums = empty($data["albums"]) ? array() : $data["albums"];
     $source = BOL_PreferenceService::getInstance()->getPreferenceValue("pcgallery_source", $userId);
     $this->assign("source", $source == "album" ? "album" : "all");
     $selectedAlbum = BOL_PreferenceService::getInstance()->getPreferenceValue("pcgallery_album", $userId);
     $form = new Form("pcGallerySettings");
     $form->setEmptyElementsErrorMessage(null);
     $form->setAction(OW::getRouter()->urlFor("PCGALLERY_CTRL_Gallery", "saveSettings"));
     $element = new HiddenField("userId");
     $element->setValue($userId);
     $form->addElement($element);
     $element = new Selectbox("album");
     $element->setHasInvitation(true);
     $element->setInvitation(OW::getLanguage()->text("pcgallery", "settings_album_invitation"));
     $validator = new PCGALLERY_AlbumValidator();
     $element->addValidator($validator);
     $albumsPhotoCount = array();
     foreach ($albums as $album) {
         $element->addOption($album["id"], $album["name"] . " ({$album["photoCount"]})");
         $albumsPhotoCount[$album["id"]] = $album["photoCount"];
         if ($album["id"] == $selectedAlbum) {
             $element->setValue($album["id"]);
         }
     }
     OW::getDocument()->addOnloadScript(UTIL_JsGenerator::composeJsString('window.pcgallery_settingsAlbumCounts = {$albumsCount};', array("albumsCount" => $albumsPhotoCount)));
     $element->setLabel(OW::getLanguage()->text("pcgallery", "source_album_label"));
     $form->addElement($element);
     $submit = new Submit("save");
     $submit->setValue(OW::getLanguage()->text("pcgallery", "save_settings_btn_label"));
     $form->addElement($submit);
     $this->addForm($form);
 }
Example #11
0
 /**
  * User list
  * 
  * @param array $params
  *      integer count
  *      string boxType
  */
 function __construct(array $params = array())
 {
     parent::__construct();
     $this->countUsers = !empty($params['count']) ? (int) $params['count'] : self::DEFAULT_USERS_COUNT;
     $boxType = !empty($params['boxType']) ? $params['boxType'] : "";
     // init users short list
     $randId = UTIL_HtmlTag::generateAutoId('base_users_cmp');
     $data = $this->getData($this->countUsers);
     $menuItems = array();
     $dataToAssign = array();
     foreach ($data as $key => $item) {
         $contId = "{$randId}_users_cmp_{$key}";
         $toolbarId = !empty($item['toolbar']) ? "{$randId}_toolbar_{$key}" : false;
         $menuItems[$key] = array('label' => $item['menu-label'], 'id' => "{$randId}_users_cmp_menu_{$key}", 'contId' => $contId, 'active' => !empty($item['menu_active']), 'toolbarId' => $toolbarId, 'display' => 1);
         $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);
     }
     $menu = $this->getMenuCmp($menuItems);
     if (!empty($menu)) {
         $this->addComponent('menu', $menu);
     }
     // assign view variables
     $this->assign('widgetId', $randId);
     $this->assign('data', $dataToAssign);
     $this->assign('boxType', $boxType);
 }
Example #12
0
 public function __construct($layout)
 {
     parent::__construct();
     $status = BOL_AuthorizationService::getInstance()->getActionStatus('photo', 'view');
     if ($status['status'] == BOL_AuthorizationService::STATUS_DISABLED) {
         $this->assign('authError', $status['msg']);
         return;
     }
     $class = "";
     switch ($layout) {
         case 'page':
             $class = ' ow_photoview_info_onpage';
             break;
         default:
             if ((bool) OW::getConfig()->getValue('photo', 'photo_view_classic')) {
                 $class = ' ow_photoview_pint_mode';
             } else {
                 $class = '';
             }
             break;
     }
     $this->assign('class ', $class);
     $this->assign('layout ', $layout);
     $document = OW::getDocument();
     $js = "\$('#btn-save-as-avatar').off().on('click', function() {\n        console.log('photo floatbox call js');\n        var photoId = \$('#btn-photo-edit') . attr('rel');\n\n        document.avatarFloatBox = OW.ajaxFloatBox(\n        'BASE_CMP_AvatarChange', {\n            params: {\n                step: 2, entityType: 'photo_album', entityId: '', id: photoId\n            }}, {\n                width: 749, title: OW.getLanguageText('base', 'avatar_change')}\n                );\n            })";
     $document->addOnloadScript($js);
 }
Example #13
0
 public function __construct($affiliateId)
 {
     parent::__construct();
     $service = OCSAFFILIATES_BOL_Service::getInstance();
     $affiliate = $service->findAffiliateById($affiliateId);
     if (!$affiliate) {
         $this->setVisible(false);
         return;
     }
     $billingService = BOL_BillingService::getInstance();
     $this->assign('currency', $billingService->getActiveCurrency());
     $clicksCount = $service->countClicksForAffiliate($affiliateId);
     $this->assign('clicksCount', $clicksCount);
     $signupCount = $service->countRegistrationsForAffiliate($affiliateId);
     $this->assign('signupCount', $signupCount);
     $salesCount = $service->countSalesForAffiliate($affiliateId);
     $this->assign('salesCount', $salesCount);
     $clicksSum = $service->getClicksSumForAffiliate($affiliateId);
     $this->assign('clicksSum', $clicksSum);
     $signupSum = $service->getRegistrationsSumForAffiliate($affiliateId);
     $this->assign('signupSum', $signupSum);
     $salesSum = $service->getSalesSumForAffiliate($affiliateId);
     $this->assign('salesSum', $salesSum);
     $earnings = $clicksSum + $signupSum + $salesSum;
     $this->assign('earnings', $earnings);
     $payouts = $service->getPayoutSum($affiliateId);
     $this->assign('payouts', $payouts);
     $balance = $earnings - $payouts;
     $this->assign('balance', $balance);
     $this->assign('affiliate', $affiliate);
 }
Example #14
0
 public function __construct($params = array())
 {
     parent::__construct();
     $plugin = OW::getPluginManager()->getPlugin('base');
     $document = OW::getDocument();
     $document->addStyleSheet($plugin->getStaticCssUrl() . 'file_upload.css');
 }
Example #15
0
    /**
     * Constructor.
     */
    public function __construct($params = array())
    {
        parent::__construct();
        $userId = (int) $params['userId'];
        $showMessage = (bool) $params['showMessage'];
        $rspUrl = OW::getRouter()->urlFor('BASE_CTRL_User', 'deleteUser', array('user-id' => $userId));
        $rspUrl = OW::getRequest()->buildUrlQueryString($rspUrl, array('showMessage' => (int) $showMessage));
        $js = UTIL_JsGenerator::composeJsString('$("#baseDCButton").click(function()
        {
            var button = this;

            OW.inProgressNode(button);

            $.getJSON({$rsp}, function(r)
            {
                OW.activateNode(button);

                if ( _scope.floatBox )
                {
                    _scope.floatBox.close();
                }

                if ( _scope.deleteCallback )
                {
                    _scope.deleteCallback(r);
                }
            });
        });', array('rsp' => $rspUrl));
        OW::getDocument()->addOnloadScript($js);
    }
Example #16
0
 /**
  * Class constructor
  */
 public function __construct($typeId)
 {
     parent::__construct();
     if (!OW::getUser()->isAdmin()) {
         $this->setVisible(false);
         return;
     }
     $service = MEMBERSHIP_BOL_MembershipService::getInstance();
     $type = $service->findTypeById($typeId);
     if (!$type) {
         $this->setVisible(false);
         return;
     }
     $types = $service->getTypeList($type->accountTypeId);
     $availableTypes = array();
     if ($types) {
         foreach ($types as $mType) {
             if ($mType->id == $typeId) {
                 continue;
             }
             $availableTypes[$mType->id] = $service->getMembershipTitle($mType->roleId);
         }
     }
     $this->assign('availableTypes', $availableTypes);
     $form = new MEMBERSHIP_CLASS_DeleteMembershipForm();
     $this->addForm($form);
     $form->getElement('typeId')->setValue($typeId);
     if ($availableTypes) {
         $form->getElement('newTypeId')->addOptions($availableTypes);
     }
 }
Example #17
0
 public function __construct(EQUESTIONS_AttachmentWidgetDelegate $delegate, $label, $iconClass = null)
 {
     parent::__construct();
     $this->uniqId = uniqid('attachmentWidget');
     $this->label = $label;
     $this->iconClass = $iconClass;
 }
Example #18
0
 public function __construct($items, $title = '')
 {
     parent::__construct();
     $this->items = $items;
     $this->assign('items', $items);
     $this->assign('title', $title);
 }
Example #19
0
 public function __construct()
 {
     parent::__construct();
     $this->service = BOL_ComponentAdminService::getInstance();
     $this->fetchFromCache();
     OW_ViewRenderer::getInstance()->registerFunction('sb_component', array($this, 'tplComponent'));
 }
Example #20
0
 public function __construct($entityType, $entityId, $likes = null)
 {
     parent::__construct();
     if ($likes === null) {
         $likes = NEWSFEED_BOL_Service::getInstance()->findEntityLikes($entityType, $entityId);
     }
     $this->count = count($likes);
     if ($this->count == 0) {
         $this->setVisible(false);
         return;
     }
     $userIds = array();
     foreach ($likes as $like) {
         $userIds[] = (int) $like->userId;
     }
     if ($this->count <= 3) {
         $displayNames = BOL_UserService::getInstance()->getDisplayNamesForList($userIds);
         $urls = BOL_UserService::getInstance()->getUserUrlsForList($userIds);
         $langVars = array();
         foreach ($userIds as $i => $userId) {
             $langVars['user' . ($i + 1)] = '<a href="' . $urls[$userId] . '">' . $displayNames[$userId] . '</a>';
         }
         $string = OW::getLanguage()->text('newsfeed', 'feed_likes_' . $this->count . '_label', $langVars);
     } else {
         $url = "javascript: OW.showUsers(" . json_encode($userIds) . ")";
         $string = OW::getLanguage()->text('newsfeed', 'feed_likes_list_label', array('count' => $this->count, 'url' => $url));
     }
     $this->assign('string', $string);
 }
 public function __construct($feedAutoId, $feedType, $feedId, $actionVisibility = null)
 {
     parent::__construct();
     $form = $this->createForm($feedAutoId, $feedType, $feedId, $actionVisibility);
     $this->addForm($form);
     $this->initAttachments($feedAutoId, $form);
 }
Example #22
0
    public function __construct($feedAutoId, $feedType, $feedId, $actionVisibility = null)
    {
        parent::__construct();
        $form = new NEWSFEED_StatusForm($feedAutoId, $feedType, $feedId, $actionVisibility);
        $this->addForm($form);
        $uniqId = uniqid('statusUpdate');
        $attachmentId = $this->initAttachments();
        $attachmentInputId = $form->getElement('attachment')->getId();
        $inputId = $form->getElement('status')->getId();
        $this->assign('uniqId', $uniqId);
        $js = UTIL_JsGenerator::newInstance()->newObject(array('ATTP.CORE.ObjectRegistry', $uniqId), 'ATTP.AttachmentsControl', array($uniqId, array('attachmentId' => $attachmentId, 'attachmentInputId' => $attachmentInputId, 'inputId' => $inputId, 'formName' => $form->getName())));
        ATTACHMENTS_Plugin::getInstance()->addJs($js);
        $js = 'owForms[{$form}].bind("success", function(data){
                    if ( !data || data.error )
                    {
                        return;
                    }

                    if ( ATTP.CORE.ObjectRegistry[{$attachId}] )
                    {
                        ATTP.CORE.ObjectRegistry[{$attachId}].reset();
                    }
                });
                owForms[{$form}].reset = false;';
        $js = UTIL_JsGenerator::composeJsString($js, array('form' => $form->getName(), 'attachId' => $attachmentId));
        OW::getDocument()->addOnloadScript($js);
    }
Example #23
0
 /**
  * @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);
 }
Example #24
0
 public function __construct($providerName)
 {
     parent::__construct();
     $providerConfigForm = new YNSOCIALCONNECT_CLASS_ConfigFieldsForm($providerName);
     $this->addForm($providerConfigForm);
     $service = YNSOCIALCONNECT_BOL_ServicesService::getInstance();
     $provider = $service->getProvider($providerName);
     $this->assign('provider', $provider->getTitle());
     $questionDtoList = $service->getOWQuestionDtoList($providerName);
     $questionList = array();
     foreach ($questionDtoList as $dto) {
         $questionList[$dto->sectionName][(int) $dto->sortOrder] = array('name' => $dto->name, 'el_name' => 'alias[' . $dto->name . ']');
     }
     $questionSectionDtoList = BOL_QuestionService::getInstance()->findAllSections();
     $tplQuestionList = array();
     foreach ($questionSectionDtoList as $sectionDto) {
         if (empty($questionList[$sectionDto->name])) {
             continue;
         }
         /* @var $sectionDto BOL_QuestionSection */
         $tplQuestionList[(int) $sectionDto->sortOrder] = array('name' => $sectionDto->name, 'items' => $questionList[$sectionDto->name]);
     }
     ksort($tplQuestionList);
     $this->assign('questionList', $tplQuestionList);
 }
Example #25
0
 public function __construct()
 {
     parent::__construct();
     $this->uniqId = uniqid('attachmentPanel');
     $plugin = OW::getPluginManager()->getPlugin('equestions');
     $this->setTemplate($plugin->getCmpViewDir() . 'attachment_panel.html');
 }
Example #26
0
 public function __construct($groupId)
 {
     parent::__construct();
     $cover = GHEADER_BOL_Service::getInstance()->findCoverByGroupId($groupId);
     if (empty($cover)) {
         $this->assign('error', OW::getLanguage()->text('gheader', 'cover_not_found'));
         return;
     }
     $group = GROUPS_BOL_Service::getInstance()->findGroupById($cover->groupId);
     $src = GHEADER_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;
     }
     $this->assign('src', $src);
     $this->assign('top', $top);
     $this->assign('dimensions', $settings['dimensions']);
     $userId = OW::getUser()->getId();
     $cmtParams = new BASE_CommentsParams('gheader', GHEADER_CLASS_CommentsBridge::ENTITY_TYPE);
     $cmtParams->setEntityId($cover->id);
     $cmtParams->setAddComment(GHEADER_BOL_Service::getInstance()->isUserCanInteract($userId, $group->id));
     $cmtParams->setOwnerId($group->userId);
     $cmtParams->setDisplayType(BASE_CommentsParams::DISPLAY_TYPE_TOP_FORM_WITH_PAGING);
     $photoCmts = new BASE_CMP_Comments($cmtParams);
     $this->addComponent('comments', $photoCmts);
 }
Example #27
0
 public function __construct($oembed)
 {
     parent::__construct();
     $this->uniqId = uniqid('eqattachment');
     $this->assign('uniqId', $this->uniqId);
     $this->oembed = $oembed;
 }
Example #28
0
 public function __construct($userId, $idList)
 {
     parent::__construct();
     if (!empty($userId) && !empty($idList)) {
         $this->user = BOL_UserService::getInstance()->findUserById($userId);
         $userService = BOL_UserService::getInstance();
         $avatars = BOL_AvatarService::getInstance()->getAvatarsUrlList($idList, 2);
         $sexValue = array();
         $list = array();
         foreach (BOL_QuestionValueDao::getInstance()->findQuestionValues('sex') as $sexDto) {
             $sexValue[$sexDto->value] = BOL_QuestionService::getInstance()->getQuestionValueLang('sex', $sexDto->value);
         }
         $userData = BOL_QuestionService::getInstance()->getQuestionData($idList, array('sex', 'birthdate', 'googlemap_location'));
         foreach ($idList as $userId) {
             $list[$userId]['userUrl'] = $userService->getUserUrl($userId);
             $list[$userId]['displayName'] = $userService->getDisplayName($userId);
             $list[$userId]['avatarUrl'] = $avatars[$userId];
             $list[$userId]['activity'] = UTIL_DateTime::formatDate(BOL_UserService::getInstance()->findUserById($userId)->getActivityStamp());
             if (!empty($userData[$userId]['birthdate'])) {
                 $date = UTIL_DateTime::parseDate($userData[$userId]['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
                 $list[$userId]['age'] = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
             }
             if (!empty($userData[$userId]['sex'])) {
                 $list[$userId]['sex'] = $sexValue[$userData[$userId]['sex']];
             }
             if (!empty($userData[$userId]['googlemap_location'])) {
                 $list[$userId]['googlemap_location'] = $userData[$userId]['googlemap_location']['address'];
             }
         }
         $this->assign('userName', BOL_UserService::getInstance()->getDisplayName($this->user->id));
         $this->assign('list', $list);
     } else {
         $this->setVisible(FALSE);
     }
 }
Example #29
0
 /**
  * Constructor.
  *
  * @param array<count,label> $tagList
  *
  */
 public function __construct(array $tagList = null, $url = null)
 {
     parent::__construct();
     $this->tagList = $tagList;
     $this->url = $url;
     $this->service = BOL_TagService::getInstance();
 }
Example #30
0
 public function __construct($affiliateId)
 {
     parent::__construct();
     $form = new OCSAFFILIATES_CLASS_AssignUserForm('assign_user');
     $form->getElement('affiliateId')->setValue($affiliateId);
     $this->addForm($form);
 }