}
/**
- * 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
$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')) {
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;
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. */