Skip to content

Commit

Permalink
No reason to be including this on every access, since it will be push…
Browse files Browse the repository at this point in the history
…ed to the browser on every AJAX update
  • Loading branch information
slusarz committed Mar 12, 2014
1 parent a737348 commit a1d30d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions framework/Core/lib/Horde/Core/Alarm/Handler/Desktop.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Horde_Core_Alarm_Handler_Desktop extends Horde_Alarm_Handler
*/
public function __construct(array $params = null)
{
$GLOBALS['page_output']->addScriptFile('webnotification.js', 'horde');
if ($GLOBALS['registry']->getView() != Horde_Registry::VIEW_DYNAMIC) {
if (!isset($params['js_notify'])) {
throw new InvalidArgumentException('Parameter \'js_notify\' missing.');
Expand All @@ -67,11 +66,13 @@ public function __construct(array $params = null)
*/
public function notify(array $alarm)
{
global $notification;
global $notification, $page_output, $registry;

$icon = strval($this->_icon);

if ($GLOBALS['registry']->getView() == Horde_Registry::VIEW_DYNAMIC) {
$page_output->addScriptFile('webnotification.js', 'horde');

if ($registry->getView() == Horde_Registry::VIEW_DYNAMIC) {
$alarm['params']['desktop']['icon'] = $icon;
$notification->push($alarm['title'], 'horde.alarm', array(
'alarm' => $alarm
Expand Down

0 comments on commit a1d30d7

Please sign in to comment.