Skip to content

Commit

Permalink
pkp/pkp-lib#746: add app specific notification manager delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
beghelli committed Feb 25, 2016
1 parent 171d2d9 commit 308b698
Showing 1 changed file with 54 additions and 0 deletions.
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);
}
}

0 comments on commit 308b698

Please sign in to comment.