| [ Index ] |
|
Code source de Horde 3.1.3 |
1 <?php 2 /** 3 * The MIME_Viewer_msexcel class renders out Microsoft Excel 4 * documents in HTML format by using the xlHtml package. 5 * 6 * $Horde: framework/MIME/MIME/Viewer/msexcel.php,v 1.20.10.7 2006/01/01 21:28:25 jan Exp $ 7 * 8 * Copyright 1999-2006 Anil Madhavapeddy <anil@recoil.org> 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 Anil Madhavapeddy <anil@recoil.org> 14 * @since Horde 1.3 15 * @package Horde_MIME_Viewer 16 */ 17 class MIME_Viewer_msexcel extends MIME_Viewer { 18 19 /** 20 * Render out the currently data using xlhtml. 21 * 22 * @param array $params Any params this Viewer may need. 23 * 24 * @return string The rendered data. 25 */ 26 function render($params = array()) 27 { 28 global $mime_drivers; 29 30 /* Check to make sure the program actually exists. */ 31 if (!file_exists($mime_drivers['horde']['msexcel']['location'])) { 32 return '<pre>' . sprintf(_("The program used to view this data type (%s) was not found on the system."), $mime_drivers['horde']['msexcel']['location']) . '</pre>'; 33 } 34 35 $data = ''; 36 $tmp_xls = Horde::getTempFile('horde_msexcel'); 37 38 $fh = fopen($tmp_xls, 'w'); 39 fwrite($fh, $this->mime_part->getContents()); 40 fclose($fh); 41 42 $fh = popen($mime_drivers['horde']['msexcel']['location'] . " -nh $tmp_xls 2>&1", 'r'); 43 while (($rc = fgets($fh, 8192))) { 44 $data .= $rc; 45 } 46 pclose($fh); 47 48 return $data; 49 } 50 51 /** 52 * Return the MIME content type of the rendered content. 53 * 54 * @return string The content type of the output. 55 */ 56 function getType() 57 { 58 return 'text/html; charset=' . NLS::getCharset(); 59 } 60 61 }
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 |