modification to get the text entity in case we are dealing with alternative
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 30 May 2002 20:53:48 +0000 (20:53 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 30 May 2002 20:53:48 +0000 (20:53 +0000)
messages. The entity is parsed as ent_num to compose.php.

preparation of parsing multiple entities to compose.php

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2916 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/read_body.php

index 2d6dc5553f05088dc3a78710fb1c8b8d91775bca..8176ebbcc04bba83db7c42b86359674799125521 100644 (file)
@@ -583,10 +583,44 @@ $dateString = getLongDateString($message->header->date);
 /**
  * What do we reply to -- text only, if possible
  */
 /**
  * What do we reply to -- text only, if possible
  */
-$ent_ar = findDisplayEntity($message);
+$body = ''; 
+
+/* experimental */
+/*
+if ($message->header->type0 == 'multipart' && $message->header->type1 == 'digest') {
+  listEntities($message);
+  for ($i = 0; $i < count($message->entities); $i++) {
+
+       $msg = $message->entities[$i];
+       $body .= $msg->header->type0 .'/'.$msg->header->type1 .'<BR>';
+
+       $msg->header->type0 = 'message';
+       $msg->header->type1 = 'rfc822';
+       $ent_ar = findDisplayEntity($msg, false);
+       for ($i = 0; $i < count($ent_ar); $i++) {
+           $body .= formatBody($imapConnection, $msg, $color, $wrap_at, $ent_ar[$i]);
+       }
+       $i++;
+   }
+} else {
+*/    
+    $ent_ar = findDisplayEntity($message, false);
+    $i = 0;
+    for ($i = 0; $i < count($ent_ar); $i++) {
+       $body .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i]);
+    }
+/*
+}
+*/
+    
 /* first step in displaying multiple entities */
 /* first step in displaying multiple entities */
-$ent_num = $ent_ar[0];
+$ent_ar = findDisplayEntity($message,true);
 
 
+$ent_num = $ent_num_ar[0];
+for ($i = 1 ; $i < count($ent_ar); $i++) {
+    $ent_num .= '_'.$ent_num_ar[$i];
+}
 /** TEXT STRINGS DEFINITIONS **/
 $echo_more = _("more");
 $echo_less = _("less");
 /** TEXT STRINGS DEFINITIONS **/
 $echo_more = _("more");
 $echo_less = _("less");
@@ -1075,9 +1109,10 @@ echo '</TABLE>' .
 flush();
 echo "<TABLE CELLSPACING=0 WIDTH=\"97%\" BORDER=0 ALIGN=CENTER CELLPADDING=0>\n" .
     "   <TR><TD BGCOLOR=\"$color[4]\" WIDTH=\"100%\">\n" .
 flush();
 echo "<TABLE CELLSPACING=0 WIDTH=\"97%\" BORDER=0 ALIGN=CENTER CELLPADDING=0>\n" .
     "   <TR><TD BGCOLOR=\"$color[4]\" WIDTH=\"100%\">\n" .
-    '<BR>'.
-    formatBody($imapConnection, $message, $color, $wrap_at, $ent_num).
-    '</TD></TR></TABLE>' .
+    '<BR>';
+echo $body;
+
+echo '</TD></TR></TABLE>' .
     '<TABLE CELLSPACING="0" WIDTH="100%" BORDER="0" ALIGN="CENTER" CELLPADDING="0">' . "\n" .
     "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>" .
     '</TABLE>' . "\n";
     '<TABLE CELLSPACING="0" WIDTH="100%" BORDER="0" ALIGN="CENTER" CELLPADDING="0">' . "\n" .
     "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>" .
     '</TABLE>' . "\n";