Use addScriptFile() instead of javascript notification
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Aug 2009 19:01:15 +0000 (13:01 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Aug 2009 19:01:15 +0000 (13:01 -0600)
imp/compose.php
imp/folders.php
imp/lib/Block/summary.php

index 3ce0251..b8f96e1 100644 (file)
@@ -712,12 +712,18 @@ if ($get_sig && isset($msg) && !empty($sig)) {
 /* Open the passphrase window here. */
 if ($pgp_passphrase_dialog || $pgp_symmetric_passphrase_dialog) {
     if ($pgp_passphrase_dialog) {
-        $notification->push(IMP::passphraseDialogJS('PGPPersonal', 'ImpCompose.uniqSubmit(\'send_message\')'), 'javascript');
+        Horde::addInlineScript(array(
+           IMP::passphraseDialogJS('PGPPersonal', 'ImpCompose.uniqSubmit(\'send_message\')')
+       ), 'dom');
     } else {
-        $notification->push(IMP::passphraseDialogJS('PGPSymmetric', 'ImpCompose.uniqSubmit(\'send_message\')', array('symmetricid' => 'imp_compose_' . $composeCacheID)), 'javascript');
+        Horde::addInlineScript(array(
+            IMP::passphraseDialogJS('PGPSymmetric', 'ImpCompose.uniqSubmit(\'send_message\')', array('symmetricid' => 'imp_compose_' . $composeCacheID))
+       ), 'dom');
     }
 } elseif ($smime_passphrase_dialog) {
-    $notification->push(IMP::passphraseDialogJS('SMIMEPersonal', 'ImpCompose.uniqSubmit(\'send_message\')'), 'javascript');
+    Horde::addInlineScript(array(
+        IMP::passphraseDialogJS('SMIMEPersonal', 'ImpCompose.uniqSubmit(\'send_message\')')
+    ), 'dom');
 }
 
 /* If PGP encryption is set by default, and we have a recipient list on first
index bea9250..b5114dd 100644 (file)
@@ -407,7 +407,9 @@ if (!empty($newmsgs)) {
     }
 
     if ($prefs->getValue('nav_popup')) {
-        $notification->push(IMP::getNewMessagePopup($newmsgs), 'javascript');
+        Horde::addInlineScript((
+            IMP::getNewMessagePopup($newmsgs)
+        ), 'dom');
     }
 
     if (($sound = $prefs->getValue('nav_audio'))) {
index cd80c26..9acf05d 100644 (file)
@@ -115,12 +115,7 @@ class Horde_Block_imp_summary extends Horde_Block
             }
 
             if ($prefs->getValue('nav_popup')) {
-                $alert = IMP::getNewMessagePopup($newmsgs);
-                if (!Horde_Util::getFormData('httpclient')) {
-                    $alert = 'document.observe("dom:loaded", function() { ' . $alert . ' });';
-                }
-                $notification->push($alert, 'javascript');
-                $html .= Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'javascript'));
+                $html .= Horde_Util::bufferOutput(Horde::addInlineScript((IMP::getNewMessagePopup($newmsgs)), 'dom'));
             }
 
             if (($sound = $prefs->getValue('nav_audio'))) {