| [ Index ] |
|
Code source de IMP H3 (4.1.5) |
1 <?php 2 /** 3 * The IMP_MIME_Viewer_appledouble class handles multipart/appledouble 4 * messages conforming to RFC 1740. 5 * 6 * $Horde: imp/lib/MIME/Viewer/appledouble.php,v 1.13.10.7 2007/01/02 13:55:00 jan Exp $ 7 * 8 * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu> 9 * 10 * See the enclosed file COPYING for license information (GPL). If you 11 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. 12 * 13 * @author Michael Slusarz <slusarz@bigworm.colorado.edu> 14 * @since IMP 4.0 15 * @package Horde_MIME_Viewer 16 */ 17 class IMP_MIME_Viewer_appledouble extends MIME_Viewer { 18 19 /** 20 * Render out the currently set contents. 21 * 22 * @param array $params An array with a reference to a MIME_Contents 23 * object. 24 * 25 * @return string The rendered text in HTML. 26 */ 27 function render($params) 28 { 29 $contents = &$params[0]; 30 $text = ''; 31 32 /* RFC 1740 [4]: There are two parts to an appledouble message: 33 (1) application/applefile 34 (2) Data embedded in the Mac file */ 35 36 /* Display the macintosh download link. */ 37 $part = $contents->getDecodedMIMEPart($this->mime_part->getRelativeMIMEId(1)); 38 if ($part) { 39 $status = array( 40 _("This message contains a Macintosh file."), 41 sprintf(_("The Macintosh resource fork can be downloaded %s."), $contents->linkViewJS($part, 'download_attach', _("HERE"), _("The Macintosh resource fork"))), 42 _("The contents of the Macintosh file are below.") 43 ); 44 $text .= $contents->formatStatusMsg($status, Horde::img('apple.png', _("Macintosh File")), false); 45 } 46 47 /* Display the content of the file. */ 48 $part = $contents->getDecodedMIMEPart($this->mime_part->getRelativeMIMEId(2)); 49 if ($part) { 50 $mime_message = &MIME_Message::convertMIMEPart($part); 51 $mc = &new MIME_Contents($mime_message, array('download' => 'download_attach', 'view' => 'view_attach'), array(&$contents)); 52 $mc->buildMessage(); 53 $text .= '<table cellspacing="0">' . $mc->getMessage(true) . '</table>'; 54 } 55 56 return $text; 57 } 58 59 /** 60 * Return the content-type. 61 * 62 * @return string The content-type of the message. 63 */ 64 function getType() 65 { 66 return 'text/html; charset=' . NLS::getCharset(); 67 } 68 69 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Thu Nov 29 12:30:07 2007 | par Balluche grâce à PHPXref 0.7 |
|