Ejemplo n.º 1
0
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU LESSER GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
APIC::import("org.apicnet.io.OOo.absOOo");
APIC::import("org.apicnet.io.OOo.objOOo.OOoText");
/**
 * OOoWriter, classe de génération et de modification d'un fichier Writer
 * 
 * @package 
 * @author apicnet
 * @copyright Copyright (c) 2004
 * @version $Id$
 * @access public
 **/
class OOoWriter extends absOOo
{
    var $style;
    var $STYLNUM = array('style_family_text' => 1, 'style_family_para' => 1, 'style_page_style' => 1);
    function OOoWriter($dir)
    {
Ejemplo n.º 2
0
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU LESSER GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
APIC::import("org.apicnet.io.OOo.absOOo");
APIC::import("org.apicnet.io.File");
/**
 * OOoMeta
 * 
 * @package 
 * @author diogene
 * @copyright Copyright (c) 2004
 * @version $Id: OOoMeta.php,v 1.6 2007-02-04 20:09:43 mose Exp $
 * @access public
 **/
class OOoMeta extends absOOo
{
    /**
     * OOoMeta::OOoMeta(), construteur. méthode d'instanciation des paramètre nécessaire au bon fonctionnement de cette class
     * 
     * @param $dir
Ejemplo n.º 3
0
Copyright (c) 2002-2004 @PICNet

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU LESSER GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
APIC::import("org.apicnet.io.OOo.absOOo");
/**
 * 
 * @package 
 * @author Diogene 
 * @copyright Copyright (c) 2003
 * @version $Id: OOoTable.php,v 1.3 2005-05-18 11:01:39 mose Exp $
 * @access public 
 */
class OOoTable extends absOOo
{
    var $_column;
    var $_row;
    var $_lignCur;
    var $_colSpan;
    var $_rowSpan;
Ejemplo n.º 4
0
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU LESSER GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
APIC::import("org.apicnet.io.File");
APIC::import("org.apicnet.io.CDir");
/**
 * OOoUtil
 * 
 * @package 
 * @author apicnet
 * @copyright Copyright (c) 2004
 * @version $Id: OOoUtil.php,v 1.3 2005-05-18 11:01:39 mose Exp $
 * @access public
 **/
class OOoUtil extends absOOo
{
    var $directories = array("Images", "META-INF");
    var $pictures = array("gif", "png");
    var $tmpdir;
    var $docExist;
Ejemplo n.º 5
0
 function _save(&$sheet)
 {
     // Get rid of debug output
     ob_start();
     APIC::import("org.apicnet.io.OOo.objOOo.OOoTable");
     $OOoCalc = APIC::loadClass("org.apicnet.io.OOo.OOoDoc");
     $OOoCalc->newCalc();
     $OOoCalc->setName("export.sxc");
     $OOoCalc->meta->setCreator("TikiSheet");
     $OOoCalc->meta->setTitle("TikiSheet Export");
     $OOoCalc->content->addFeuille();
     foreach ($sheet->dataGrid as $rowIndex => $row) {
         foreach ($row as $columnIndex => $value) {
             $OOoCalc->content->addcellData($rowIndex + 1, $columnIndex + 1, array("DATA" => $value));
         }
     }
     $OOoCalc->save();
     $OOoCalc->close();
     ob_end_clean();
     $OOoCalc->download();
     return true;
 }
Ejemplo n.º 6
0
 /**
  * 
  * Méthode static d'instanciation de class / object;
  * 
  * 
  *
  * @param string  $class nom de class à charger et à instancier ; espace de nommage identique a celle utilisée en java.
  * @param array   $parameters parametres de la class s'il y en a.
  * @param boolean $new_class indique si, lorsque la class est déjà dans le registre, on doit en instancier une nouvelle.
  * @return object un pointeur sur la class instancié
  * @access public
  * @since 1.1
  * @update 06/06/2002
  */
 function &loadClass($class, $parameters = NULL, $new_class = FALSE, $module = NULL)
 {
     APIC::import("org.apicnet.io.File");
     if ($new_class) {
         //	echo(" OK <br>");
         $classname = APIClassRegistry::extractClassName($class);
         if (!APIClassRegistry::isClass($class) || !APIClassRegistry::isRegistered($class)) {
             $path = new File(APIClassRegistry::convertToPath($class, $module) . '.php');
             //		echo($path->getFilePath()."<br>");
             if ($path->exists()) {
                 APIC::import($class, $module);
             } else {
                 die("Class " . $class . " cannot be found");
             }
         }
         $params = '';
         if ($parameters != NULL && is_array($parameters)) {
             $plen = count($parameters);
             if ($plen > 0) {
                 for ($i = 0; $i < $plen; $i++) {
                     $params .= '$parameters[' . $i . ']';
                     if ($i < $plen - 1) {
                         $params .= ', ';
                     }
                 }
             }
         }
         $obj = NULL;
         eval('$obj = new ' . $classname . '(' . $params . ');');
         APIClassRegistry::registerClass($class, $obj);
         return $obj;
     } else {
         // fin du if New_class
         //	APIC::_debug();
         if (APIClassRegistry::isRegistered($class)) {
             //		echo($class." loaded ...");
             return APIClassRegistry::loadClass($class, $parameters);
         } else {
             if (!APIClassRegistry::isClass($class) || !APIClassRegistry::isRegistered($class)) {
                 $path = new File(APIClassRegistry::convertToPath($class, $module) . '.php');
                 //			echo($path->getFilePath()."<br>");
                 if ($path->exists()) {
                     //				echo($class." instanciate ...");
                     APIC::import($class, $module);
                     return APIC::loadClass($class, $parameters, TRUE, $module);
                 } else {
                     die("Class " . $class . " cannot be found");
                 }
             }
         }
     }
 }
Ejemplo n.º 7
0
Copyright (c) 2002-2004 @PICNet

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU LESSER GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
APIC::import("org.apicnet.io.OOo.*");
class OOoDoc extends OOoUtil
{
    var $meta;
    var $content;
    var $setting;
    var $manifest;
    var $fileName;
    var $dirName;
    var $XMLTYPE = array('Writer', 'Calc', 'Impress', 'Draw');
    var $TYPE;
    function OOoDoc()
    {
        $this->TYPE = NULL;
        $this->docExist = FALSE;
        $this->manifest = NULL;
Ejemplo n.º 8
0
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU LESSER GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
APIC::import("org.apicnet.io.OOo.absOOo");
APIC::import("org.apicnet.io.cdir");
class OOoManifest extends absOOo
{
    function OOoManifest($dir)
    {
        parent::absOOo();
        $this->DIRXML = $dir;
        $this->FILENAME = "META-INF/manifest.xml";
        $this->xml = new DOMIT_Document();
        $this->xml->setDocType("<!DOCTYPE manifest:manifest PUBLIC \"-//OpenOffice.org//DTD Manifest 1.0//EN\" \"Manifest.dtd\">");
    }
    function create($type)
    {
        $docManifestNode =& $this->xml->createElement("manifest:manifest");
        $docManifestNode->setAttribute("xmlns:manifest", "http://openoffice.org/2001/manifest");
        $fileEntryNode =& $this->xml->createElement("manifest:file-entry");
Ejemplo n.º 9
0
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
    header("location: index.php");
    exit;
}
/**
* @version 2.0
* @author Nicolas BUI <*****@*****.**>
* 
* This source file is part of JPHP Library Project.
* Copyright: 2002 Vitry sur Seine/FRANCE
*
* The latest version can be obtained from:
* http://www.jphplib.org
*/
APIC::import('org.apicnet.util.StringBuffer');
class File extends ErrorManager
{
    var $path = NULL;
    var $separator = NULL;
    var $os = NULL;
    function File($path = NULL, $new = False)
    {
        $this->separator = DIRECTORY_SEPARATOR;
        $this->os = getenv('OS');
        $this->setFilePath($path);
        if ($new) {
            $this->createFile();
        }
        parent::ErrorManager();
    }