00062 default: 00063 $names = split(';', $obj->headers["content-disposition"]); 00064 00065 $names = split('=', $names[1]); 00066 $aux['name'] = $names[1]; 00067 $aux['content-type'] = $obj->headers["content-type"]; 00068 $aux['part'] = $i; 00069 $parts['attachments'][] = $aux; 00070 } 00071 } 00072 } 00073 00074 function check_attachments(&$output, &$out, $page, $user) { 00075 global $wikilib; 00076 $cnt = 0; 00077 for ($it = 0; $it < count($output->parts); $it++) 00078 { 00079 if (isset($output->parts[$it]->d_parameters["filename"])) 00080 { 00081 $attachmentPart = $output->parts[$it]; 00082 $fileName = $attachmentPart->d_parameters["filename"]; 00083 $fileType = $attachmentPart->ctype_primary ."/". $attachmentPart->ctype_secondary; 00084 $fileData = $attachmentPart->body; 00085 $fileSize = strlen($fileData); 00086 $wikilib->wiki_attach_file($page, $fileName, $fileType, $fileSize, $fileData, "attached by mail", $user, ""); 00087 $cnt++; 00088 } 00089 } 00090 $out .= $cnt; 00091 $out .= " attachment(s) added
"; 00092 }