当前位置: 首页>>代码示例>>PHP>>正文


PHP OW_Event::getData方法代码示例

本文整理汇总了PHP中OW_Event::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP OW_Event::getData方法的具体用法?PHP OW_Event::getData怎么用?PHP OW_Event::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OW_Event的用法示例。


在下文中一共展示了OW_Event::getData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeContentAdd

 public function beforeContentAdd(OW_Event $event)
 {
     $params = $event->getParams();
     $data = $event->getData();
     if (!empty($data)) {
         return;
     }
     if (empty($params["status"]) && empty($params["data"])) {
         $event->setData(false);
         return;
     }
     $attachId = null;
     $content = array();
     if (!empty($params["data"])) {
         $content = $params["data"];
         if ($content['type'] == 'photo' && !empty($content['genId'])) {
             $content['url'] = $content['href'] = OW::getEventManager()->call('base.attachment_save_image', array('genId' => $content['genId']));
             $attachId = $content['genId'];
         }
         if ($content['type'] == 'video') {
             $content['html'] = BOL_TextFormatService::getInstance()->validateVideoCode($content['html']);
         }
     }
     $status = UTIL_HtmlTag::autoLink($params["status"]);
     $out = NEWSFEED_BOL_Service::getInstance()->addStatus(OW::getUser()->getId(), $params['feedType'], $params['feedId'], $params['visibility'], $status, array("content" => $content, "attachmentId" => $attachId));
     $event->setData($out);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:27,代码来源:newsfeed_bridge.php

示例2: onDublicate

 public function onDublicate(OW_Event $event)
 {
     $params = $event->getParams();
     if (!in_array($params['entityType'], array(self::TYPE_COMMENT, self::TYPE_LIKE))) {
         return;
     }
     $data = $event->getData();
     $oldData = $params['oldData'];
     if (in_array($data['userIds'][0], $oldData['userIds'])) {
         $event->setData($oldData);
         return;
     }
     $data['userIds'] = array_merge($oldData['userIds'], $data['userIds']);
     $users = $oldData['users'];
     array_unshift($users, $data['users'][0]);
     $userCount = count($users);
     if ($userCount == 2) {
         $data['string']['key'] = $params['entityType'] == self::TYPE_COMMENT ? 'uheader+notifications_comment_2' : 'uheader+notifications_like_2';
         $data['string']['vars'] = array('user1' => '<a href="' . $users[0]['userUrl'] . '">' . $users[0]['userName'] . '</a>', 'user2' => '<a href="' . $users[1]['userUrl'] . '">' . $users[1]['userName'] . '</a>');
     }
     if ($userCount > 2) {
         $data['string']['key'] = 'uheader+notifications_comment_many';
         $data['string']['key'] = $params['entityType'] == self::TYPE_COMMENT ? 'uheader+notifications_comment_many' : 'uheader+notifications_like_many';
         $data['string']['vars'] = array('user1' => '<a href="' . $users[0]['userUrl'] . '">' . $users[0]['userName'] . '</a>', 'user2' => '<a href="' . $users[1]['userUrl'] . '">' . $users[1]['userName'] . '</a>', 'otherCount' => $userCount - 1);
     }
     $data['users'] = $users;
     $event->setData($data);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:28,代码来源:notifications_bridge.php

示例3: onUpdateInfo

 public function onUpdateInfo(OW_Event $event)
 {
     $params = $event->getParams();
     $data = $event->getData();
     if ($params["entityType"] != self::ENTITY_TYPE) {
         return;
     }
     foreach ($data as $eventId => $info) {
         $status = 0;
         switch ($info['status']) {
             case BOL_ContentService::STATUS_ACTIVE:
                 $status = EVENT_BOL_EventService::MODERATION_STATUS_ACTIVE;
                 break;
             case BOL_ContentService::STATUS_APPROVAL:
                 $status = EVENT_BOL_EventService::MODERATION_STATUS_APPROVAL;
                 break;
             case BOL_ContentService::STATUS_SUSPENDED:
                 $status = EVENT_BOL_EventService::MODERATION_STATUS_SUSPANDED;
                 break;
         }
         $eventDto = EVENT_BOL_EventService::getInstance()->findEvent($eventId);
         if (!empty($eventDto)) {
             $eventDto->status = $status;
             EVENT_BOL_EventService::getInstance()->saveEvent($eventDto);
         }
     }
 }
开发者ID:jorgemunoz8807,项目名称:havanabook,代码行数:27,代码来源:content_provider.php

示例4: onAfterGetSKADATE_CLASS_JoinFormInstance

 public function onAfterGetSKADATE_CLASS_JoinFormInstance(OW_Event $event)
 {
     $params = $event->getParams();
     if (!empty($params['className'])) {
         $event->setData(new FEMALEREGONLYMEN_CLASS_JoinForm($params['arguments'][0]));
         return $event->getData();
     }
 }
开发者ID:GiperProger,项目名称:femaleregonlymen,代码行数:8,代码来源:event_handler.php

示例5: onFeedItemRenderDisableActions

 public function onFeedItemRenderDisableActions(OW_Event $event)
 {
     $params = $event->getParams();
     if (!in_array($params["action"]["entityType"], array(GROUPS_BOL_Service::FEED_ENTITY_TYPE, "groups-join", "groups-status"))) {
         return;
     }
     $data = $event->getData();
     $data["disabled"] = true;
     $event->setData($data);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:event_handler.php

示例6: onFeedItemRenderDisableActions

 public function onFeedItemRenderDisableActions(OW_Event $event)
 {
     $params = $event->getParams();
     if ($params["action"]["entityType"] != "ocsfundraising_project") {
         return;
     }
     $data = $event->getData();
     $data["disabled"] = true;
     $event->setData($data);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:event_handler.php

示例7: onFeedItemRenderDisableActions

 public function onFeedItemRenderDisableActions(OW_Event $event)
 {
     $params = $event->getParams();
     if (!in_array($params["action"]["entityType"], array('link'))) {
         return;
     }
     $data = $event->getData();
     $data["disabled"] = true;
     $event->setData($data);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:event_handler.php

示例8: gheader_disable_formats

function gheader_disable_formats(OW_Event $event)
{
    $params = $event->getParams();
    if (!in_array($params["action"]["entityType"], array(GHEADER_CLASS_CommentsBridge::ENTITY_TYPE))) {
        return;
    }
    $data = $event->getData();
    $data["disabled"] = true;
    $event->setData($data);
}
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:init.php

示例9: isNotificationPermited

 public function isNotificationPermited(OW_Event $event)
 {
     $params = $event->getParams();
     if (!isset($params['userId'], $params['action'])) {
         return;
     }
     $userId = (int) $params['userId'];
     $action = $params['action'];
     $event->setData($this->service->isNotificationPermited($userId, $action));
     return $event->getData();
 }
开发者ID:tammyrocks,项目名称:notifications,代码行数:11,代码来源:email_bridge.php

示例10: sendNotification

 public function sendNotification(OW_Event $event)
 {
     $params = $event->getParams();
     $data = $event->getData();
     $userId = $params['userId'];
     $itemEventParams = array_merge(array('data' => $data), $params);
     $itemEvent = new OW_Event('notifications.on_item_send', $params, $data);
     OW::getEventManager()->trigger($itemEvent);
     $notificationItem = $itemEvent->getParams();
     $notificationItem['data'] = $itemEvent->getData();
     $this->service->sendPermittedNotifications($userId, array($notificationItem));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:12,代码来源:email_bridge.php

示例11: usearch_disable_fields_on_edit_profile_question

function usearch_disable_fields_on_edit_profile_question(OW_Event $event)
{
    $params = $event->getParams();
    $data = $event->getData();
    if (!empty($params['questionDto']) && $params['questionDto'] instanceof BOL_Question) {
        $dto = $params['questionDto'];
        if (in_array($dto->name, array('sex', 'match_sex', 'match_age'))) {
            $data['disable_on_search'] = true;
            $event->setData($data);
        }
    }
}
开发者ID:hardikamutech,项目名称:loov,代码行数:12,代码来源:init.php

示例12: onItemRender

 public function onItemRender(OW_Event $event)
 {
     $params = $event->getParams();
     $data = $event->getData();
     if ($params['action']['entityType'] != 'avatar-change') {
         return;
     }
     $userId = $params['action']['userId'];
     $avatarId = $params['action']['entityId'];
     $avatar = UAVATARS_BOL_Service::getInstance()->findLastByAvatarId($avatarId);
     if ($avatar === null) {
         return;
     }
     $staticUrl = OW::getPluginManager()->getPlugin('uavatars')->getStaticUrl();
     OW::getDocument()->addStyleSheet($staticUrl . 'style.css');
     OW::getDocument()->addScript($staticUrl . 'script.js');
     $avatars = UAVATARS_BOL_Service::getInstance()->findByUserId($userId, array(0, 2));
     UAVATARS_CLASS_PhotoBridge::getInstance()->initPhotoFloatBox();
     $js = UTIL_JsGenerator::newInstance();
     if (count($avatars) == 1) {
         $avatarUrl = UAVATARS_BOL_Service::getInstance()->getAvatarUrl($avatars[0]);
         $imgUniqId = uniqid('uavatar_');
         $data['content'] = '<div class="ua-newsfeed-avatars-wrap">
             <a id="' . $imgUniqId . '" class="ua-newsfeed-avatar ua-newsfeed-current-avatar ow_border" href="javascript://">
                 <img src="' . $avatarUrl . '" />
             </a>
             </div>';
         if (UAVATARS_CLASS_PhotoBridge::getInstance()->isPhotoExists($avatars[0]->photoId)) {
             $js->jQueryEvent('#' . $imgUniqId, 'click', 'UAVATARS.setPhoto(event.data.photoId);', array('event'), array('photoId' => $avatars[0]->photoId));
         }
     } else {
         $currentAvatarUrl = UAVATARS_BOL_Service::getInstance()->getAvatarUrl($avatars[0]);
         $prevAvatarUrl = UAVATARS_BOL_Service::getInstance()->getAvatarUrl($avatars[1]);
         $currentUniqId = uniqid('uavatar_');
         $prevUniqId = uniqid('uavatar_');
         $data['content'] = '<div class="ua-newsfeed-avatars-wrap">
             <a id="' . $prevUniqId . '" class="ua-newsfeed-avatar ua-newsfeed-prev-avatar ow_border" href="javascript://">
                 <img src="' . $prevAvatarUrl . '" />
             </a>
             <a id="' . $currentUniqId . '" class="ua-newsfeed-avatar ua-newsfeed-current-avatar ow_border" href="javascript://">
                 <img src="' . $currentAvatarUrl . '" />
             </a>
             </div>';
         if (UAVATARS_CLASS_PhotoBridge::getInstance()->isPhotoExists($avatars[0]->photoId)) {
             $js->jQueryEvent('#' . $currentUniqId, 'click', 'UAVATARS.setPhoto(event.data.photoId);', array('event'), array('photoId' => $avatars[0]->photoId));
         }
         if (UAVATARS_CLASS_PhotoBridge::getInstance()->isPhotoExists($avatars[1]->photoId)) {
             $js->jQueryEvent('#' . $prevUniqId, 'click', 'UAVATARS.setPhoto(event.data.photoId);', array('event'), array('photoId' => $avatars[1]->photoId));
         }
     }
     OW::getDocument()->addOnloadScript($js);
     $event->setData($data);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:53,代码来源:newsfeed_bridge.php

示例13: onUpdateInfo

 public function onUpdateInfo(OW_Event $event)
 {
     $params = $event->getParams();
     $data = $event->getData();
     if ($params["entityType"] != self::ENTITY_TYPE) {
         return;
     }
     foreach ($data as $groupId => $info) {
         $group = $this->service->findGroupById($groupId);
         $group->status = $info["status"];
         $this->service->saveGroup($group);
     }
 }
开发者ID:tammyrocks,项目名称:groups,代码行数:13,代码来源:content_provider.php

示例14: onBeforeRender

 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $event = new BASE_CLASS_EventCollector(self::EVENT_NAME, array('userId' => $this->userId));
     OW::getEventManager()->trigger($event);
     $event = new OW_Event(self::EVENT_PROCESS_TOOLBAR, array('userId' => $this->userId), $event->getData());
     OW::getEventManager()->trigger($event);
     $addedData = $event->getData();
     if (empty($addedData)) {
         $this->setVisible(false);
         return;
     }
     $this->initToolbar($addedData);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:14,代码来源:profile_action_toolbar.php

示例15: ping

 public function ping($params)
 {
     $commands = json_decode($params["commands"], true);
     $commandsResult = array();
     foreach ($commands as $command) {
         $event = new OW_Event(self::PING_EVENT . '.' . trim($command["name"]), $command["params"]);
         OW::getEventManager()->trigger($event);
         $event = new OW_Event(self::PING_EVENT, array("command" => $command["name"], "params" => $command["params"]), $event->getData());
         OW::getEventManager()->trigger($event);
         $data = $event->getData();
         $data = empty($data) ? new stdClass() : $data;
         $commandsResult[] = array('name' => $command["name"], 'data' => $data);
     }
     $this->assign("commands", $commandsResult);
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:15,代码来源:ping.php


注:本文中的OW_Event::getData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。