public function onItemRender(OW_Event $event) { $params = $event->getParams(); $data = $params["data"]; if (!in_array($params['entityType'], array(self::TYPE_COMMENT, self::TYPE_LIKE))) { return; } $coverId = null; if (empty($params["data"]["coverId"])) { $cover = UHEADER_BOL_Service::getInstance()->findCoverByUserId(OW::getUser()->getId()); if (!empty($cover)) { $coverId = $cover->id; } } else { $coverId = $params["data"]["coverId"]; } $url = null; if (!empty($coverId)) { $url = UHEADER_MCLASS_NewsfeedBridge::getInstance()->getCoverUrl($coverId); } if (!empty($url)) { $data["url"] = $url; } $event->setData($data); }
/** * Returns class instance * * @return UHEADER_MCLASS_NewsfeedBridge */ public static function getInstance() { if (!isset(self::$classInstance)) { self::$classInstance = new self(); } return self::$classInstance; }
<?php UHEADER_MCLASS_EventHandler::getInstance()->init(); UHEADER_MCLASS_NewsfeedBridge::getInstance()->init(); UHEADER_MCLASS_NotificationsBridge::getInstance()->init();