Пример #1
0
 public function onCollectTypes(BASE_CLASS_EventCollector $event)
 {
     $mandatoryApprove = OW::getConfig()->getValue('base', 'mandatory_user_approve');
     $event->add(array("pluginKey" => "base", "authorizationGroup" => "base", "group" => "profiles", "entityType" => self::ENTITY_TYPE_PROFILE, "groupLabel" => OW::getLanguage()->text("base", "content_profiles_label"), "entityLabel" => OW::getLanguage()->text("base", "content_profile_label"), "displayFormat" => "empty", "moderation" => $mandatoryApprove ? array(BOL_ContentService::MODERATION_TOOL_FLAG, BOL_ContentService::MODERATION_TOOL_APPROVE) : array(BOL_ContentService::MODERATION_TOOL_FLAG)));
     $event->add(array("pluginKey" => "base", "authorizationGroup" => "base", "group" => "comments", "entityType" => self::ENTITY_TYPE_COMMENT, "groupLabel" => OW::getLanguage()->text("base", "content_comments_label"), "entityLabel" => OW::getLanguage()->text("base", "content_comment_label"), "moderation" => array(BOL_ContentService::MODERATION_TOOL_FLAG)));
     $event->add(array("pluginKey" => "base", "authorizationGroup" => "base", "group" => "avatars", "entityType" => self::ENTITY_TYPE_AVATAR, "groupLabel" => OW::getLanguage()->text("base", "content_avatars_label"), "entityLabel" => OW::getLanguage()->text("base", "content_avatar_label")));
 }
 public function collectSnippets(BASE_CLASS_EventCollector $event)
 {
     $language = OW::getLanguage();
     $params = $event->getParams();
     if ($params["entityType"] != SNIPPETS_CLASS_EventHandler::ENTITY_TYPE_USER) {
         return;
     }
     $userId = $params["entityId"];
     $preview = $params["preview"];
     $snippet = new SNIPPETS_CMP_Snippet(self::WIDGET_NAME, $userId);
     if ($preview) {
         $snippet->setLabel($language->text("snippets", "snippet_virtual_gifts_preview"));
         $snippet->setIconClass("ow_ic_birthday");
         $event->add($snippet);
         return;
     }
     $service = VIRTUALGIFTS_BOL_VirtualGiftsService::getInstance();
     $total = $service->countUserReceivedGifts($userId);
     $list = $service->findUserReceivedGifts($userId, 1, 4);
     if (empty($list)) {
         return;
     }
     $images = array();
     foreach ($list as $gift) {
         $images[] = $gift["imageUrl"];
     }
     $dispslayType = count($images) > 1 ? SNIPPETS_CMP_Snippet::DISPLAY_TYPE_4 : SNIPPETS_CMP_Snippet::DISPLAY_TYPE_1;
     $url = OW::getRouter()->urlForRoute('virtual_gifts_user_list', array("userName" => BOL_UserService::getInstance()->getUserName($userId)));
     $snippet->setImages($images);
     $snippet->setLabel($language->text("snippets", "snippet_virtual_gifts", array("count" => '<span class="ow_txt_value">' . $total . '</span>')));
     $snippet->setUrl($url);
     $snippet->setDisplayType($dispslayType);
     $event->add($snippet);
 }
Пример #3
0
function payeer_add_admin_notification(BASE_CLASS_EventCollector $coll)
{
    $billingService = BOL_BillingService::getInstance();
    if (!mb_strlen($billingService->getGatewayConfigValue(BILLINGPAYEER_CLASS_PayeerAdapter::GATEWAY_KEY, 'm_key')) && !mb_strlen($billingService->getGatewayConfigValue(BILLINGPAYEER_CLASS_PayeerAdapter::GATEWAY_KEY, 'm_shop'))) {
        $coll->add(OW::getLanguage()->text('billingpayeer', 'plugin_configuration_notice', array('url' => OW::getRouter()->urlForRoute('billing_payeer_admin'))));
    }
}
Пример #4
0
function ganalytics_admin_notification(BASE_CLASS_EventCollector $event)
{
    $wpid = OW::getConfig()->getValue('ganalytics', 'web_property_id');
    if (empty($wpid)) {
        $event->add(OW::getLanguage()->text('ganalytics', 'admin_notification_text', array('link' => OW::getRouter()->urlForRoute('ganalytics_admin'))));
    }
}
Пример #5
0
function ynmediaimporter_addAdminNotification(BASE_CLASS_EventCollector $e)
{
    $language = OW::getLanguage();
    if (OW::getPluginManager()->isPluginActive('ynsocialbridge') == false) {
        $e->add($language->text('ynmediaimporter', 'requires_configuration_message'));
    }
}
Пример #6
0
function contactus_handler_after_install(BASE_CLASS_EventCollector $event)
{
    if (count(CONTACTUS_BOL_Service::getInstance()->getDepartmentList()) < 1) {
        $url = OW::getRouter()->urlForRoute('contactus.admin');
        $event->add(OW::getLanguage()->text('contactus', 'after_install_notification', array('url' => $url)));
    }
}
Пример #7
0
 public function getNewItems(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     if ($params['page'] == self::CONSOLE_PAGE_KEY) {
         $event->add(array(self::CONSOLE_SECTION_KEY => new FRIENDS_MCMP_ConsoleNewItems($params['timestamp'])));
     }
 }
Пример #8
0
 public function getNewInvitations(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     if ($params['page'] == self::CONSOLE_NOTIFICATIONS_PAGE_KEY) {
         $event->add(array(self::CONSOLE_INVITATIONS_SECTION_KEY => new BASE_MCMP_ConsoleNewInvitations($params['timestamp'])));
     }
 }
Пример #9
0
 public function onCollectInfoConfigs(BASE_CLASS_EventCollector $event)
 {
     $language = OW::getLanguage();
     $event->add(array("key" => "base-gender-age", "label" => $language->text("uheader", "info-gender-age-label")));
     $event->add(array("key" => "base-about", "label" => $language->text("uheader", "info-about-label")));
     $event->add(array("key" => "base-question", "label" => $language->text("uheader", "info-question-label")));
 }
Пример #10
0
function hotlist_usercredits_active(BASE_CLASS_EventCollector $event)
{
    if (!OW::getPluginManager()->isPluginActive('usercredits')) {
        $language = OW::getLanguage();
        $event->add($language->text('hotlist', 'error_usercredits_not_installed'));
    }
}
Пример #11
0
 public function onCollectButtonList(BASE_CLASS_EventCollector $event)
 {
     $cssUrl = OW::getPluginManager()->getPlugin('FBCONNECT')->getStaticCssUrl() . 'fbconnect.css';
     OW::getDocument()->addStyleSheet($cssUrl);
     $button = new FBCONNECT_MCMP_ConnectButton();
     $event->add(array('iconClass' => 'owm_ico_signin_f', 'markup' => $button->render()));
 }
Пример #12
0
 public function onCollectVirtualGiftsAuthLabels(BASE_CLASS_EventCollector $event)
 {
     if (!OW::getPluginManager()->isPluginActive("virtualgifts")) {
         return;
     }
     $language = OW::getLanguage();
     $event->add(array('virtualgifts' => array('label' => $language->text('virtualgifts', 'auth_group_label'), 'actions' => array('send_gift' => $language->text('virtualgifts', 'auth_action_label_send_gift')))));
 }
Пример #13
0
function socialsharing_add_admin_notification(BASE_CLASS_EventCollector $coll)
{
    $config = OW::getConfig();
    if ($config->getValue('socialsharing', 'api_key')) {
        return;
    }
    $coll->add(OW::getLanguage()->text('socialsharing', 'plugin_installation_notice', array('url' => OW::getRouter()->urlForRoute('socialsharing.admin'))));
}
Пример #14
0
 public function triggerCreditActionsAdd()
 {
     $e = new BASE_CLASS_EventCollector('usercredits.action_add');
     foreach ($this->actions as $action) {
         $e->add($action);
     }
     OW::getEventManager()->trigger($e);
 }
Пример #15
0
 public function onCollectAdminNotification(BASE_CLASS_EventCollector $e)
 {
     $language = OW::getLanguage();
     $configs = OW::getConfig()->getValues('fbconnect');
     if (empty($configs['app_id']) || empty($configs['api_secret'])) {
         $e->add($language->text('fbconnect', 'admin_configuration_required_notification', array('href' => OW::getRouter()->urlForRoute('fbconnect_configuration'))));
     }
 }
Пример #16
0
 public function onCollectList(BASE_CLASS_EventCollector $event)
 {
     $language = OW::getLanguage();
     $action = array('key' => self::ACTION_VIEW_TAGS, 'pluginKey' => $this->plugin->getKey(), 'label' => $language->text($this->plugin->getKey(), 'privacy_action_view_tags'), 'description' => '', 'defaultValue' => 'everybody');
     $event->add($action);
     $action = array('key' => self::ACTION_TAG_MY_PHOTO, 'pluginKey' => $this->plugin->getKey(), 'label' => $language->text($this->plugin->getKey(), 'privacy_action_tag_my_photo'), 'description' => '', 'defaultValue' => 'everybody');
     $event->add($action);
 }
Пример #17
0
 public function trackVisit(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     if (empty($params['userId'])) {
         return;
     }
     $userId = (int) $params['userId'];
     $viewerId = OW::getUser()->getId();
     SKAPI_BOL_Service::getInstance()->trackVisit($userId, $viewerId);
 }
Пример #18
0
function hint_add_admin_notification(BASE_CLASS_EventCollector $e)
{
    if (HINT_BOL_Service::getInstance()->getConfig("admin_notified")) {
        return;
    }
    $pluginTitle = OW::getPluginManager()->getPlugin("hint")->getDto()->title;
    $pluginUrl = OW::getRouter()->urlForRoute('hint-configuration');
    $pluginEmbed = '<a href="' . $pluginUrl . '">' . $pluginTitle . '</a>';
    $language = OW::getLanguage();
    $e->add($language->text('hint', 'admin_notification', array('plugin' => $pluginEmbed, "settingsUrl" => $pluginUrl)));
}
Пример #19
0
 public function onCollectButtonsConfig(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     if ($params["entityType"] != HINT_BOL_Service::ENTITY_TYPE_USER) {
         return;
     }
     $label = OW::getLanguage()->text("virtualgifts", "profile_toolbar_item_send_gift");
     $active = HINT_BOL_Service::getInstance()->isActionActive(HINT_BOL_Service::ENTITY_TYPE_USER, "virtualgift");
     $button = array("key" => "virtualgift", "active" => $active === null ? true : $active, "label" => $label);
     $event->add($button);
 }
Пример #20
0
 public function onSend(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     $recipients = $params["recipients"];
     foreach ($recipients as $r) {
         list($prefix, $id) = explode("_", $r);
         if ($prefix == self::ID_PREFIX) {
             $event->add($id);
         }
     }
 }
Пример #21
0
 public function onCollectButtonsConfig(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     if ($params["entityType"] != HINT_BOL_Service::ENTITY_TYPE_USER) {
         return;
     }
     $label = OW::getLanguage()->text("newsfeed", "follow_button");
     $active = HINT_BOL_Service::getInstance()->isActionActive(HINT_BOL_Service::ENTITY_TYPE_USER, "follow");
     $button = array("key" => "follow", "active" => $active === null ? true : $active, "label" => $label);
     $event->add($button);
 }
Пример #22
0
/**
 * Copyright (c) 2014, Skalfa LLC
 * All rights reserved.
 * 
 * ATTENTION: This commercial software is intended for exclusive use with SkaDate Dating Software (http://www.skadate.com) and is licensed under SkaDate Exclusive License by Skalfa LLC.
 * 
 * Full text of this license can be found at http://www.skadate.com/sel.pdf
 */
function pcgallery_get_content(BASE_CLASS_EventCollector $event)
{
    $params = $event->getParams();
    if ($params['placeName'] != "profile") {
        return;
    }
    if (!PCGALLERY_CLASS_PhotoBridge::getInstance()->isActive()) {
        return;
    }
    $cmp = new PCGALLERY_CMP_Gallery($params['entityId']);
    $event->add($cmp->render());
}
Пример #23
0
 public function trackVisit(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     if (empty($params['entityId']) || empty($params['placeName']) || $params['placeName'] != 'profile') {
         return;
     }
     $userId = (int) $params['entityId'];
     $viewerId = OW::getUser()->getId();
     if ($userId && $viewerId && $viewerId != $userId) {
         OCSGUESTS_BOL_Service::getInstance()->trackVisit($userId, $viewerId);
     }
 }
Пример #24
0
function ynsocialpublisher_addAdminNotification(BASE_CLASS_EventCollector $e)
{
    $language = OW::getLanguage();
    if (OW::getPluginManager()->isPluginActive('ynsocialbridge') == false) {
        $e->add($language->text('ynsocialpublisher', 'requires_configuration_message'));
    } else {
        $build = BOL_PluginService::getInstance()->findPluginByKey('ynsocialbridge')->build;
        if ($build < 2) {
            $e->add($language->text('ynsocialpublisher', 'requires_configuration_message'));
        }
    }
}
Пример #25
0
 public function sendList(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     $userIdList = $params['userIdList'];
     $notifications = $this->service->findNotificationListForSend($userIdList);
     $notificationIds = array();
     foreach ($notifications as $notification) {
         $event->add(array('pluginKey' => $notification->pluginKey, 'entityType' => $notification->entityType, 'entityId' => $notification->entityId, 'userId' => $notification->userId, 'action' => $notification->action, 'time' => $notification->timeStamp, 'viewed' => (bool) $notification->viewed, 'data' => $notification->getData()));
         $notificationIds[] = $notification->id;
     }
     $this->service->markNotificationsSentByIds($notificationIds);
 }
Пример #26
0
 public function onCollectProfileActions(BASE_CLASS_EventCollector $event)
 {
     if (!OW::getUser()->isAuthenticated()) {
         return;
     }
     $params = $event->getParams();
     $targetUserID = $params['userId'];
     if (empty($targetUserID) || $targetUserID == OW::getUser()->getId() || !OW::getAuthorization()->isUserAuthorized($targetUserID, 'credits', 'receive')) {
         return;
     }
     $linkId = 'credits' . rand(10, 1000000);
     $event->add(array("label" => OW::getLanguage()->text('credits', 'profile_label_send'), "href" => OW::getRouter()->urlFor('CREDITS_MCTRL_Action', 'send', array('id' => $targetUserID)), "id" => $linkId));
 }
Пример #27
0
 public function onProfilePageRender(BASE_CLASS_EventCollector $event)
 {
     $params = $event->getParams();
     if (empty($params['entityId']) || empty($params['placeName']) || $params['placeName'] != 'profile') {
         return;
     }
     $userId = (int) $params['entityId'];
     $viewerId = OW::getUser()->getId();
     $authService = BOL_AuthorizationService::getInstance();
     $isAdmin = $authService->isActionAuthorizedForUser($viewerId, 'admin') || $authService->isActionAuthorizedForUser($viewerId, 'base');
     if ($userId && $viewerId && $viewerId != $userId && !$isAdmin) {
         OCSGUESTS_BOL_Service::getInstance()->trackVisit($userId, $viewerId);
     }
 }
Пример #28
0
function credits_members_action_tool(BASE_CLASS_EventCollector $event)
{
    if (!OW::getUser()->isAuthenticated()) {
        return;
    }
    $params = $event->getParams();
    $targetUserID = $params['userId'];
    if (empty($targetUserID) || $targetUserID == OW::getUser()->getId() || !OW::getAuthorization()->isUserAuthorized($targetUserID, 'credits', 'receive')) {
        return;
    }
    $user = BOL_UserService::getInstance()->getUserName((int) $targetUserID);
    $linkId = 'credits' . rand(10, 1000000);
    $resultArray = array(BASE_CMP_ProfileActionToolbar::DATA_KEY_LABEL => OW::getLanguage()->text('credits', 'profile_label_send'), BASE_CMP_ProfileActionToolbar::DATA_KEY_LINK_HREF => OW::getRouter()->urlFor('CREDITS_CTRL_Action', 'send', array('id' => $targetUserID)), BASE_CMP_ProfileActionToolbar::DATA_KEY_LINK_ID => $linkId);
    $event->add($resultArray);
}
Пример #29
0
function ocssitestats_add_userlist_data(BASE_CLASS_EventCollector $event)
{
    $config = OW::getConfig();
    $metricsConf = json_decode($config->getValue('ocssitestats', 'metrics'), true);
    $zeroValues = $config->getValue('ocssitestats', 'zero_values');
    $service = OCSSITESTATS_BOL_Service::getInstance();
    $count = $service->countNewUsersToday();
    if (!empty($metricsConf['new_users_today']) && ($count || $zeroValues)) {
        $event->add(array('label' => OW::getLanguage()->text('ocssitestats', 'new_users_today'), 'url' => OW::getRouter()->urlForRoute('base_user_lists', array('list' => 'new-today')), 'iconClass' => 'ow_ic_user', 'key' => 'new-today', 'order' => 6, 'dataProvider' => array(OCSSITESTATS_BOL_Service::getInstance(), 'getNewTodayUserListData')));
    }
    $count = $service->countNewUsersThisMonth();
    if (!empty($metricsConf['new_users_this_month']) && ($count || $zeroValues)) {
        $event->add(array('label' => OW::getLanguage()->text('ocssitestats', 'new_users_this_month'), 'url' => OW::getRouter()->urlForRoute('base_user_lists', array('list' => 'new-this-month')), 'iconClass' => 'ow_ic_user', 'key' => 'new-this-month', 'order' => 7, 'dataProvider' => array($service, 'getNewThisMonthUserListData')));
    }
}
Пример #30
0
 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));
 }