Skip to content

Commit

Permalink
ws
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Dec 2, 2013
1 parent 86dd92c commit 3af55ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/Core/lib/Horde/Core/Alarm/Handler/Desktop.php
Expand Up @@ -66,16 +66,17 @@ public function __construct(array $params = null)
public function notify(array $alarm)
{
global $notification;

if ($GLOBALS['registry']->getView() == Horde_Registry::VIEW_DYNAMIC) {
$alarm['params']['desktop']['icon'] = $this->_icon;
$notification->push($alarm['title'], 'horde.alarm', array(
'alarm' => $alarm
));
} else {
} else {
$js = sprintf('if(window.Notification){if (window.Notification.permission != "granted") {window.Notification.requestPermission(function(){if (window.Notification.permission == "granted") { new window.Notification("%s", {body: "%s", icon: "%s" }); } }) } else { new window.Notification("%s", {body: "%s", icon: "%s" }); } };',
$alarm['title'], $alarm['params']['desktop']['subtitle'], $this->_icon, $alarm['title'], $alarm['params']['desktop']['subtitle'], $this->_icon);
call_user_func($this->_jsNotify, $js);
}
}
}

/**
Expand Down

0 comments on commit 3af55ba

Please sign in to comment.