1
我正在自定义Oxwall通知插件。在用户仪表板中显示用户通知oxwall
我使用Oxwall 1.7.0
我想显示用户的仪表板页面的通知。
当前通知显示在名称为“通知”的右上角栏中。
我发现哪个文件负责显示内容。
ow_plugins /通知/班/ 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);
错误截图:
如何显示在用户的仪表板的通知?