Method | Description | |
---|---|---|
__construct ( ) | Constructor. | |
createNotification ( $request, $userId = null, $notificationType, $contextId = null, $assocType = null, $assocId = null, $level = NOTIFICATION_LEVEL_NORMAL, $params = null, $suppressEmail = false ) : Notification | Create a new notification with the specified arguments and insert into DB | |
createTrivialNotification ( $userId, $notificationType = NOTIFICATION_TYPE_SUCCESS, $params = null ) : Notification | Create a new notification with the specified arguments and insert into DB This is a static method | |
deleteTrivialNotifications ( array $notifications ) | Deletes trivial notifications from database. | |
formatToGeneralNotification ( $request, array $notifications ) : array | General notification data formating. | |
formatToInPlaceNotification ( $request, $notifications ) : array | In place notification data formating. | |
getFormattedNotificationsForUser ( $request, $userId, $level = NOTIFICATION_LEVEL_NORMAL, $contextId = null, $rangeInfo = null, $notificationTemplate = 'notification/notification.tpl' ) : object | Construct a set of notifications and return them as a formatted string | |
getIconClass ( $notification ) | ||
getNotificationContents ( $request, $notification ) | Provide the notification message as default content. | |
getNotificationMessage ( $request, $notification ) | ||
getNotificationTitle ( $notification ) | ||
getNotificationUrl ( $request, $notification ) | ||
getParamsForCurrentLocale ( $params ) : array | Iterate through the localized params for a notification's locale key. | |
getStyleClass ( $notification ) | ||
isVisibleToAllUsers ( $notificationType, $assocType, $assocId ) | ||
sendMailingListEmail ( $request, $email, $token, $template ) | Static function to send an email to a mailing list user e.g. regarding signup | |
sendToMailingList ( $request, $notification ) | Send an update to all users on the mailing list |
Method | Description | |
---|---|---|
fetchLinkActionNotificationContent ( $linkAction, $request ) : string | Get a notification content with a link action. | |
getMailTemplate ( $emailKey = null ) : MailTemplate | Get a template mail instance. | |
getUserBlockedEmailedNotifications ( $userId, $contextId ) : array | Get set of notification types user will also be notified by email. | |
getUserBlockedNotifications ( $userId, $contextId ) : array | Get set of notifications types user does not want to be notified of. |
Method | Description | |
---|---|---|
formatNotification ( $request, $notification, $notificationTemplate = 'notification/notification.tpl' ) : string | Return a fully formatted notification for display | |
formatNotifications ( $request, $notifications, $notificationTemplate = 'notification/notification.tpl' ) | * Return a string of formatted notifications for display | |
sendNotificationEmail ( $request, $notification ) | Send an email to a user regarding the notification |
public createNotification ( $request, $userId = null, $notificationType, $contextId = null, $assocType = null, $assocId = null, $level = NOTIFICATION_LEVEL_NORMAL, $params = null, $suppressEmail = false ) : Notification | ||
$request | PKPRequest | |
$userId | int (optional) | |
$notificationType | int | |
$contextId | int | |
$assocType | int | |
$assocId | int | |
$level | int | |
$params | array | |
$suppressEmail | boolean Whether or not to suppress the notification email. | |
return | Notification | object |
public createTrivialNotification ( $userId, $notificationType = NOTIFICATION_TYPE_SUCCESS, $params = null ) : Notification | ||
$userId | int | |
$notificationType | int | |
$params | array | |
return | Notification | object |
public deleteTrivialNotifications ( array $notifications ) | ||
$notifications | array |
protected fetchLinkActionNotificationContent ( $linkAction, $request ) : string | ||
$linkAction | LinkAction | |
$request | Request | |
return | string |
public formatToGeneralNotification ( $request, array $notifications ) : array | ||
$request | PKPRequest | |
$notifications | array | |
return | array |
public formatToInPlaceNotification ( $request, $notifications ) : array | ||
$request | PKPRequest | |
$notifications | array | |
return | array |
public getFormattedNotificationsForUser ( $request, $userId, $level = NOTIFICATION_LEVEL_NORMAL, $contextId = null, $rangeInfo = null, $notificationTemplate = 'notification/notification.tpl' ) : object | ||
$request | PKPRequest | |
$userId | int | |
$level | int optional | |
$contextId | int optional | |
$rangeInfo | object optional | |
$notificationTemplate | string optional Template to use for constructing an individual notification for display | |
return | object | DAOResultFactory containing matching Notification objects |
protected getMailTemplate ( $emailKey = null ) : MailTemplate | ||
$emailKey | string | |
return | MailTemplate |
public getNotificationContents ( $request, $notification ) |
public getParamsForCurrentLocale ( $params ) : array | ||
$params | array | |
return | array |
protected getUserBlockedEmailedNotifications ( $userId, $contextId ) : array | ||
return | array |
protected getUserBlockedNotifications ( $userId, $contextId ) : array | ||
$userId | int The notification user | |
$contextId | int | |
return | array |
public isVisibleToAllUsers ( $notificationType, $assocType, $assocId ) |
public sendMailingListEmail ( $request, $email, $token, $template ) | ||
$request | PKPRequest | |
string | ||
$token | string the user's token (for confirming and unsubscribing) | |
$template | string The mail template to use |
public sendToMailingList ( $request, $notification ) | ||
$request | PKPRequest | |
$notification | object Notification |