Fix display of title on popup message page
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 22 Oct 2009 22:28:07 +0000 (16:28 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 22 Oct 2009 22:28:33 +0000 (16:28 -0600)
imp/lib/Views/ShowMessage.php
imp/message-dimp.php

index 80d0d39..798e39e 100644 (file)
@@ -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
      * </pre>
      * @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) {
index daafa40..b9cba5f 100644 (file)
@@ -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 "<body>\n";
 require IMP_TEMPLATES . '/chunks/message.php';
 Horde::includeScriptFiles();