From 842128e54f7df8521657ad2ac65b6343f55fb653 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 22 Oct 2009 16:28:07 -0600 Subject: [PATCH] Fix display of title on popup message page --- imp/lib/Views/ShowMessage.php | 17 ++++++++++++++--- imp/message-dimp.php | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index 80d0d392d..798e39ef7 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -72,6 +72,7 @@ class IMP_Views_ShowMessage * 'log' - Log information * 'mailbox' - The IMAP mailbox * 'msgtext' - The text of the message + * 'subject' - The subject * 'to' - The To addresses * * FOR PREVIEW MODE: @@ -85,6 +86,7 @@ class IMP_Views_ShowMessage * 'priority' - The X-Priority of the message ('low', 'high', 'normal') * 'replyTo' - The Reply-to addresses * 'save_as' - The save link + * 'title' - The title of the page * * @throws Horde_Exception */ @@ -216,9 +218,18 @@ class IMP_Views_ShowMessage } /* Process the subject. */ - $result['subject'] = ($subject = $mime_headers->getValue('subject')) - ? $imp_ui->getDisplaySubject($subject) - : htmlspecialchars(_("[No Subject]")); + $subject = $mime_headers->getValue('subject'); + if ($subject) { + $result['subject'] = $imp_ui->getDisplaySubject($subject); + if (!$preview) { + $result['title'] = htmlspecialchars($subject); + } + } else { + $result['subject'] = htmlspecialchars(_("[No Subject]")); + if (!$preview) { + $result['title'] = htmlspecialchars(_("[No Subject]")); + } + } /* Get X-Priority. */ if (!$preview) { diff --git a/imp/message-dimp.php b/imp/message-dimp.php index daafa4048..b9cba5ffb 100644 --- a/imp/message-dimp.php +++ b/imp/message-dimp.php @@ -85,7 +85,7 @@ if (isset($show_msg_result['js'])) { Horde::addInlineScript($js_out); Horde::addInlineScript(array_filter($js_onload), 'load'); -IMP_Dimp::header($show_msg_result['subject'], $scripts); +IMP_Dimp::header($show_msg_result['title'], $scripts); echo "\n"; require IMP_TEMPLATES . '/chunks/message.php'; Horde::includeScriptFiles(); -- 2.11.0