我正在自定义 Oxwall 通知插件。
我正在使用 Oxwall 1.7.0
我正在尝试在用户的仪表板页面中显示通知。
目前,通知显示在右上角,名称为“通知”。
我发现哪个文件负责显示内容。
ow_plugins/notifications/classes/console_bridge.php
我在此文件中注释了以下代码以隐藏右上角栏中的通知。
public function collectItems( BASE_CLASS_ConsoleItemCollector $event )
{
if ( !OW::getUser()->isAuthenticated() )
{
return;
}
/* Commented this code to hide the notification.
$item = new NOTIFICATIONS_CMP_ConsoleItem();
$event->addItem($item, 3);
*/
}
但是当我们使用下面的代码调用用户仪表板中的组件时,它给了我错误。
$widgetService = BOL_ComponentAdminService::getInstance();
$widget = $widgetService->addWidget('NOTIFICATIONS_CMP_ConsoleItem', false);
$widgetPlace = $widgetService->addWidgetToPlace($widget, BOL_ComponentService::PLACE_DASHBOARD);
$widgetService->addWidgetToPosition($widgetPlace, BOL_ComponentService::SECTION_LEFT);
错误截图:
如何在用户仪表板中显示通知?