forked from pkp/ojs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#746: add app specific notification manager delegate
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
classes/notification/managerDelegate/ApproveSubmissionNotificationManager.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/notification/managerDelegate/ApproveSubmissionNotificationManager.inc.php | ||
* | ||
* Copyright (c) 2016 Simon Fraser University Library | ||
* Copyright (c) 2003-2016 John Willinsky | ||
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING. | ||
* | ||
* @class ApproveSubmissionNotificationManager | ||
* @ingroup classes_notification_managerDelegate | ||
* | ||
* @brief Notification manager delegate that handles notifications related with | ||
* submission approval process. | ||
*/ | ||
|
||
import('lib.pkp.classes.notification.managerDelegate.PKPApproveSubmissionNotificationManager'); | ||
|
||
class ApproveSubmissionNotificationManager extends PKPApproveSubmissionNotificationManager { | ||
|
||
/** | ||
* Constructor. | ||
* @param $notificationType int NOTIFICATION_TYPE_... | ||
*/ | ||
function ApproveSubmissionNotificationManager($notificationType) { | ||
parent::PKPApproveSubmissionNotificationManager($notificationType); | ||
} | ||
|
||
/** | ||
* @copydoc PKPNotificationOperationManager::getNotificationTitle() | ||
*/ | ||
function getNotificationTitle($notification) { | ||
switch ($notification->getType()) { | ||
case NOTIFICATION_TYPE_APPROVE_SUBMISSION: | ||
case NOTIFICATION_TYPE_FORMAT_NEEDS_APPROVED_SUBMISSION: | ||
return __('notification.type.approveSubmissionTitle'); | ||
} | ||
} | ||
|
||
/** | ||
* @copydoc PKPNotificationOperationManager::getNotificationMessage() | ||
*/ | ||
public function getNotificationMessage($request, $notification) { | ||
switch ($notification->getType()) { | ||
case NOTIFICATION_TYPE_FORMAT_NEEDS_APPROVED_SUBMISSION: | ||
return __('notification.type.formatNeedsApprovedSubmission'); | ||
case NOTIFICATION_TYPE_APPROVE_SUBMISSION: | ||
return __('notification.type.approveSubmission'); | ||
} | ||
|
||
return parent::getNotificationMessage($request, $notification); | ||
} | ||
} | ||
|