From 9ae9ad583bd7567b69f11a9314391a5006467308 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 18 Jun 2009 12:32:29 -0600 Subject: [PATCH] Add save link to full message display in DIMP. --- imp/docs/CHANGES | 1 + imp/lib/Views/ShowMessage.php | 14 ++++++++------ imp/templates/chunks/message.php | 1 + imp/themes/screen-dimp.css | 2 +- imp/themes/screen.css | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index f8cd7ec20..70b5bbaf3 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -2,6 +2,7 @@ v5.0-git -------- +[mms] Add save link to full message display in DIMP. [mms] Allow on-demand filter application (if filter backend supports) in DIMP. [mms] Add full IMAP subscription support to DIMP. [mms] Add message information to preview screen (DIMP). diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index c7cef7e92..11e7eb4dc 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -85,17 +85,18 @@ class IMP_Views_ShowMessage * 'list_info' - List information. * 'priority' - The X-Priority of the message ('low', 'high', 'normal') * 'replyTo' - The Reply-to addresses + * 'save_as' - The save link * */ public function showMessage($args) { $preview = !empty($args['preview']); - $folder = $args['folder']; + $mailbox = $args['folder']; $index = $args['index']; $error_msg = _("Requested message not found."); $result = array( - 'folder' => $folder, + 'folder' => $mailbox, 'index' => $index ); @@ -105,7 +106,7 @@ class IMP_Views_ShowMessage /* Get envelope/header information. We don't use flags in this * view. */ try { - $fetch_ret = $GLOBALS['imp_imap']->ob->fetch($folder, array( + $fetch_ret = $GLOBALS['imp_imap']->ob->fetch($mailbox, array( Horde_Imap_Client::FETCH_ENVELOPE => true, Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => true, 'peek' => false)) ), array('ids' => array($index))); @@ -117,7 +118,7 @@ class IMP_Views_ShowMessage /* Parse MIME info and create the body of the message. */ try { - $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $folder); + $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox); } catch (Horde_Exception $e) { $result['error'] = $error_msg; $result['errortype'] = 'horde.error'; @@ -246,8 +247,8 @@ class IMP_Views_ShowMessage } /* Do MDN processing now. */ - if ($imp_ui->MDNCheck($folder, $index, $mime_headers)) { - $result['msgtext'] .= $imp_ui->formatStatusMsg(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link('', '', '', '', 'DimpCore.doAction(\'SendMDN\',{folder:\'' . $folder . '\',index:' . $index . '}); return false;', '', '') . _("HERE") . '')))); + if ($imp_ui->MDNCheck($mailbox, $index, $mime_headers)) { + $result['msgtext'] .= $imp_ui->formatStatusMsg(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link('', '', '', '', 'DimpCore.doAction(\'SendMDN\',{folder:\'' . $mailbox . '\',index:' . $index . '}); return false;', '', '') . _("HERE") . '')))); } /* Build body text. This needs to be done before we build the @@ -342,6 +343,7 @@ class IMP_Views_ShowMessage if (!$preview) { $result['list_info'] = $imp_ui->getListInformation($mime_headers); + $result['save_as'] = Horde::downloadUrl(htmlspecialchars_decode($result['subject']), array_merge(array('actionID' => 'save_message'), IMP::getIMPMboxParameters($mailbox, $index, $mailbox))); } return $result; diff --git a/imp/templates/chunks/message.php b/imp/templates/chunks/message.php index de98463f1..ac5734145 100644 --- a/imp/templates/chunks/message.php +++ b/imp/templates/chunks/message.php @@ -62,6 +62,7 @@ function _createDAfmsg($text, $image, $id, $class = '', $show_text = true)
+
diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 034d7fedb..f7209d160 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -391,7 +391,7 @@ div.vpRow.flagDeleted { text-decoration: none; color: #000; } -.dimpOptions div:hover { +.dimpOptions div a:hover { text-decoration: underline; } .dimpOptions div img { diff --git a/imp/themes/screen.css b/imp/themes/screen.css index 86391ae37..f5384fce5 100644 --- a/imp/themes/screen.css +++ b/imp/themes/screen.css @@ -596,7 +596,7 @@ td.addressTr span.loadingImg { padding: 0 1px; vertical-align: bottom; } -.downloadAtc { +.downloadAtc, .saveAsImg { background-image: url("graphics/download.png"); } .downloadZipAtc { -- 2.11.0