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 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"))); }
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); }
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')); } } }
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'))); } }
function ynmediaimporter_addAdminNotification(BASE_CLASS_EventCollector $e) { $language = OW::getLanguage(); if (OW::getPluginManager()->isPluginActive('ynsocialbridge') == false) { $e->add($language->text('ynmediaimporter', 'requires_configuration_message')); } }
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']))); } }
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))); } }
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')))); } }
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')); } }
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')))); } }
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())); }
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); }
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']))); } }
public function triggerCreditActionsAdd() { $e = new BASE_CLASS_EventCollector('usercredits.action_add'); foreach ($this->actions as $action) { $e->add($action); } OW::getEventManager()->trigger($e); }
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')))); }
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')))); } }
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'))))); }
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))); }
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); }
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); }
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); }
/** * 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()); }
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)); }
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); }
public function onSearch(BASE_CLASS_EventCollector $event) { $params = $event->getParams(); $kw = $params["kw"]; $userId = $params["userId"]; if ($kw === null) { $userIds = OW::getEventManager()->call('plugin.friends.get_friend_list', array('userId' => $userId, 'first' => 0, 'count' => 200)); $userIds = empty($userIds) ? array() : $userIds; } else { $userIds = $this->findUsers($kw, $userId); } $data = $this->buildData($userIds, OW::getLanguage()->text('utags', 'selector_group_friends'), array($userId)); foreach ($data as $item) { $event->add($item); } }
public function onSearch(BASE_CLASS_EventCollector $event) { $params = $event->getParams(); $kw = $params["kw"]; $userId = $params["userId"]; $userIds = array(); if ($kw === null) { $users = BOL_UserService::getInstance()->findList(0, 200); foreach ($users as $u) { $userIds[] = $u->id; } } else { $userIds = $this->findUsers($kw); } $data = $this->buildData($userIds, OW::getLanguage()->text('utags', 'selector_group_other')); foreach ($data as $item) { $event->add($item); } }
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::SNIPPET_NAME, $userId); if ($preview) { $snippet->setLabel($language->text("snippets", "snippet_friends_preview")); $snippet->setIconClass("ow_ic_friends"); $event->add($snippet); return; } $eventParams = array('action' => 'friends_view', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId()); try { OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams); } catch (RedirectException $exception) { return; } $data = OW::getEventManager()->call("plugin.friends.get_friend_list", array("userId" => $userId, "offset" => 0, "count" => 4)); $total = OW::getEventManager()->call("plugin.friends.count_friends", array("userId" => $userId)); if (empty($data)) { return; } $users = BOL_AvatarService::getInstance()->getDataForUserAvatars($data, true, false, false, false); $images = array(); foreach ($users as $user) { $images[] = $user["src"]; } $dispslayType = count($images) > 1 ? SNIPPETS_CMP_Snippet::DISPLAY_TYPE_4 : SNIPPETS_CMP_Snippet::DISPLAY_TYPE_1; $userName = BOL_UserService::getInstance()->getUserName($userId); $url = OW::getRouter()->urlForRoute('friends_user_friends', array('user' => $userName)); $snippet->setImages($images); $snippet->setLabel($language->text("snippets", "snippet_friends", array("count" => '<span class="ow_txt_value">' . $total . '</span>'))); $snippet->setUrl($url); $snippet->setDisplayType($dispslayType); $event->add($snippet); }
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"]; $service = EVENT_BOL_EventService::getInstance(); $snippet = new SNIPPETS_CMP_Snippet(self::SNIPPET_NAME, $userId); if ($preview) { $snippet->setLabel($language->text("snippets", "snippet_events_preview")); $snippet->setIconClass("ow_ic_calendar"); $event->add($snippet); return; } // Privacy check $eventParams = array('action' => 'event_view_attend_events', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId()); try { OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams); } catch (RedirectException $exception) { return; } $list = $service->findUserParticipatedPublicEvents($userId, 1, 3); $total = $service->findUserParticipatedPublicEventsCount($userId); if (empty($list)) { return; } $images = array(); foreach ($list as $eventItem) { $images[] = $eventItem->getImage() ? $service->generateImageUrl($eventItem->getImage(), true) : $service->generateDefaultImageUrl(); } $url = OW::getRouter()->urlForRoute("event.view_event_list", array("list" => "user-participated-events")); $url = OW::getRequest()->buildUrlQueryString($url, array("userId" => $userId)); $snippet->setImages($images); $snippet->setLabel($language->text("snippets", "snippet_events", array("count" => '<span class="ow_txt_value">' . $total . '</span>'))); $snippet->setUrl($url); $event->add($snippet); }
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_video_preview")); $snippet->setIconClass("ow_ic_video"); $event->add($snippet); return; } // Privacy check $eventParams = array('action' => "video_view_video", 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId()); try { OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams); } catch (RedirectException $exception) { return; } $service = VIDEO_BOL_ClipService::getInstance(); $total = $service->findUserClipsCount($userId); $list = $service->findUserClipsList($userId, 1, 3); if (empty($list)) { return; } $images = array(); foreach ($list as $clip) { $images[] = $clip["thumb"]; } $url = OW::getRouter()->urlForRoute("video_user_video_list", array("user" => BOL_UserService::getInstance()->getUserName($userId))); $snippet->setImages($images); $snippet->setLabel($language->text("snippets", "snippet_video", array("count" => '<span class="ow_txt_value">' . $total . '</span>'))); $snippet->setUrl($url); $event->add($snippet); }