- Timestamp:
- 03/05/12 09:22:46 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/inc/class.imap_attachment.inc.php
r3289 r5621 2 2 class imap_attachment 3 3 { 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 4 27 function get_attachment_info($mbox_stream, $msg_number) 5 28 { 6 29 $structure = imap_fetchstructure($mbox_stream,$msg_number,FT_UID); 30 $aaa = $this->flattenParts($structure->parts); 7 31 $contentParts = count($structure->parts); 8 32 … … 13 37 for($i=1; $i<$contentParts; $i++) 14 38 { 15 $msg_info['attachment'][$i]['part_in_msg'] = ($i +1);39 $msg_info['attachment'][$i]['part_in_msg'] = ($i); 16 40 $msg_info['attachment'][$i]['name'] = urlencode($structure->parts[$i]->dparameters[0]->value); 17 41 $msg_info['attachment'][$i]['type'] = $structure->parts[$i]->subtype;
Note: See TracChangeset
for help on using the changeset viewer.