[imp] View HTML and Parts

solanellas@esade.edu solanellas@esade.edu
Thu, 9 May 2002 20:31:21 +0200


OK.

First of all, you need to enable the 'in_line' =true variable to display
html part in a message ( you can read the documentation or FAQ's)

After that, I could see the body message divided in 2 parts: First the
attachments of HTML and second the HTML ( but I wanted display first the
HTML).

First of all, I modified the buildMessage function to display the HTML
only:
      //       $atc .= IMP::partSummary($mime);


and I created a new funcion in ../imp/message.php:

function buildMessage2($attachments,$msg)
{
    global $inline_parts, $atc;

    // displayParts contains the parts that we should display, after
filtering out alternative parts
    $displayParts = array();

    // determine which is the alternative parts to show
    foreach ($attachments as $ref => $mime) {
       if (!isset($displayParts[$mime->alternative]) ||
selectAlternativePart($mime, $displayParts[$mime->alternativ
e])) {
           $displayParts[!empty($mime->alternative) ? $mime->alternative :
$ref] = $mime;
       }
   }

    // now display the parts
    foreach ($displayParts as $ref => $mime) {
        $msg .= '<table borde="10"> ' . '<tr><td>' . IMP::partSummary
($mime) . '</td></tr>' . '</table>';
    }
     return $msg;
}


In the same mmessage.php file I added the next 2 sentences
            $msg = buildMessage($attachments, $msg);
            $msg = buildMessage2($attachments , $msg);

just before /* Set the status information of the message */

Thats all,

Xavier Solanellas



                                                                                                                                       
                      "Jesus L. Paleo"                                                                                                 
                      <jesus@ea1dav.ne         Para:    solanellas@esade.edu                                                           
                      t>                       cc:      imp@list.horde.org                                                             
                                               Asunto:  Re: [imp] View HTML and Parts                                                  
                      09/05/02 16.02                                                                                                   
                                                                                                                                       
                                                                                                                                       



Mensaje citado por solanellas@esade.edu:
Hi Xavier:
           Yes, i am interested :-)  Can you explain the way you use to
view
the html pages. Thanks.


> Hi,
>
> I've solutionated the problem with the messages that it have an HTML part

> into it. I wanted that the HTML part was the first part displayed, and
> afterthat the attachments.
>
> I don't know if anybody wants that i explain the solution, but if anybody

> wants i'll do it.
>
> Thanks,
> Xavier Solanellas
>
>
>
>
>
>
> --
> IMP mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe@lists.horde.org
>


-----------------
Jesus L. Paleo

jesus@ea1dav.net
----------------

-------------------------------------------------