[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Definition of eZOpenofficehandler class 4 // 5 // Created on: <27-Jul-2005 14:52:11 bf> 6 // 7 // SOFTWARE NAME: eZ publish 8 // SOFTWARE RELEASE: 3.9.0 9 // BUILD VERSION: 17785 10 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 11 // SOFTWARE LICENSE: GNU General Public License v2.0 12 // NOTICE: > 13 // This program is free software; you can redistribute it and/or 14 // modify it under the terms of version 2.0 of the GNU General 15 // Public License as published by the Free Software Foundation. 16 // 17 // This program is distributed in the hope that it will be useful, 18 // but WITHOUT ANY WARRANTY; without even the implied warranty of 19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 // GNU General Public License for more details. 21 // 22 // You should have received a copy of version 2.0 of the GNU General 23 // Public License along with this program; if not, write to the Free 24 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 25 // MA 02110-1301, USA. 26 // 27 // 28 29 /*! \file ezopenofficehandler.php 30 */ 31 32 /*! 33 \class eZOpenofficehandler ezopenofficehandler.php 34 \brief The class eZOpenofficehandler does 35 36 */ 37 38 include_once ( "kernel/classes/ezcontentuploadhandler.php" ); 39 include_once ( "extension/ezodf/modules/ezodf/ezooimport.php" ); 40 include_once ( "lib/ezutils/classes/ezsys.php" ); 41 42 class eZOpenofficeUploadHandler extends eZContentUploadHandler 43 { 44 function eZOpenofficeUploadHandler() 45 { 46 $this->eZContentUploadHandler( 'OOo file handling', 'openoffice' ); 47 } 48 49 /*! 50 Handling the uploading of OpenOffice.org docuemnt. 51 */ 52 function handleFile( &$upload, &$result, 53 $filePath, $originalFilename, $mimeinfo, 54 $location, $existingNode ) 55 { 56 //$ooINI =& eZINI::instance( 'odf.ini' ); 57 //$tmpDir = $ooINI->variable( 'ODFSettings', 'TmpDir' ); 58 $tmpDir = getcwd() . "/" . eZSys::cacheDirectory(); 59 60 $originalFilename = basename( $originalFilename ); 61 $tmpFile = $tmpDir . "/" . $originalFilename; 62 copy( $filePath, $tmpFile ); 63 64 $import = new eZOOImport(); 65 $tmpResult = $import->import( $tmpFile, $location, $originalFilename ); 66 67 $result['contentobject'] = $tmpResult['Object']; 68 $result['contentobject_main_node'] = $tmpResult['MainNode']; 69 unlink( $tmpFile ); 70 71 72 return true; 73 } 74 75 } 76 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |