Ignore:
Timestamp:
03/05/12 09:22:46 (12 years ago)
Author:
rafaelraymundo
Message:

Ticket #2512 - Ao abrir o e-mail anexado o Expresso não mostra a mensagem original.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/expressoMail1_2/inc/class.imap_attachment.inc.php

    r3289 r5621  
    22class imap_attachment 
    33{ 
     4        function flattenParts($messageParts, $flattenedParts = array(), $prefix = '', $index = 1, $fullPrefix = true) { 
     5 
     6                foreach($messageParts as $part) { 
     7                        $flattenedParts[$prefix.$index] = $part; 
     8                        if(isset($part->parts)) { 
     9                                if($part->type == 2) { 
     10                                        $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix.$index.'.', 0, false); 
     11                                } 
     12                                elseif($fullPrefix) { 
     13                                        $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix.$index.'.'); 
     14                                } 
     15                                else { 
     16                                        $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix); 
     17                                } 
     18                                unset($flattenedParts[$prefix.$index]->parts); 
     19                        } 
     20                        $index++; 
     21                } 
     22 
     23                return $flattenedParts; 
     24 
     25        } 
     26     
    427        function get_attachment_info($mbox_stream, $msg_number)  
    528        {        
    629                $structure = imap_fetchstructure($mbox_stream,$msg_number,FT_UID); 
     30                $aaa = $this->flattenParts($structure->parts); 
    731                $contentParts = count($structure->parts); 
    832         
     
    1337                        for($i=1; $i<$contentParts; $i++) 
    1438                        { 
    15                                 $msg_info['attachment'][$i]['part_in_msg']      = ($i+1); 
     39                                $msg_info['attachment'][$i]['part_in_msg']      = ($i); 
    1640                                $msg_info['attachment'][$i]['name']                             = urlencode($structure->parts[$i]->dparameters[0]->value); 
    1741                                $msg_info['attachment'][$i]['type']                             = $structure->parts[$i]->subtype; 
Note: See TracChangeset for help on using the changeset viewer.