From 21605c4e8fdb9f6e1277dd8fd550aeab73f1ea45 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 04 Jun 2008 05:51:39 -0400
Subject: [PATCH] Distinguish html and plaintext parts in messagy body display

---
 skins/default/mail.css      |    5 +++++
 program/steps/mail/func.inc |   16 +++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 85b0431..ac4eb6b 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -680,7 +680,10 @@
 
 
 /**
+ * Handler for the 'messagebody' GUI object
  *
+ * @param array Named parameters
+ * @return string HTML content showing the message body
  */
 function rcmail_message_body($attrib)
   {
@@ -693,8 +696,7 @@
     $attrib['id'] = 'rcmailMsgBody';
 
   $safe_mode = $MESSAGE->is_safe || intval($_GET['_safe']);
-  $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
-  $out = '<div '. $attrib_str . ">\n";
+  $out = '';
   
   $header_attrib = array();
   foreach ($attrib as $attr => $value)
@@ -717,14 +719,11 @@
           $part->body = $MESSAGE->get_part_content($part->mime_id);
 
         $body = rcmail_print_body($part, $safe_mode, !$CONFIG['prefer_html']);
-        $out .= '<div class="message-part">';
         
         if ($part->ctype_secondary != 'plain')
-          $out .= rcmail_html4inline($body, $attrib['id']);
+          $out .= html::div('message-htmlpart', rcmail_html4inline($body, $attrib['id']));
         else
-          $out .= $body;
-
-        $out .= "</div>\n";
+          $out .= html::div('message-part', $body);
         }
       }
     }
@@ -754,8 +753,7 @@
   if ($REMOTE_OBJECTS && !$safe_mode)
     $OUTPUT->set_env('blockedobjects', true);
 
-  $out .= "\n</div>";
-  return $out;
+  return html::div($attrib, $out);
   }
 
 
diff --git a/skins/default/mail.css b/skins/default/mail.css
index db3bc4d..fd42af4 100644
--- a/skins/default/mail.css
+++ b/skins/default/mail.css
@@ -715,6 +715,11 @@
   border-right: 2px solid #bb0000;
 }
 
+div.message-htmlpart div.rcmBody
+{
+  margin: 8px;
+}
+
 #remote-objects-message
 {
   display: none;

--
Gitblit v1.9.1