From de554e133bc5e281dc3e912c433175f33408af6b Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 30 Jul 2010 11:23:08 -0600 Subject: [PATCH] Fix forwarding from the IMP mailbox page --- imp/lib/IMP.php | 16 ---------------- imp/mailbox.php | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 9d383de66..46257b416 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -343,22 +343,6 @@ class IMP } /** - * Open an (IMP) compose window. - * - * @return boolean True if window was opened. - */ - static public function openComposeWin($options = array()) - { - if ($GLOBALS['prefs']->getValue('compose_popup')) { - return false; - } - - $options += self::getComposeArgs(); - header('Location: ' . Horde::applicationUrl('compose.php', true)->add($options)); - return true; - } - - /** * Prepares the arguments to use for composeLink(). * * @param mixed $args List of arguments to pass to compose.php. If this diff --git a/imp/mailbox.php b/imp/mailbox.php index 7cb954dc9..17f489906 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -68,7 +68,6 @@ $do_filter = false; $imp_flags = $injector->getInstance('IMP_Imap_Flags'); $imp_imap = $injector->getInstance('IMP_Imap')->getOb(); $indices = new IMP_Indices($vars->indices); -$open_compose_window = null; /* Run through the action handlers */ if ($actionID && ($actionID != 'message_missing')) { @@ -127,8 +126,19 @@ case 'message_missing': case 'fwd_digest': if ($indices->count()) { - $options = array('fwddigest' => strval($indices), 'actionID' => 'fwd_digest'); - $open_compose_window = IMP::openComposeWin($options); + $options = array_merge(array( + 'actionID' => 'fwd_digest', + 'fwddigest' => strval($indices) + ), IMP::getComposeArgs()); + + if ($prefs->getValue('compose_popup')) { + Horde::addInlineScript(array( + Horde::popupJs(Horde::applicationUrl('compose.php'), array('novoid' => true, 'params' => array_merge(array('popup' => 1), $options))) + ), 'dom'); + } else { + header('Location: ' . Horde::applicationUrl('compose.php', true)->add($options)); + exit; + } } break; @@ -349,16 +359,6 @@ Horde::addScriptFile('effects.js', 'horde'); Horde::addScriptFile('redbox.js', 'horde'); Horde::addScriptFile('mailbox.js', 'imp'); -/* Handle compose_popup. */ -if ($open_compose_window === false) { - if (!isset($options)) { - $options = array(); - } - Horde::addInlineScript(array( - Horde::popupJs(Horde::applicationUrl('compose.php'), array('params' => array_merge(array('popup' => 1), $options, IMP::getComposeArgs()))) - ), 'dom'); -} - if (!empty($newmsgs)) { /* Open the mailbox R/W so we ensure the 'recent' flags are cleared from * the current mailbox. */ -- 2.11.0