Changeset 673 for trunk/expressoMail1_2/inc/class.db_functions.inc.php
- Timestamp:
- 02/06/09 16:53:27 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.db_functions.inc.php
r525 r673 337 337 $this->db->delete('phpgw_expressomail_contacts',$where,$line,$file); 338 338 } 339 340 function import_vcard($params){ 341 342 include_once('class.imap_functions.inc.php'); 343 $objImap = new imap_functions(); 344 $msg_number = $params['msg_number']; 345 $idx_file = $params['idx_file']; 346 $msg_part = $params['msg_part']; 347 $msg_folder = $params['msg_folder']; 348 $encoding = strtolower($params['encoding']); 349 $fileContent = ""; 350 351 if($msg_number && $msg_part && $msg_folder && (intval($idx_file == '0' ? '1' : $idx_file))) { 352 $mbox_stream = $objImap->open_mbox($msg_folder); 353 $fileContent = imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID); 354 include_once('class.imap_attachment.inc.php'); 355 $imap_attachment = new imap_attachment(); 356 $a = $imap_attachment->download_attachment($mbox_stream, $msg_number); 357 $filename = $a[$idx_file]['name']; 358 } 359 else 360 $filename = $idx_file; 361 362 if($fileContent) { 363 if($encoding == 'base64') 364 $calendar = imap_base64($fileContent); 365 else if($encoding == 'quoted-printable') 366 $calendar = quoted_printable_decode($fileContent); 367 else 368 $calendar = $fileContent; 369 } 370 371 $uiicalendar = CreateObject("calendar.uiicalendar"); 372 return $uiicalendar = $uiicalendar->import_from_mail($calendar); 373 } 374 339 375 } 340 376 ?>
Note: See TracChangeset
for help on using the changeset viewer.