diff --git a/lib/dashboard/Notification.inc.php b/lib/dashboard/Notification.inc.php index 0c88a42..b9b9d78 100644 --- a/lib/dashboard/Notification.inc.php +++ b/lib/dashboard/Notification.inc.php @@ -108,7 +108,7 @@ class KTNotification extends KTEntity { function render() { $notificationRegistry =& KTNotificationRegistry::getSingleton(); $handler = $notificationRegistry->getHandler($this->sType); - + if (is_null($handler)) { return null; } return $handler->handleNotification($this); @@ -134,9 +134,6 @@ class KTNotification extends KTEntity { /** register the base handlers. */ - -$notificationRegistry =& KTNotificationRegistry::getSingleton(); - // abstract base-class for notification handler. class KTNotificationHandler extends KTStandardDispatcher { @@ -358,8 +355,6 @@ class KTSubscriptionNotification extends KTNotificationHandler { } -$notificationRegistry->registerNotificationHandler("ktcore/subscriptions","KTSubscriptionNotification"); - class KTWorkflowNotification extends KTNotificationHandler { function & clearNotificationsForDocument($oDocument) { @@ -430,6 +425,4 @@ class KTWorkflowNotification extends KTNotificationHandler { } } -$notificationRegistry->registerNotificationHandler("ktcore/workflow","KTWorkflowNotification"); - ?> diff --git a/plugins/ktcore/KTCorePlugin.php b/plugins/ktcore/KTCorePlugin.php index a74fda0..a508051 100644 --- a/plugins/ktcore/KTCorePlugin.php +++ b/plugins/ktcore/KTCorePlugin.php @@ -69,6 +69,8 @@ class KTCorePlugin extends KTPlugin { // $this->registerAction('folderaction', 'KTDocumentAssistAction', 'ktcore.actions.folder.assist', 'KTAssist.php'); $this->registerNotificationHandler('KTAssistNotification', 'ktcore/assist', 'KTAssist.php'); + $this->registerNotificationHandler("KTSubscriptionNotification", "ktcore/subscriptions", KT_LIB_DIR . '/dashboard/Notification.inc.php'); + $this->registerNotificationHandler("KTWorkflowNotification", "ktcore/workflow", KT_LIB_DIR . '/dashboard/Notification.inc.php'); // Permissions