* @package IMP
*/
-function _mailboxReturnURL($url)
-{
- if (!$url) {
- $url = Horde::applicationUrl('mailbox.php')->setRaw(true);
- }
-
- foreach (array('start', 'page', 'mailbox', 'thismailbox') as $key) {
- if (($param = Horde_Util::getFormData($key))) {
- $url->add($key, $param);
- }
- }
-
- return $url;
-}
-
-function _popupSuccess()
-{
- $menu = new Horde_Menu(Horde_Menu::MASK_NONE);
- $menu->add(Horde::applicationUrl('compose.php'), _("New Message"), 'compose.png');
- $menu->add('', _("Close this window"), 'close.png', null, null, 'window.close();');
- require IMP_TEMPLATES . '/common-header.inc';
- $success_template = new Horde_Template();
- $success_template->set('menu', $menu->render());
- echo $success_template->fetch(IMP_TEMPLATES . '/compose/success.html');
- IMP::status();
- require $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
-}
-
-
require_once dirname(__FILE__) . '/lib/Application.php';
Horde_Registry::appInit('imp', array('session_control' => 'netscape', 'tz' => true));
if ($isPopup) {
if ($prefs->getValue('compose_confirm')) {
$notification->push(_("Message redirected successfully."), 'horde.success');
- _popupSuccess();
+ $imp_ui->popupSuccess();
} else {
Horde_Util::closeWindowJS();
}
if ($prefs->getValue('compose_confirm')) {
$notification->push(_("Message redirected successfully."), 'horde.success');
}
- header('Location: ' . _mailboxReturnURL(false));
+ header('Location: ' . $imp_ui->mailboxReturnUrl(false));
}
exit;
} catch (Horde_Exception $e) {
$notification->push($result, 'horde.success');
if ($prefs->getValue('close_draft')) {
$imp_compose->destroy();
- header('Location: ' . _mailboxReturnURL(false));
+ header('Location: ' . $imp_ui->mailboxReturnUrl(false));
exit;
}
}
if ($sent) {
$notification->push(_("Message sent successfully."), 'horde.success');
}
- _popupSuccess();
+ $imp_ui->popupSuccess();
} else {
Horde_Util::closeWindowJS();
}
if ($prefs->getValue('compose_confirm') && $sent) {
$notification->push(_("Message sent successfully."), 'horde.success');
}
- header('Location: ' . _mailboxReturnURL(false));
+ header('Location: ' . $imp_ui->mailboxReturnUrl(false));
}
exit;
if ($isPopup) {
Horde_Util::closeWindowJS();
} else {
- header('Location: ' . _mailboxReturnURL(false));
+ header('Location: ' . $imp_ui->mailboxReturnUrl(false));
}
exit;
/* If the attachments cache is not empty, we must reload this page and
delete the attachments. */
if ($imp_compose->numberOfAttachments()) {
- $cancel_url = _mailboxReturnURL(Horde::selfUrl()->setRaw(true))->add(array(
+ $cancel_url = $imp_ui->mailboxReturnUrl(Horde::selfUrl()->setRaw(true))->add(array(
'actionID' => 'cancel_compose',
'composeCache' => $composeCacheID
));
} else {
- $cancel_url = _mailboxReturnURL(true)->setRaw(false);
+ $cancel_url = $imp_ui->mailboxReturnUrl(true)->setRaw(false);
}
$showmenu = true;
}
return false;
}
+ /**
+ * TODO
+ */
+ public function mailboxReturnUrl($url)
+ {
+ if (!$url) {
+ $url = Horde::applicationUrl('mailbox.php')->setRaw(true);
+ }
+
+ foreach (array('start', 'page', 'mailbox', 'thismailbox') as $key) {
+ if (($param = Horde_Util::getFormData($key))) {
+ $url->add($key, $param);
+ }
+ }
+
+ return $url;
+ }
+
+ /**
+ * TODO
+ */
+ public function popupSuccess()
+ {
+ $menu = new Horde_Menu(Horde_Menu::MASK_NONE);
+ $menu->add(Horde::applicationUrl('compose.php'), _("New Message"), 'compose.png');
+ $menu->add('', _("Close this window"), 'close.png', null, null, 'window.close();');
+ require IMP_TEMPLATES . '/common-header.inc';
+ $success_template = new Horde_Template();
+ $success_template->set('menu', $menu->render());
+ echo $success_template->fetch(IMP_TEMPLATES . '/compose/success.html');
+ IMP::status();
+ require $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
+ }
+
}