本文整理汇总了PHP中BASE_CLASS_EventCollector::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP BASE_CLASS_EventCollector::getParams方法的具体用法?PHP BASE_CLASS_EventCollector::getParams怎么用?PHP BASE_CLASS_EventCollector::getParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BASE_CLASS_EventCollector
的用法示例。
在下文中一共展示了BASE_CLASS_EventCollector::getParams方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAddProfileContentMenu
public function onAddProfileContentMenu(BASE_CLASS_EventCollector $event)
{
$params = $event->getParams();
if (empty($params['userId'])) {
return;
}
$userId = (int) $params['userId'];
$lang = OW::getLanguage();
$linkId = uniqid('photo');
$albumService = PHOTO_BOL_PhotoAlbumService::getInstance();
$exclude = array();
$newsfeedAlbum = $albumService->getNewsfeedAlbum($userId);
if ($newsfeedAlbum !== null) {
$exclude[] = $newsfeedAlbum->id;
}
if (!$albumService->countUserAlbums($userId, $exclude)) {
return;
}
$albumList = $albumService->findUserAlbumList($userId, 1, 1, $exclude);
$cover = !empty($albumList[0]['cover']) ? $albumList[0]['cover'] : null;
$username = BOL_UserService::getInstance()->getUserName($userId);
$url = OW::getRouter()->urlForRoute('photo_user_albums', array('user' => $username));
$resultArray = array(BASE_MCMP_ProfileContentMenu::DATA_KEY_LABEL => $lang->text('photo', 'user_photo_albums_widget'), BASE_MCMP_ProfileContentMenu::DATA_KEY_LINK_HREF => $url, BASE_MCMP_ProfileContentMenu::DATA_KEY_LINK_ID => $linkId, BASE_MCMP_ProfileContentMenu::DATA_KEY_LINK_CLASS => 'owm_profile_nav_photo', BASE_MCMP_ProfileContentMenu::DATA_KEY_THUMB => $cover);
$event->add($resultArray);
}
示例2: getNewItems
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'])));
}
}
示例3: getNewInvitations
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'])));
}
}
示例4: socialsharing_get_sharing_buttons
function socialsharing_get_sharing_buttons(BASE_CLASS_EventCollector $event)
{
$params = $event->getParams();
$entityId = !empty($params['entityId']) ? $params['entityId'] : null;
$entityType = !empty($params['entityType']) ? $params['entityType'] : null;
if (!empty($entityId) && !empty($entityType)) {
$sharingInfoEvent = new OW_Event('socialsharing.get_entity_info', $params, $params);
OW::getEventManager()->trigger($sharingInfoEvent);
$data = $sharingInfoEvent->getData();
$params = array_merge($params, $data);
}
$display = isset($params['display']) ? $params['display'] : true;
if (!$display) {
return;
}
$url = !empty($params['url']) ? $params['url'] : null;
$description = !empty($params['description']) ? $params['description'] : OW::getDocument()->getDescription();
$title = !empty($params['title']) ? $params['title'] : OW::getDocument()->getTitle();
$image = !empty($params['image']) ? $params['image'] : null;
$class = !empty($params['class']) ? $params['class'] : null;
$displayBlock = false;
//isset($params['displayBlock']) ? $params['displayBlock'] : true;
$cmp = new SOCIALSHARING_CMP_ShareButtons();
$cmp->setCustomUrl($url);
$cmp->setDescription($description);
$cmp->setTitle($title);
$cmp->setImageUrl($image);
$cmp->setDisplayBlock($displayBlock);
if (!empty($class)) {
$cmp->setBoxClass($class);
}
$event->add($cmp->render());
}
示例5: collectSnippets
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);
}
示例6: onCollectProfileActions
public function onCollectProfileActions(BASE_CLASS_EventCollector $event)
{
$params = $event->getParams();
$userId = $params['userId'];
if (!OW::getUser()->isAuthenticated() || OW::getUser()->getId() == $userId) {
return;
}
$activeModes = MAILBOX_BOL_ConversationService::getInstance()->getActiveModeList();
if (!in_array('mail', $activeModes)) {
return;
}
$linkId = uniqid('send_message');
$script = UTIL_JsGenerator::composeJsString('
$("#' . $linkId . '").click(function()
{
if ( {$isBlocked} )
{
OWM.error({$blockError});
return false;
}
});
', array('isBlocked' => BOL_UserService::getInstance()->isBlocked(OW::getUser()->getId(), $userId), 'blockError' => OW::getLanguage()->text('base', 'user_block_message')));
OW::getDocument()->addOnloadScript($script);
$event->add(array("label" => OW::getLanguage()->text('mailbox', 'send_message'), "href" => OW::getRouter()->urlForRoute('mailbox_compose_mail_conversation', array('opponentId' => $userId)), "id" => $linkId));
}
示例7: trackVisit
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);
}
示例8: onCollectButtonsConfig
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);
}
示例9: onSend
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);
}
}
}
示例10: sendList
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);
}
示例11: pcgallery_get_content
/**
* 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());
}
示例12: trackVisit
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);
}
}
示例13: onCollectProfileActions
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));
}
示例14: onProfilePageRender
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);
}
}
示例15: credits_members_action_tool
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);
}