本文整理汇总了PHP中NotificationManager::getNotificationUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP NotificationManager::getNotificationUrl方法的具体用法?PHP NotificationManager::getNotificationUrl怎么用?PHP NotificationManager::getNotificationUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NotificationManager
的用法示例。
在下文中一共展示了NotificationManager::getNotificationUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: markRead
/**
* Mark notifications unread
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function markRead($args, $request)
{
$notificationDao = DAORegistry::getDAO('NotificationDAO');
$user = $request->getUser();
$selectedElements = (array) $request->getUserVar('selectedElements');
foreach ($selectedElements as $notificationId) {
if ($notification = $notificationDao->getById($notificationId, $user->getId())) {
$notificationDao->setDateRead($notificationId, Core::getCurrentDate());
}
}
if ($request->getUserVar('redirect')) {
// In this case, the user has clicked on a notification
// and wants to view it. Mark it read first and redirect
$notificationMgr = new NotificationManager();
return $request->redirectUrlJson($notificationMgr->getNotificationUrl($request, $notification));
} else {
// The notification has been marked read explicitly.
// Update its status in the grid.
return DAO::getDataChangedEvent(null, null, $selectedElements);
}
}