Fix forwarding from the IMP mailbox page
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Jul 2010 17:23:08 +0000 (11:23 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Jul 2010 17:43:28 +0000 (11:43 -0600)
imp/lib/IMP.php
imp/mailbox.php

index 9d383de..46257b4 100644 (file)
@@ -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
index 7cb954d..17f4899 100644 (file)
@@ -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. */