From d89172e40e3415e0670c9d81bfc042e1dcefdf83 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 20 Aug 2009 13:01:15 -0600 Subject: [PATCH] Use addScriptFile() instead of javascript notification --- imp/compose.php | 12 +++++++++--- imp/folders.php | 4 +++- imp/lib/Block/summary.php | 7 +------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/imp/compose.php b/imp/compose.php index 3ce0251f4..b8f96e190 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -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 diff --git a/imp/folders.php b/imp/folders.php index bea9250ab..b5114dd1d 100644 --- a/imp/folders.php +++ b/imp/folders.php @@ -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'))) { diff --git a/imp/lib/Block/summary.php b/imp/lib/Block/summary.php index cd80c2609..9acf05d6e 100644 --- a/imp/lib/Block/summary.php +++ b/imp/lib/Block/summary.php @@ -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'))) { -- 2.11.0