[ Index ] |
|
Code source de Horde 3.1.3 |
1 <?php 2 /** 3 * The MIME_Viewer_tnef class allows MS-TNEF attachments to be displayed. 4 * 5 * $Horde: framework/MIME/MIME/Viewer/tnef.php,v 1.13.10.9 2006/01/01 21:28:25 jan Exp $ 6 * 7 * Copyright 2002-2006 Jan Schneider <jan@horde.org> 8 * Copyright 2002-2006 Michael Slusarz <slusarz@bigworm.colorado.edu> 9 * 10 * See the enclosed file COPYING for license information (LGPL). If you 11 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. 12 * 13 * @author Jan Schneider <jan@horde.org> 14 * @author Michael Slusarz <slusarz@bigworm.colorado.edu> 15 * @since Horde 3.0 16 * @package Horde_MIME_Viewer 17 */ 18 class MIME_Viewer_tnef extends MIME_Viewer { 19 20 /** 21 * Render out the current tnef data. 22 * 23 * @param array $params Any parameters the viewer may need. 24 * 25 * @return string The rendered contents. 26 */ 27 function render($params = array()) 28 { 29 require_once 'Horde/Compress.php'; 30 31 $tnef = &Horde_Compress::singleton('tnef'); 32 33 $data = '<table border="1">'; 34 $info = $tnef->decompress($this->mime_part->getContents()); 35 if (empty($info) || is_a($info, 'PEAR_Error')) { 36 $data .= '<tr><td>' . _("MS-TNEF Attachment contained no data.") . '</td></tr>'; 37 } else { 38 $data .= '<tr><td>' . _("Name") . '</td><td>' . _("Mime Type") . '</td></tr>'; 39 foreach ($info as $part) { 40 $data .= '<tr><td>' . $part['name'] . '</td><td>' . $part['type'] . '/' . $part['subtype'] . '</td></tr>'; 41 } 42 } 43 $data .= '</table>'; 44 45 return $data; 46 } 47 48 /** 49 * Return the MIME content type of the rendered content. 50 * 51 * @return string The content type of the output. 52 */ 53 function getType() 54 { 55 return 'text/html; charset=' . NLS::getCharset(); 56 } 57 58 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |