diff --git a/notifications/inc/class.notifications_ajax.inc.php b/notifications/inc/class.notifications_ajax.inc.php index df455ac9b2..d6fc0c1564 100644 --- a/notifications/inc/class.notifications_ajax.inc.php +++ b/notifications/inc/class.notifications_ajax.inc.php @@ -262,22 +262,22 @@ class notifications_ajax { __LINE__,__FILE__,false,'',self::_appname); if ($rs->NumRows() > 0) { foreach ($rs as $notification) { - if($browserNotify) + $message = null; + if($browserNotify && $this->preferences[self::_appname]['egwpopup_verbosity'] != 'low') { - // Check for a link - doesn't work in notification - if(strpos($notification['notify_message'], lang('Linked entries:'))) - { - $notification['notify_message'] = substr_replace($notification['notify_message'], '', strpos($notification['notify_message'], lang('Linked entries:'))); - } - $notification['notify_message'] = preg_replace('#]*>#is','',$notification['notify_message']); - - $notification['notify_message'] = 'data:text/html;base64,'.base64_encode($notification['notify_message']); - } - $this->response->addScriptCall('append_notification_message',$notification['notify_id'],$notification['notify_message']); - } + $message = $notification['notify_message']; - // Skip in-page popup - if($browserNotify) return true; + // Check for a link - doesn't work in notification + if(strpos($message, lang('Linked entries:'))) + { + $message = substr_replace($message, '', strpos($message, lang('Linked entries:'))); + } + $message = preg_replace('#]*>#is','',$message); + + $message = 'data:text/html;base64,'.base64_encode($message); + } + $this->response->addScriptCall('append_notification_message',$notification['notify_id'],$notification['notify_message'],$message); + } switch($this->preferences[self::_appname]['egwpopup_verbosity']) { case 'low': diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index 4984719fc1..0300f9ac6d 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -116,7 +116,7 @@ function egwpopup_button_close() { notificationbell_switch("inactive"); } -function append_notification_message(_id, _message) { +function append_notification_message(_id, _message, _browser_notify) { if(!check_browser_notify() || typeof notifymessages[_id] != 'undefined') { @@ -127,7 +127,7 @@ function append_notification_message(_id, _message) { notifymessages[_id] = _message; // Notification API - var notice = webkitNotifications.createHTMLNotification(_message); + var notice = webkitNotifications.createHTMLNotification(_browser_notify); notice.ondisplay = function() { // Confirm when user gets to see it - no close needed // Wait a bit to let it load first, or it might not be there when requested.