Angel Fernando Quiroz Campos 8 лет назад
Родитель
Сommit
1826f23d58
100 измененных файлов с 0 добавлено и 28677 удалено
  1. 0 43
      main/inc/lib/phpdocx/Readme.txt
  2. 0 91
      main/inc/lib/phpdocx/classes/AutoLoader.inc
  3. 0 134
      main/inc/lib/phpdocx/classes/CreateChartRels.inc
  4. 0 2467
      main/inc/lib/phpdocx/classes/CreateDocx.inc
  5. 0 929
      main/inc/lib/phpdocx/classes/CreateElement.inc
  6. 0 176
      main/inc/lib/phpdocx/classes/CreateExcelSharedStrings.inc
  7. 0 426
      main/inc/lib/phpdocx/classes/CreateExcelSheet.inc
  8. 0 198
      main/inc/lib/phpdocx/classes/CreateExcelTable.inc
  9. 0 230
      main/inc/lib/phpdocx/classes/CreateFontTable.inc
  10. 0 214
      main/inc/lib/phpdocx/classes/CreateFooter.inc
  11. 0 312
      main/inc/lib/phpdocx/classes/CreateFootnote.inc
  12. 0 1746
      main/inc/lib/phpdocx/classes/CreateGraphic.inc
  13. 0 130
      main/inc/lib/phpdocx/classes/CreateHeader.inc
  14. 0 365
      main/inc/lib/phpdocx/classes/CreateImage.inc
  15. 0 263
      main/inc/lib/phpdocx/classes/CreateLink.inc
  16. 0 267
      main/inc/lib/phpdocx/classes/CreateList.inc
  17. 0 299
      main/inc/lib/phpdocx/classes/CreatePage.inc
  18. 0 125
      main/inc/lib/phpdocx/classes/CreateSettings.inc
  19. 0 2643
      main/inc/lib/phpdocx/classes/CreateStyle.inc
  20. 0 540
      main/inc/lib/phpdocx/classes/CreateStyleTable.inc
  21. 0 577
      main/inc/lib/phpdocx/classes/CreateTable.inc
  22. 0 129
      main/inc/lib/phpdocx/classes/CreateTableContents.inc
  23. 0 404
      main/inc/lib/phpdocx/classes/CreateText.inc
  24. 0 1270
      main/inc/lib/phpdocx/classes/CreateTheme1.inc
  25. 0 105
      main/inc/lib/phpdocx/classes/CreateWebSettings.inc
  26. 0 247
      main/inc/lib/phpdocx/classes/CreateXlsx.inc
  27. 0 312
      main/inc/lib/phpdocx/classes/TransformDoc.inc
  28. 0 5
      main/inc/lib/phpdocx/classes/conf/log4php.properties
  29. 0 626
      main/inc/lib/phpdocx/lib/log4php/Logger.php
  30. 0 261
      main/inc/lib/phpdocx/lib/log4php/LoggerAppender.php
  31. 0 55
      main/inc/lib/phpdocx/lib/log4php/LoggerAppenderPool.php
  32. 0 53
      main/inc/lib/phpdocx/lib/log4php/LoggerConfigurator.php
  33. 0 28
      main/inc/lib/phpdocx/lib/log4php/LoggerException.php
  34. 0 126
      main/inc/lib/phpdocx/lib/log4php/LoggerFilter.php
  35. 0 245
      main/inc/lib/phpdocx/lib/log4php/LoggerHierarchy.php
  36. 0 70
      main/inc/lib/phpdocx/lib/log4php/LoggerLayout.php
  37. 0 256
      main/inc/lib/phpdocx/lib/log4php/LoggerLevel.php
  38. 0 110
      main/inc/lib/phpdocx/lib/log4php/LoggerLocationInfo.php
  39. 0 360
      main/inc/lib/phpdocx/lib/log4php/LoggerLoggingEvent.php
  40. 0 116
      main/inc/lib/phpdocx/lib/log4php/LoggerMDC.php
  41. 0 221
      main/inc/lib/phpdocx/lib/log4php/LoggerNDC.php
  42. 0 154
      main/inc/lib/phpdocx/lib/log4php/LoggerReflectionUtils.php
  43. 0 70
      main/inc/lib/phpdocx/lib/log4php/LoggerRoot.php
  44. 0 263
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderAdodb.php
  45. 0 112
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderConsole.php
  46. 0 92
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderDailyFile.php
  47. 0 80
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderEcho.php
  48. 0 170
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderFile.php
  49. 0 131
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderMail.php
  50. 0 179
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderMailEvent.php
  51. 0 60
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderNull.php
  52. 0 296
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderPDO.php
  53. 0 72
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderPhp.php
  54. 0 230
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderRollingFile.php
  55. 0 260
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderSocket.php
  56. 0 212
      main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderSyslog.php
  57. 0 47
      main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorBasic.php
  58. 0 463
      main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorIni.php
  59. 0 134
      main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorPhp.php
  60. 0 441
      main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorXml.php
  61. 0 56
      main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterDenyAll.php
  62. 0 104
      main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterLevelMatch.php
  63. 0 146
      main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterLevelRange.php
  64. 0 89
      main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterStringMatch.php
  65. 0 71
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerBasicPatternConverter.php
  66. 0 44
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerCategoryPatternConverter.php
  67. 0 45
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerClassNamePatternConverter.php
  68. 0 53
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerDatePatternConverter.php
  69. 0 50
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerFormattingInfo.php
  70. 0 57
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerLiteralPatternConverter.php
  71. 0 63
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerLocationPatternConverter.php
  72. 0 50
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerMDCPatternConverter.php
  73. 0 77
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerNamedPatternConverter.php
  74. 0 322
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerOptionConverter.php
  75. 0 138
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerPatternConverter.php
  76. 0 341
      main/inc/lib/phpdocx/lib/log4php/helpers/LoggerPatternParser.php
  77. 0 228
      main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutHtml.php
  78. 0 219
      main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutPattern.php
  79. 0 61
      main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutSimple.php
  80. 0 215
      main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutTTCC.php
  81. 0 222
      main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutXml.php
  82. 0 51
      main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererDefault.php
  83. 0 149
      main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererMap.php
  84. 0 46
      main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererObject.php
  85. 0 28
      main/inc/lib/phpdocx/lib/log4php/tutorials/log4php/log4php.pkg
  86. 0 148
      main/inc/lib/phpdocx/lib/log4php/xml/log4php.dtd
  87. 0 456
      main/inc/lib/phpdocx/pdf/LICENSE.LGPL
  88. 0 323
      main/inc/lib/phpdocx/pdf/dompdf.php
  89. 0 426
      main/inc/lib/phpdocx/pdf/dompdf_config.inc.php
  90. 0 87
      main/inc/lib/phpdocx/pdf/include/absolute_positioner.cls.php
  91. 0 847
      main/inc/lib/phpdocx/pdf/include/abstract_renderer.cls.php
  92. 0 490
      main/inc/lib/phpdocx/pdf/include/attribute_translator.cls.php
  93. 0 297
      main/inc/lib/phpdocx/pdf/include/block_frame_decorator.cls.php
  94. 0 611
      main/inc/lib/phpdocx/pdf/include/block_frame_reflower.cls.php
  95. 0 71
      main/inc/lib/phpdocx/pdf/include/block_positioner.cls.php
  96. 0 114
      main/inc/lib/phpdocx/pdf/include/block_renderer.cls.php
  97. 0 186
      main/inc/lib/phpdocx/pdf/include/cached_pdf_decorator.cls.php
  98. 0 260
      main/inc/lib/phpdocx/pdf/include/canvas.cls.php
  99. 0 83
      main/inc/lib/phpdocx/pdf/include/canvas_factory.cls.php
  100. 0 713
      main/inc/lib/phpdocx/pdf/include/cellmap.cls.php

+ 0 - 43
main/inc/lib/phpdocx/Readme.txt

@@ -1,43 +0,0 @@
-====PHPdocX 2.2 by 2mdc.com====
-http://www.phpdocx.com/
-
-PHPDOCX is a PHP library designed to dynamically generate reports in Word format (WordprocessingML).
-
-The reports may be built from any available data source like a MySQL database or a spreadsheet. The resulting documents remain fully editable in Microsoft Word (or any other compatible software like Open Office) and therefore the final users are able to modify them as necessary.
-
-The formatting capabilities of the library allow the programmers to generate dynamically and programmatically all the standard rich formatting of a typical word processor.
-
-This library also provides an easy method to generate documents in other standard formats such as PDF or HTML.
-
-====What's new on PHPdocX 2.2?====
-
-- OpenOffice Support. Now all the PHPdocx's generated documents are compatible with OpenOficce. Note: OpenOffice has limited support to represent some features of .docx documents.
-
-====What are the minimum technical requirements?====
-To run PHPDocX you need to have a functional LAMP setup, this should include:
-
-- PHP5
-- Required : Support ZipArchive and XSLT
-- A data source such as a MySQL database, an Excel spreadsheet or an CSV file.
-- Apache 2.x +
-- A functional version of Word 2007 or newer is required to generate legacy versions (Word 97 - 2004 .doc documents)
-
-====LICENSES====
-PhpdocX is available under four different licenses:
-
-- Free. LGPL licensed (http://www.gnu.org/licenses/lgpl.html): this is the most economical way to access PHPdocX and allows you to try many of its functions without limitations. It can be downloaded for free from http://www.phpdocx.com
-
-- Pro: Priced at USD 90 (EUR 73), PhpdocX Pro version adds many customizable features.
-
-- Pro (on Site). This version includes the installation of the library on your server, custom templates and maintenance for one year. Request a quote for this option.
-
-- Pro (on Site - Multisite). This version includes custom templates, maintenance for one year and installation on multiple sites. Request a quote for this option.
-
-====What are the main differences between PHPdocX Free and PHPdocX Pro?====
-PHPdocX Free allows you to dynamically generate docx files with simple formating options such as lists, page numbering and tables, no watermarks are embedded and there is no trail period or limit in the amount of documents you can generate. PHPdocX Pro extends this functionality and allows you to include nested lists, text boxes, customized headers and footers, 3D graphs, MathML features and it also allows you to create Word 97 - 2004 .doc documents.
-
-You can access a table comparing the features of the free version and the Pro version at: http://www.phpdocx.com/features
-
-You can download the Free, LGPL version or the Pro Version from http://www.phpdocx.com/
-
-PHPDocX is developed by 2mdc (http://www.2mdc.com).

+ 0 - 91
main/inc/lib/phpdocx/classes/AutoLoader.inc

@@ -1,91 +0,0 @@
-<?php
-
-/**
- * Autoloader
- *
- * @category   Phpdocx
- * @package    loader
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    2.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 2.0
- */
-
-/**
- * Autoloader
- *
- * @category   Phpdocx
- * @package    loader
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    2.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 2.0
- */
-class AutoLoader
-{
-
-    /**
-     * Autoload dompdf
-     *
-     * @access private
-     * @param string $className Class to load
-     */
-    private static function autoloadDompdf($className)
-    {
-        $pathDompdf = dirname(__FILE__) . '/../pdf/dompdf_config.inc.php';
-        if (file_exists($pathDompdf)) {
-            require_once $pathDompdf;
-        }
-    }
-
-    /**
-     * Autoload log4php
-     *
-     * @access private
-     * @param string $className Class to load
-     */
-    private static function autoloadLog4php($className)
-    {
-        $pathLogphp = dirname(__FILE__) . '/../lib/log4php/'
-                . $className . '.php';
-        if (file_exists($pathLogphp)) {
-            require_once $pathLogphp;
-        }
-    }
-
-    /**
-     * Autoload phpdocx
-     *
-     * @access private
-     * @param string $className Class to load
-     */
-    private static function autoloadPhpdocx($className)
-    {
-        $pathPhpdocx = dirname(__FILE__) . '/' . $className . '.inc';
-        if (file_exists($pathPhpdocx)) {
-            require_once $pathPhpdocx;
-        }
-    }
-
-    /**
-     * Main tags of relationships XML
-     *
-     * @access public
-     * @static
-     */
-    public static function load()
-    {
-        spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));
-        spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));
-    }
-
-    public static function loadPDF()
-    {
-        spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));
-    }
-
-}

+ 0 - 134
main/inc/lib/phpdocx/classes/CreateChartRels.inc

@@ -1,134 +0,0 @@
-<?php
-
-/**
- * Create relationships used by images, charts...
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create relationships used by images, charts...
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateChartRels extends CreateElement
-{
-
-    /**
-     * 
-     * @access protected
-     */
-    protected $_xml;
-    /**
-     *
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     * Magic method, returns current XML
-     *
-     * @access public
-     * @return string Return current XML
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     * Singleton, return instance of class
-     *
-     * @access public
-     * @return CreateChartRels
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateChartRels();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create relationship document to use in DOCX file
-     *
-     * @access public
-     * @param int $idChart
-     */
-    public function createRelationship($idChart)
-    {
-        $this->generateRELATIONSHIPS();
-        $this->generateRELATIONSHIP($idChart);
-        $this->cleanTemplate();
-    }
-
-    /**
-     * New relationship, added to relationships XML
-     *
-     * @access protected
-     * @param int $idChart
-     * @param int $id. Optional, use 1 as default
-     */
-    protected function generateRELATIONSHIP($idChart, $id = 1)
-    {
-        $xml = '<Relationship Id="rId' . $id . '" Type="http://schemas.open'
-            . 'xmlformats.org/officeDocument/2006/relationships/package" '
-            . 'Target="../embeddings/datos' . $idChart
-            . '.xlsx"></Relationship>__GENERATECHARTSPACE__';
-
-        $tag = '__GENERATERELATIONSHIPS__';
-
-        $this->_xml = str_replace($tag, $xml, $this->_xml);
-    }
-
-    /**
-     * Main tags of relationships XML
-     *
-     * @access protected
-     */
-    protected function generateRELATIONSHIPS()
-    {
-        $this->_xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'
-            . '<Relationships xmlns="http://schemas.openxmlformats.org/'
-            . 'package/2006/relationships">__GENERATERELATIONSHIPS__'
-            . '</Relationships>';
-    }
-
-}

+ 0 - 2467
main/inc/lib/phpdocx/classes/CreateDocx.inc

@@ -1,2467 +0,0 @@
-<?php
-
-/**
- * Generate a DOCX file
- *
- * @category   Phpdocx
- * @package    create
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-
-error_reporting(E_ALL & ~E_NOTICE);
-
-require_once dirname(__FILE__) . '/AutoLoader.inc';
-AutoLoader::load();
-
-/**
- * Main class. Methods and vars to generate a DOCX file
- *
- * @category   Phpdocx
- * @package    create
- * @copyright  Copyright (c) 2009-2011 Narcea ProduCiones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateDocx
-{
-    const NAMESPACEWORD = 'w';
-    const SCHEMA_IMAGEDOCUMENT =
-    'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image';
-    const SCHEMA_OFFICEDOCUMENT =
-    'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument';
-
-    /**
-     *
-     * @access public
-     * @static
-     * @var int
-     */
-    public static $intIdWord;
-    /**
-     *
-     * @access public
-     * @var string
-     */
-    public $graphicTemplate;
-    /**
-     *
-     * @access public
-     * @var array
-     */
-    public $fileGraphicTemplate;
-    /**
-     *
-     * @access public
-     * @static
-     * @var Logger
-     */
-    public static $log;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_contentTypeC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_defaultFont;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_docPropsAppC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_docPropsAppT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_docPropsCoreC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_docPropsCoreT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_docPropsCustomC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_docPropsCustomT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private static $_encodeUTF;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_extension;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_idImgHeader;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_idRels;
-    /**
-     *
-     * @access private
-     * @var array
-     */
-    private $_idWords;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_language;
-    /**
-     *
-     * @access private
-     * @var boolean
-     */
-    private $_macro;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_relsRelsC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_relsRelsT;
-    /**
-     * Path of temp file to use as DOCX file
-     *
-     * @access private
-     * @var string
-     */
-    private $_tempFile;
-    /**
-     * Paths of temps files to use as DOCX file
-     *
-     * @access private
-     * @var array
-     */
-    private $_tempFileXLSX;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordDocumentC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordDocumentT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordEndnotesC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordEndnotesT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordFontTableC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordFontTableT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordFooterC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordFooterT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordFootnotesC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordFootnotesT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordHeaderC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordHeaderT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordNumberingC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordNumberingT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordRelsDocumentRelsC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordRelsDocumentRelsT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordRelsFooterRelsC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordRelsFooterRelsT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordRelsHeaderRelsC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordRelsHeaderRelsT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordSettingsC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordSettingsT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordStylesC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordStylesT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordThemeThemeT;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordThemeThemeC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordWebSettingsC;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_wordWebSettingsT;
-    /**
-     *
-     * @access private
-     * @var ZipArchive
-     */
-    private $_zipDocx;
-
-    /**
-     * Construct
-     *
-     * @access public
-     * @param string $extension File extension. Optional, docx as default
-     */
-    public function __construct($extension = 'docx')
-    {
-        $this->_idRels = array();
-        $this->_idWords = array();
-        Logger::configure(dirname(__FILE__) . '/conf/log4php.properties');
-        self::$log = Logger::getLogger('phpdocx_error');
-        $this->_idImgHeader = 1;
-        $this->_idRels = 1;
-        self::$intIdWord = 0;
-        self::$_encodeUTF = 0;
-        $this->_language = 'en-US';
-        $this->graphicTemplate = array();
-        $this->fileGraphicTemplate = array();
-        $this->_zipDocx = new ZipArchive();
-        $this->_tempFile = tempnam(sys_get_temp_dir(), 'document');
-        $this->_zipDocx->open($this->_tempFile, ZipArchive::OVERWRITE);
-        $this->_extension = $extension;
-        $this->_relsRelsC = '';
-        $this->_relsRelsT = '';
-        $this->_contentTypeC = '';
-        $this->_docPropsAppC = '';
-        $this->_docPropsAppT = '';
-        $this->_docPropsCoreC = '';
-        $this->_docPropsCoreT = '';
-        $this->_docPropsCustomC = '';
-        $this->_docPropsCustomT = '';
-        $this->_tempFileXLSX = array();
-        $this->_wordDocumentT = '';
-        $this->_wordDocumentC = '';
-        $this->_wordEndnotesC = '';
-        $this->_wordEndnotesT = '';
-        $this->_wordFontTableT = '';
-        $this->_wordFontTableC = '';
-        $this->_wordFooterC = '';
-        $this->_wordFooterT = '';
-        $this->_wordFootnotesC = '';
-        $this->_wordFootnotesT = '';
-        $this->_wordHeaderC = '';
-        $this->_wordHeaderT = '';
-        $this->_wordNumberingC;
-        $this->_wordNumberingT;
-        $this->_wordRelsDocumentRelsC = '';
-        $this->_wordRelsDocumentRelsT = '';
-        $this->_wordRelsHeaderRelsC = '';
-        $this->_wordRelsHeaderRelsT = '';
-        $this->_wordRelsFooterRelsC = '';
-        $this->_wordRelsFooterRelsT = '';
-        $this->_xmlWordSettings = '';
-        $this->_wordSettingsT = '';
-        $this->_wordSettingsC = '';
-        $this->_xmlWordStyles = '';
-        $this->_wordStylesT = '';
-        $this->_wordStylesC = '';
-        $this->_wordThemeThemeT = '';
-        $this->_wordThemeThemeC = '';
-        $this->_macro = 0;
-        $this->_xmlWordWebSettings = '';
-        $this->generateContentType();
-        $this->_defaultFont = '';
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     * Magic method, returns current word XML
-     *
-     * @access public
-     * @return string Return current word
-     */
-    public function __toString()
-    {
-        $this->generateTemplateWordDocument();
-        return $this->_wordDocumentT;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlContentTypes($xmlContentTypes)
-    {
-        $this->_contentTypeC = $xmlContentTypes;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlContentTypes()
-    {
-        return $this->_contentTypeC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlRelsRels($xmlRelsRels)
-    {
-        $this->_relsRelsC = $xmlRelsRels;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlRels_Rels()
-    {
-        return $this->_relsRelsC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlDocPropsApp($xmlDocPropsApp)
-    {
-        $this->_docPropsAppC = $xmlDocPropsApp;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlDocPropsApp()
-    {
-        return $this->_docPropsAppC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlDocPropsCore($xmlDocPropsCore)
-    {
-        $this->_docPropsCoreC = $xmlDocPropsCore;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlDocPropsCore()
-    {
-        return $this->_docPropsCoreC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordDocument($xmlWordDocument)
-    {
-        $this->_wordDocumentC = $xmlWordDocument;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordDocumentContent()
-    {
-        return $this->_wordDocumentC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordEndnotes($xmlWordEndnotes)
-    {
-        $this->_wordEndnotesC = $xmlWordEndnotes;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordEndnotes()
-    {
-        return $this->_wordEndnotesC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordFontTable($xmlWordFontTable)
-    {
-        $this->_wordFontTableC = $xmlWordFontTable;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordFontTable()
-    {
-        return $this->_wordFontTableC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordFooter1($xmlWordFooter)
-    {
-        $this->_wordFooterC = $xmlWordFooter;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordFooter1()
-    {
-        return $this->_wordFooterC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordHeader1($xmlWordHeader)
-    {
-        $this->_wordHeaderC = $xmlWordHeader;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordHeader1()
-    {
-        return $this->_wordHeaderC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordRelsDocumentRels($xmlWordRelsDocumentRels)
-    {
-        $this->_wordRelsDocumentRelsC = $xmlWordRelsDocumentRels;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordRelsDocumentRels()
-    {
-        return $this->_wordRelsDocumentRelsC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordSettings($xmlWordSettings)
-    {
-        $this->_wordSettingsC = $xmlWordSettings;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordSettings()
-    {
-        return $this->_wordSettingsC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordStyles($xmlWordStyles)
-    {
-        $this->_wordStylesC = $xmlWordStyles;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordStyles()
-    {
-        return $this->_wordStylesC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordThemeTheme1($xmlWordThemeTheme)
-    {
-        $this->_wordThemeThemeC = $xmlWordThemeTheme;
-    }
-
-    /**
-     * Getter
-     *
-     * @access public
-     */
-    public function getXmlWordThemeTheme1()
-    {
-        return $this->_wordThemeThemeC;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function setXmlWordWebSettings($xmlWordWebSettings)
-    {
-        $this->_wordWebSettingsC = $xmlWordWebSettings;
-    }
-
-    /**
-     * Setter
-     *
-     * @access public
-     */
-    public function getXmlWordWebSettings()
-    {
-        return $this->_wordWebSettingsC;
-    }
-
-    /**
-     * Add a break
-     *
-     * @access public
-     * @param string $type Break type
-     *  Values: 'line', 'page'
-     */
-    public function addBreak($type = '')
-    {
-        $page = CreatePage::getInstance();
-        $page->generatePageBreak($type);
-        $this->_wordDocumentC .= (string) $page;
-    }
-
-    /**
-     * Add a new font
-     *
-     * @access public
-     * @param array $fonts Fonts to add
-     */
-    public function addFont($fonts)
-    {
-        $font = CreateFontTable::getInstance();
-        $font->createFont($fonts);
-        $this->_wordFontTableC .= (string) $font;
-    }
-
-    /**
-     * Add a footer
-     *
-     * @access public
-     * @param string $dat Text to add
-     * @param array $paramsFooter Parameters of footer
-     *  Values: 'pager' (true, false), 'pagerAlignment' (left, right, false)
-     */
-    public function addFooter($dat = '', $paramsFooter = '')
-    {
-        $footer = CreateFooter::getInstance();
-        $footer->createFooter($dat, $paramsFooter);
-        $this->_wordFooterC .= (string) $footer;
-        $this->generateOVERRIDE(
-            '/word/footer.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml' .
-            '.footer+xml'
-        );
-    }
-
-    /**
-     * Add a graphic
-     *
-     * @access public
-     * @param array $dats Parameters of graphic
-     *  Values: 'color' (1, 2, 3...), 'cornerP' (20, 30...),
-     *  'cornerX' (20, 30...), 'cornerY' (20, 30...), 'data' (array of values),
-     *  'font' (Arial, Times New Roman...), 'groupBar' (clustered, stacked),
-     *  'jc' (center, left, right), 'showPercent' (0, 1), 'sizeX' (10, 11,
-     *   12...), 'sizeY' (10, 11, 12...), 'textWrap' (0 (inline), 1 (square),
-     *  2 (front), 3 (back), 4 (up and bottom), 5 (clear)), 'title', 'type'
-     *  (pieChart, barChart, colChart)
-     */
-    public function addGraphic($dats)
-    {
-        try {
-            if (isset($dats['data']) && isset($dats['type'])) {
-                self::$intIdWord++;
-                $graphic = CreateGraphic::getInstance();
-                if ($graphic->createGraphic(self::$intIdWord, $dats) != false) {
-                    $this->_zipDocx->addFromString(
-                        'word/charts/chart' . self::$intIdWord . '.xml',
-                        $graphic->getXmlChart()
-                    );
-                    $this->_wordRelsDocumentRelsC .=
-                        $this->generateRELATIONSHIP(
-                            'rId' . self::$intIdWord, 'chart',
-                            'charts/chart' . self::$intIdWord . '.xml'
-                        );
-                    $this->_wordDocumentC .= (string) $graphic;
-                    $this->generateDEFAULT('xlsx', 'application/octet-stream');
-                    $this->generateOVERRIDE(
-                        '/word/charts/chart' . self::$intIdWord . '.xml',
-                        'application/vnd.openxmlformats-officedocument.' .
-                        'drawingml.chart+xml'
-                    );
-                } else {
-                    throw new Exception(
-                        'There was an error related to the chart.'
-                    );
-                }
-                $excel = CreateXlsx::getInstance();
-                $this->_tempFileXLSX[self::$intIdWord] = tempnam(sys_get_temp_dir(), 'documentxlsx');
-                if (
-                    $excel->createXlsx(
-                        $this->_tempFileXLSX[self::$intIdWord],
-                        $dats['data'], $dats['type']
-                    ) != false
-                ) {
-                    $this->_zipDocx->addFile(
-                        $this->_tempFileXLSX[self::$intIdWord],
-                        'word/embeddings/datos' . self::$intIdWord . '.xlsx'
-                    );
-
-                    $chartRels = CreateChartRels::getInstance();
-                    $chartRels->createRelationship(self::$intIdWord);
-                    $this->_zipDocx->addFromString(
-                        'word/charts/_rels/chart' . self::$intIdWord .
-                        '.xml.rels',
-                        (string) $chartRels
-                    );
-                }
-            } else {
-                throw new Exception(
-                    'Images must have "data" and "type" values.'
-                );
-            }
-        }
-        catch (Exception $e) {
-            self::$log->fatal($e->getMessage());
-            exit();
-        }
-    }
-
-    /**
-     * Add a header.
-     *
-     * @access public
-     * @param string $text Text to add
-     * @param array $paramsHeader Parameters of header
-     */
-    public function addHeader($text = 'Header', $paramsHeader = '')
-    {
-        $header = CreateHeader::getInstance();
-        $header->createHeader($text, $paramsHeader);
-        $this->_wordHeaderC .= (string) $header;
-        $this->generateOVERRIDE(
-            '/word/header.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml.' .
-            'header+xml'
-        );
-    }
-
-    /**
-     * Add an image
-     *
-     * @access public
-     * @param array $dats Image to add and paramaters to use
-     *  Values: 'border'(1, 2, 3...), 'borderDiscontinuous' (0, 1),
-     *  'font' (Arial, Times New Roman...), 'jc' (center, left, right),
-     *  'name', 'scaling' (50, 100), 'sizeX' (10, 11, 12...), 'sizeY'
-     *  (10, 11, 12...), spacingTop (10, 11...), spacingBottom (10, 11...),
-     *  spacingLeft (10, 11...), spacingRight (10, 11...), 'textWrap'
-     *  (0 (inline), 1 (square), 2 (front), 3 (back), 4 (up and bottom),
-     *  5 (clear))
-     */
-    public function addImage($dats = '')
-    {
-        try {
-            if (isset($dats['name']) && file_exists($dats['name']) == 'true') {
-                $attrImage = getimagesize($dats['name']);
-                try {
-                    if ($attrImage['mime'] == 'image/jpg' ||
-                        $attrImage['mime'] == 'image/jpeg' ||
-                        $attrImage['mime'] == 'image/png' ||
-                        $attrImage['mime'] == 'image/gif'
-                    ) {
-                        self::$intIdWord++;
-                        $image = CreateImage::getInstance();
-                        $dats['rId'] = self::$intIdWord;
-                        $image->createImage($dats);
-                        $this->_wordDocumentC .= (string) $image;
-                        $dir = $this->parsePath($dats['name']);
-                        $this->_zipDocx->addFile(
-                            $dats['name'], 'word/media/image' .
-                            self::$intIdWord . '.' .
-                            $dir['extension']
-                        );
-                        $this->generateDEFAULT(
-                            $dir['extension'], $attrImage['mime']
-                        );
-                        if ((string) $image != '')
-                            $this->_wordRelsDocumentRelsC .=
-                                $this->generateRELATIONSHIP(
-                                    'rId' . self::$intIdWord, 'image',
-                                    'media/image' . self::$intIdWord . '.'
-                                    . $dir['extension']
-                                );
-                    } else {
-                        throw new Exception('Image format is not supported.');
-                    }
-                }
-                catch (Exception $e) {
-                    self::$log->fatal($e->getMessage());
-                    exit();
-                }
-            } else {
-                throw new Exception('Image does not exist.');
-            }
-        }
-        catch (Exception $e) {
-            self::$log->fatal($e->getMessage());
-            exit();
-        }
-    }
-
-    /**
-     * Add a link
-     *
-     * @access public
-     * @param string $text Text to use as link
-     * @param string $link URL link
-     * @param string $font Type of font
-     *  Values: 'Arial', 'Times New Roman'...
-     */
-    public function addLink($text = '', $textLink = '', $font = '')
-    {
-        $link = CreateLink::getInstance();
-        $link->createLink($text, $textLink, $font);
-        $this->_wordDocumentC .= (string) $link;
-    }
-
-    /**
-     * Add a list
-     *
-     * @access public
-     * @param array $dats Values of the list
-     * @param array $paramsList Parameters to use
-     *  Values: 'font' (Arial, Times New Roman...),
-     *  'val' (0 (clear, 1 (inordinate), 2(numerical))
-     */
-    public function addList($dats, $paramsList = '')
-    {
-        $list = CreateList::getInstance();
-        $list->createList($dats, $paramsList);
-        $this->_wordDocumentC .= (string) $list;
-    }
-
-    /**
-     * Convert a math eq to DOCX
-     *
-     * @access public
-     * @param string $path Path to a file with math eq
-     */
-    public function addMathDocx($path)
-    {
-        $package = new ZipArchive();
-        $package->open($path);
-        $document = $package->getFromName('word/document.xml');
-        $eqs = preg_split('/<[\/]*m:oMathPara>/', $document);
-        $this->addMathEq('<m:oMathPara>' . $eqs[1] . '</m:oMathPara>');
-        $package->close();
-    }
-
-    /**
-     * Add an existing math eq to DOCX
-     *
-     * @access public
-     * @param string $eq Math eq
-     */
-    public function addMathEq($eq)
-    {
-        $this->_wordDocumentC .= '<' . CreateDocx::NAMESPACEWORD . ':p>' .
-            (string) $eq . '</' . CreateDocx::NAMESPACEWORD . ':p>';
-    }
-
-    /**
-     * Add a paragraph
-     *
-     * @access public
-     * @param string $text Text to add
-     * @param string $style Style of the paragraph
-     * @param string $align Align of the paragraph
-     */
-    public function addParagraph($text, $style = '', $align = '')
-    {
-        $paragraph = CreateText::getInstance();
-        $paragraph->createParagraph($text, $style, $align);
-        $this->_wordDocumentC .= (string) $paragraph;
-    }
-
-    /**
-     * Add a table.
-     *
-     * @access public
-     * @param array $dats Values to add
-     * @param array $parameters Parameters to use
-     *  Values: 'border' (none, single, double),
-     *  'border_color' (ffffff, ff0000), 'border_spacing' (0, 1, 2...),
-     *  'border_sz' (10, 11...), 'font' (Arial, Times New Roman...),
-     *  'jc' (center, left, right), 'size_col' (1200, 1300...),
-     *  'TBLSTYLEval' (Cuadrculamedia3-nfasis1, Sombreadomedio1,
-     *  Tablaconcuadrcula, TableGrid)
-     */
-    public function addTable($dats, $parameters = '')
-    {
-        $table = CreateTable::getInstance();
-        $table->createTable($dats, $parameters);
-        $this->_wordDocumentC .= (string) $table;
-    }
-
-    /**
-     * Add a table of contents (TOC)
-     *
-     * @access public
-     * @param string $font Set font type
-     *  Values: 'Arial', 'Times New Roman'...
-     */
-    public function addTableContents($font = '')
-    {
-        $tableContents = CreateTableContents::getInstance();
-        $tableContents->createTableContents($font);
-        $this->_wordDocumentC .= (string) $tableContents;
-    }
-
-    /**
-     * Add a text
-     *
-     * @access public
-     * @param mixed $value Text or array of texts to add
-     * @param array $style Style of text
-     *  Values: 'b' (single), 'color' (ffffff, ff0000...),
-     *  'font' (Arial, Times New Roman...), 'i' (single),
-     *  'jc' (both, center, distribute, left, right),
-     *  'pageBreakBefore' (on, off), 'sz' (1, 2, 3...),
-     *  'u' (dash, dotted, double, single, wave, words),
-     *  'widowControl' (on, off), 'wordWrap' (on, off)
-     */
-    public function addText($value, $style = '')
-    {
-        $text = CreateText::getInstance();
-        $text->createText($value, $style);
-        $this->_wordDocumentC .= (string) $text;
-    }
-
-    /**
-     * Add a title
-     *
-     * @access public
-     * @param string $text Text to add
-     * @param array $style Style of title
-     *  Values: 'b' (single), 'color' (ffffff, ff0000...),
-     *  'font' (Arial, Times New Roman...), 'i' (single),
-     *  'jc' (both, center, distribute, left, right),
-     *  'pageBreakBefore' (on, off), 'sz' (1, 2, 3...),
-     *  'u' (dash, dotted, double, single, wave, words),
-     *  'widowControl' (on, off), 'wordWrap' (on, off)
-     */
-    public function addTitle($text, $style = '')
-    {
-        $title = CreateText::getInstance();
-        $title->createTitle($text, $style);
-        $this->_wordDocumentC .= (string) $title;
-    }
-
-    /**
-     * Generate a new DOCX file
-     *
-     * @access public
-     * @param string $args[0] File name
-     * @param string $args[1] Page style
-     *  Values: 'bottom' (4000, 4001...), 'left' (4000, 4001...),
-     *  'orient' (landscape), 'right' (4000, 4001), 'titlePage' (1),
-     *  'top' (4000, 4001)
-     */
-    public function createDocx()
-    {
-        $args = func_get_args();
-        if (!empty($args[0])) {
-            $fileName = $args[0];
-        } else {
-            $fileName = 'document';
-        }
-        $this->generateTemplateRelsRels();
-        $this->_zipDocx->addFromString('_rels/.rels', $this->_relsRelsT);
-        $this->generateTemplateDocPropsApp();
-        $this->_zipDocx->addFromString(
-            'docProps/app.xml', $this->_docPropsAppT
-        );
-        $this->generateTemplateDocPropsCore();
-        $this->_zipDocx->addFromString(
-            'docProps/core.xml', $this->_docPropsCoreT
-        );
-
-        $this->addStyle($this->_language);
-        $this->generateTemplateWordStyles();
-        $this->_zipDocx->addFromString(
-            'word/styles.xml', $this->_wordStylesT
-        );
-
-        $this->addSettings();
-        $this->generateTemplateWordSettings();
-        $this->_zipDocx->addFromString(
-            'word/settings.xml', $this->_wordSettingsT
-        );
-
-        $this->addWebSettings();
-        $this->generateTemplateWordWebSettings();
-        $this->_zipDocx->addFromString(
-            'word/webSettings.xml', $this->_wordWebSettingsT
-        );
-        if (empty($this->_wordFooterC)) {
-            $paramsFooter = array(
-                    'pagerAlignment' => 'right',
-                    'font' => 'Times New Roman'
-                );
-            $this->addFooter('', $paramsFooter);
-        }
-        $this->generateTemplateWordFooter();
-        if (self::$_encodeUTF) {
-            $this->_zipDocx->addFromString(
-                'word/footer.xml', utf8_encode($this->_wordFooterT)
-            );
-        } else {
-            $this->_zipDocx->addFromString(
-                'word/footer.xml', $this->_wordFooterT
-            );
-        }
-
-        if (!empty($this->_wordHeaderC)) {
-            $this->generateTemplateWordHeader();
-            if (self::$_encodeUTF) {
-                $this->_zipDocx->addFromString(
-                    'word/header.xml', utf8_encode($this->_wordHeaderT)
-                );
-            } else {
-                $this->_zipDocx->addFromString(
-                    'word/header.xml', $this->_wordHeaderT
-                );
-            }
-        }
-        if (!empty($this->_wordRelsHeaderRelsC)) {
-            $this->generateTemplateWordRelsHeaderRels();
-            $this->_zipDocx->addFromString(
-                'word/_rels/header.xml.rels', $this->_wordRelsHeaderRelsT
-            );
-        }
-
-        $this->generateOVERRIDE(
-            '/word/document.xml',
-            'application/vnd.openxmlformats-officedocument.' .
-            'wordprocessingml.document.main+xml'
-        );
-
-        $this->generateTemplateContentType();
-        $this->_zipDocx->addFromString(
-            '[Content_Types].xml',
-            $this->_wordContentTypeT
-        );
-
-        $this->generateTemplateWordNumbering();
-        $this->_zipDocx->addFromString(
-            'word/numbering.xml', $this->_wordNumberingT
-        );
-
-        $this->generateDefaultWordRels();
-        if (!empty($this->_wordRelsDocumentRelsC)) {
-            $this->generateTemplateWordRelsDocumentRels();
-            $this->_zipDocx->addFromString(
-                'word/_rels/document.xml.rels',
-                $this->_wordRelsDocumentRelsT
-            );
-        }
-        $arrArgsPage = array();
-        if (isset($args[1])) {
-            $arrArgsPage = $args[1];
-        }
-        $this->generateTemplateWordDocument($arrArgsPage);
-
-        if (self::$_encodeUTF) {
-            $this->_zipDocx->addFromString(
-                'word/document.xml', utf8_encode($this->_wordDocumentT)
-            );
-        } else {
-            $this->_zipDocx->addFromString(
-                'word/document.xml', $this->_wordDocumentT
-            );
-        }
-
-        $this->generateDefaultFonts();
-        $this->generateTemplateWordFontTable();
-        $this->_zipDocx->addFromString(
-            'word/fontTable.xml', $this->_wordFontTableT
-        );
-
-        $this->generateTemplateWordThemeTheme1();
-        $this->_zipDocx->addFromString(
-            'word/theme/theme1.xml', $this->_wordThemeThemeT
-        );
-
-        $this->_zipDocx->close();
-
-        $arrpathFile = pathinfo($fileName);
-        copy(
-            $this->_tempFile,
-            $fileName . '.' . $this->_extension
-        );
-    }
-
-    /**
-     * Change the default font
-     *
-     * @access public
-     * @param string $font The new font
-     *  Values: 'Arial', 'Times New Roman'...
-     */
-    public function setDefaultFont($font)
-    {
-        $this->_defaultFont = $font;
-    }
-
-    /**
-     * Transform to UTF-8 charset
-     *
-     * @access public
-     */
-    public function setEncodeUTF8()
-    {
-        self::$_encodeUTF = 1;
-    }
-
-    /**
-     * Change default language.
-     * @param $lang Locale: en-US, es-ES...
-     * @access public
-     */
-    public function setLanguage($lang = 'en-US')
-    {
-        $this->_language = $lang;
-    }
-
-    /*** Old API. It will be remove in next version ***/
-
-    /**
-     * Add a break
-     *
-     * @access public
-     * @param string $type Break type
-     * @deprecated
-     */
-    public function fAddBreak($type = '')
-    {
-        $page = CreatePage::getInstance();
-        $page->generatePageBreak($type);
-        $this->_wordDocumentC .= (string) $page;
-    }
-
-    /**
-     * Add a new font
-     *
-     * @access public
-     * @param array $fonts Fonts to add
-     * @deprecated
-     */
-    public function fAddFont($fonts)
-    {
-        $font = CreateFontTable::getInstance();
-        $font->createFont($fonts);
-        $this->_wordFontTableC .= (string) $font;
-    }
-
-    /**
-     * Add a footer
-     *
-     * @access public
-     * @param string $dat Text to add
-     * @param array $paramsFooter Parameters of footer
-     * @deprecated
-     */
-    public function fAddFooter($dat = '', $paramsFooter = '')
-    {
-        $footer = CreateFooter::getInstance();
-        $footer->createFooter($dat, $paramsFooter);
-        $this->_wordFooterC .= (string) $footer;
-        $this->generateOVERRIDE(
-            '/word/footer.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml' .
-            '.footer+xml'
-        );
-    }
-
-    /**
-     * Add a graphic
-     *
-     * @access public
-     * @param array $dats Parameters of graphic
-     * @deprecated
-     */
-    public function fAddGraphic($dats)
-    {
-        try {
-            if (isset($dats['data']) && isset($dats['type'])) {
-                self::$intIdWord++;
-                $graphic = CreateGraphic::getInstance();
-                if ($graphic->createGraphic(self::$intIdWord, $dats) != false) {
-                    $this->_zipDocx->addFromString(
-                        'word/charts/chart' . self::$intIdWord . '.xml',
-                        $graphic->getXmlChart()
-                    );
-                    $this->_wordRelsDocumentRelsC .=
-                        $this->generateRELATIONSHIP(
-                            'rId' . self::$intIdWord, 'chart',
-                            'charts/chart' . self::$intIdWord . '.xml'
-                        );
-                    $this->_wordDocumentC .= (string) $graphic;
-                    $this->generateDEFAULT('xlsx', 'application/octet-stream');
-                    $this->generateOVERRIDE(
-                        '/word/charts/chart' . self::$intIdWord . '.xml',
-                        'application/vnd.openxmlformats-officedocument.' .
-                        'drawingml.chart+xml'
-                    );
-                } else {
-                    throw new Exception(
-                        'There was an error related to the chart.'
-                    );
-                }
-                $excel = CreateXlsx::getInstance();
-                $this->_tempFileXLSX[self::$intIdWord] = tempnam(sys_get_temp_dir(), 'documentxlsx');
-                if (
-                    $excel->createXlsx(
-                        $this->_tempFileXLSX[self::$intIdWord],
-                        $dats['data'], $dats['type']
-                    ) != false
-                ) {
-                    $this->_zipDocx->addFile(
-                        $this->_tempFileXLSX[self::$intIdWord],
-                        'word/embeddings/datos' . self::$intIdWord . '.xlsx'
-                    );
-
-                    $chartRels = CreateChartRels::getInstance();
-                    $chartRels->createRelationship(self::$intIdWord);
-                    $this->_zipDocx->addFromString(
-                        'word/charts/_rels/chart' . self::$intIdWord .
-                        '.xml.rels',
-                        (string) $chartRels
-                    );
-                }
-            } else {
-                throw new Exception(
-                    'Images must have "data" and "type" values.'
-                );
-            }
-        }
-        catch (Exception $e) {
-            self::$log->fatal($e->getMessage());
-            exit();
-        }
-    }
-
-    /**
-     * Add a header.
-     *
-     * @access public
-     * @param string $text Text to add
-     * @param array $paramsHeader Parameters of header
-     * @deprecated
-     */
-    public function fAddHeader($text = 'Header', $paramsHeader = '')
-    {
-        $header = CreateHeader::getInstance();
-        $header->createHeader($text, $paramsHeader);
-        $this->_wordHeaderC .= (string) $header;
-        $this->generateOVERRIDE(
-            '/word/header.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml.' .
-            'header+xml'
-        );
-    }
-
-    /**
-     * Add an image
-     *
-     * @access public
-     * @param array $dats Image to add and paramaters to use
-     * @deprecated
-     */
-    public function fAddImage($dats = '')
-    {
-        try {
-            if (isset($dats['name']) && file_exists($dats['name']) == 'true') {
-                $attrImage = getimagesize($dats['name']);
-                try {
-                    if ($attrImage['mime'] == 'image/jpg' ||
-                        $attrImage['mime'] == 'image/jpeg' ||
-                        $attrImage['mime'] == 'image/png' ||
-                        $attrImage['mime'] == 'image/gif'
-                    ) {
-                        self::$intIdWord++;
-                        $image = CreateImage::getInstance();
-                        $dats['rId'] = self::$intIdWord;
-                        $image->createImage($dats);
-                        $this->_wordDocumentC .= (string) $image;
-                        $dir = $this->parsePath($dats['name']);
-                        $this->_zipDocx->addFile(
-                            $dats['name'], 'word/media/image' .
-                            self::$intIdWord . '.' .
-                            $dir['extension']
-                        );
-                        $this->generateDEFAULT(
-                            $dir['extension'], $attrImage['mime']
-                        );
-                        if ((string) $image != '')
-                            $this->_wordRelsDocumentRelsC .=
-                                $this->generateRELATIONSHIP(
-                                    'rId' . self::$intIdWord, 'image',
-                                    'media/image' . self::$intIdWord . '.'
-                                    . $dir['extension']
-                                );
-                    } else {
-                        throw new Exception('Image format is not supported.');
-                    }
-                }
-                catch (Exception $e) {
-                    self::$log->fatal($e->getMessage());
-                    exit();
-                }
-            } else {
-                throw new Exception('Image does not exist.');
-            }
-        }
-        catch (Exception $e) {
-            self::$log->fatal($e->getMessage());
-            exit();
-        }
-    }
-
-    /**
-     * Add a link
-     *
-     * @access protected
-     * @param string $text Text to use as link
-     * @param string $link URL link
-     * @param string $font Type of font
-     * @deprecated
-     */
-    protected function fAddLink($text = '', $textLink = '', $font = '')
-    {
-        $link = CreateLink::getInstance();
-        $link->createLink($text, $textLink, $font);
-        $this->_wordDocumentC .= (string) $link;
-    }
-
-    /**
-     * Add a list
-     *
-     * @access public
-     * @param array $dats Values of the list
-     * @param array $paramsList Parameters to use
-     * @deprecated
-     */
-    public function fAddList($dats, $paramsList = '')
-    {
-        $list = CreateList::getInstance();
-        $list->createList($dats, $paramsList);
-        $this->_wordDocumentC .= (string) $list;
-    }
-
-    /**
-     * Convert a math eq to DOCX
-     *
-     * @access public
-     * @param string $path Path to a file with math eq
-     * @deprecated
-     */
-    public function fAddMathDocx($path)
-    {
-        $package = new ZipArchive();
-        $package->open($path);
-        $document = $package->getFromName('word/document.xml');
-        $eqs = preg_split('/<[\/]*m:oMathPara>/', $document);
-        $this->addMathEq('<m:oMathPara>' . $eqs[1] . '</m:oMathPara>');
-        $package->close();
-    }
-
-    /**
-     * Add an existing math eq to DOCX
-     *
-     * @access public
-     * @param string $eq Math eq
-     * @deprecated
-     */
-    public function fAddMathEq($eq)
-    {
-        $this->_wordDocumentC .= '<' . CreateDocx::NAMESPACEWORD . ':p>' .
-            (string) $eq . '</' . CreateDocx::NAMESPACEWORD . ':p>';
-    }
-
-    /**
-     * Add a paragraph
-     *
-     * @access public
-     * @param string $text Text to add
-     * @param string $style Style of the paragraph
-     * @param string $align Align of the paragraph
-     * @deprecated
-     */
-    public function fAddParagraph($text, $style = '', $align = '')
-    {
-        $paragraph = CreateText::getInstance();
-        $paragraph->createParagraph($text, $style, $align);
-        $this->_wordDocumentC .= (string) $paragraph;
-    }
-
-    /**
-     * Add a table.
-     *
-     * @access public
-     * @param array $dats Values to add
-     * @param array $parameters Parameters to use
-     * @deprecated
-     */
-    public function fAddTable($dats, $parameters = '')
-    {
-        $table = CreateTable::getInstance();
-        $table->createTable($dats, $parameters);
-        $this->_wordDocumentC .= (string) $table;
-    }
-
-    /**
-     * Add a table of contents (TOC)
-     *
-     * @access public
-     * @param string $font Set font type
-     * @deprecated
-     */
-    public function fAddTableContents($font = '')
-    {
-        $tableContents = CreateTableContents::getInstance();
-        $tableContents->createTableContents($font);
-        $this->_wordDocumentC .= (string) $tableContents;
-    }
-
-    /**
-     * Add a text
-     *
-     * @access public
-     * @param mixed $value Text or array of texts to add
-     * @param array $style Style of text
-     * @deprecated
-     */
-    public function fAddText($value, $style = '')
-    {
-        $text = CreateText::getInstance();
-        $text->createText($value, $style);
-        $this->_wordDocumentC .= (string) $text;
-    }
-
-    /**
-     * Add a title
-     *
-     * @access public
-     * @param string $text Text to add
-     * @param array $style Style of title
-     * @deprecated
-     */
-    public function fAddTitle($text, $style = '')
-    {
-        $title = CreateText::getInstance();
-        $title->createTitle($text, $style);
-        $this->_wordDocumentC .= (string) $title;
-    }
-
-    /**
-     * Generate a new DOCX file
-     *
-     * @access public
-     * @param string $args[0] File name
-     * @deprecated
-     */
-    public function fCreateDocx()
-    {
-        $args = func_get_args();
-        if (!empty($args[0])) {
-            $fileName = $args[0];
-        } else {
-            $fileName = 'document';
-        }
-        $this->generateTemplateRelsRels();
-        $this->_zipDocx->addFromString('_rels/.rels', $this->_relsRelsT);
-        $this->generateTemplateDocPropsApp();
-        $this->_zipDocx->addFromString(
-            'docProps/app.xml', $this->_docPropsAppT
-        );
-        $this->generateTemplateDocPropsCore();
-        $this->_zipDocx->addFromString(
-            'docProps/core.xml', $this->_docPropsCoreT
-        );
-
-        $this->addStyle($this->_language);
-        $this->generateTemplateWordStyles();
-        $this->_zipDocx->addFromString(
-            'word/styles.xml', $this->_wordStylesT
-        );
-
-        $this->addSettings();
-        $this->generateTemplateWordSettings();
-        $this->_zipDocx->addFromString(
-            'word/settings.xml', $this->_wordSettingsT
-        );
-
-        $this->addWebSettings();
-        $this->generateTemplateWordWebSettings();
-        $this->_zipDocx->addFromString(
-            'word/webSettings.xml', $this->_wordWebSettingsT
-        );
-
-        if (empty($this->_wordFooterC)) {
-            $paramsFooter = array(
-                    'pagerAlignment' => 'right',
-                    'font' => 'Times New Roman'
-                );
-            $this->addFooter('', $paramsFooter);
-        }
-        $this->generateTemplateWordFooter();
-        if (self::$_encodeUTF) {
-            $this->_zipDocx->addFromString(
-                'word/footer.xml', utf8_encode($this->_wordFooterT)
-            );
-        } else {
-            $this->_zipDocx->addFromString(
-                'word/footer.xml', $this->_wordFooterT
-            );
-        }
-
-        if (!empty($this->_wordHeaderC)) {
-            $this->generateTemplateWordHeader();
-            if (self::$_encodeUTF) {
-                $this->_zipDocx->addFromString(
-                    'word/header.xml', utf8_encode($this->_wordHeaderT)
-                );
-            } else {
-                $this->_zipDocx->addFromString(
-                    'word/header.xml', $this->_wordHeaderT
-                );
-            }
-        }
-        if (!empty($this->_wordRelsHeaderRelsC)) {
-            $this->generateTemplateWordRelsHeaderRels();
-            $this->_zipDocx->addFromString(
-                'word/_rels/header.xml.rels', $this->_wordRelsHeaderRelsT
-            );
-        }
-
-        $this->generateOVERRIDE(
-            '/word/document.xml',
-            'application/vnd.openxmlformats-officedocument.' .
-            'wordprocessingml.document.main+xml'
-        );
-
-        $this->generateTemplateContentType();
-        $this->_zipDocx->addFromString(
-            '[Content_Types].xml',
-            $this->_wordContentTypeT
-        );
-
-        $this->generateTemplateWordNumbering();
-        $this->_zipDocx->addFromString(
-            'word/numbering.xml', $this->_wordNumberingT
-        );
-
-        $this->generateDefaultWordRels();
-        if (!empty($this->_wordRelsDocumentRelsC)) {
-            $this->generateTemplateWordRelsDocumentRels();
-            $this->_zipDocx->addFromString(
-                'word/_rels/document.xml.rels',
-                $this->_wordRelsDocumentRelsT
-            );
-        }
-        $arrArgsPage = array();
-        if (isset($args[1])) {
-            $arrArgsPage = $args[1];
-        }
-        $this->generateTemplateWordDocument($arrArgsPage);
-
-        if (self::$_encodeUTF) {
-            $this->_zipDocx->addFromString(
-                'word/document.xml', utf8_encode($this->_wordDocumentT)
-            );
-        } else {
-            $this->_zipDocx->addFromString(
-                'word/document.xml', $this->_wordDocumentT
-            );
-        }
-
-        $this->generateDefaultFonts();
-        $this->generateTemplateWordFontTable();
-        $this->_zipDocx->addFromString(
-            'word/fontTable.xml', $this->_wordFontTableT
-        );
-
-        $this->generateTemplateWordThemeTheme1();
-        $this->_zipDocx->addFromString(
-            'word/theme/theme1.xml', $this->_wordThemeThemeT
-        );
-
-        $this->_zipDocx->close();
-
-        $arrpathFile = pathinfo($fileName);
-        copy(
-            $this->_tempFile,
-            $fileName . '.' . $this->_extension
-        );
-    }
-
-    /**
-     * Change the default font
-     *
-     * @access public
-     * @param string $font The new font
-     * @deprecated
-     */
-    public function fSetDefaultFont($font)
-    {
-        $this->_defaultFont = $font;
-    }
-
-    /*** End old API ***/
-
-    /**
-     *
-     *
-     * @access private
-     */
-    private function generateContentType()
-    {
-        $this->generateDEFAULT(
-            'rels', 'application/vnd.openxmlformats-package.relationships+xml'
-        );
-        $this->generateDEFAULT('xml', 'application/xml');
-        $this->generateOVERRIDE(
-            '/word/numbering.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml.' .
-            'numbering+xml'
-        );
-        $this->generateOVERRIDE(
-            '/word/styles.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml' .
-            '.styles+xml'
-        );
-        $this->generateOVERRIDE(
-            '/docProps/app.xml',
-            'application/vnd.openxmlformats-officedocument.extended-' .
-            'properties+xml'
-        );
-        $this->generateOVERRIDE(
-            '/word/settings.xml', 'application/' .
-            'vnd.openxmlformats-officedocument.wordprocessingml.settings+xml'
-        );
-        $this->generateOVERRIDE(
-            '/word/theme/theme1.xml',
-            'application/vnd.openxmlformats-officedocument.theme+xml'
-        );
-        $this->generateOVERRIDE(
-            '/word/fontTable.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml.' .
-            'fontTable+xml'
-        );
-        $this->generateOVERRIDE(
-            '/word/webSettings.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml' .
-            '.webSettings+xml'
-        );
-        if ($this->_wordFooterC != '' || $this->_wordHeaderC != '') {
-            $this->generateOVERRIDE(
-                '/word/header.xml',
-                'application/vnd.openxmlformats-officedocument.' .
-                'wordprocessingml.header+xml'
-            );
-            $this->generateOVERRIDE(
-                '/word/footer.xml',
-                'application/vnd.openxmlformats-officedocument.' .
-                'wordprocessingml.footer+xml'
-            );
-            $this->generateOVERRIDE(
-                '/word/footnotes.xml',
-                'application/vnd.openxmlformats-officedocument.' .
-                'wordprocessingml.footnotes+xml'
-            );
-            $this->generateOVERRIDE(
-                '/word/endnotes.xml',
-                'application/vnd.openxmlformats-officedocument.' .
-                'wordprocessingml.endnotes+xml'
-            );
-        }
-        $this->generateOVERRIDE(
-            '/docProps/core.xml',
-            'application/vnd.openxmlformats-package.core-properties+xml'
-        );
-    }
-
-    /**
-     * Generate SECTPR
-     *
-     * @access private
-     * @param array $args Section style
-     */
-    private function generateSECTPR($args = '')
-    {
-        $page = CreatePage::getInstance();
-        $page->createSECTPR($args);
-        $this->_wordDocumentC .= (string) $page;
-    }
-
-    /**
-     * Generate ContentType XML template
-     *
-     * @access private
-     */
-    private function generateTemplateContentType()
-    {
-        $this->_wordContentTypeT =
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>' .
-            '<Types xmlns="http://schemas.openxmlformats.org/package/2006/' .
-            'content-types">' . $this->_contentTypeC . '</Types>';
-    }
-
-    /**
-     * Generate DocPropsApp XML template
-     *
-     * @access private
-     */
-    private function generateTemplateDocPropsApp()
-    {
-        $this->_docPropsAppT = 
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<Properties xmlns="http://schemas.openxmlformats.org/' .
-            'officeDocument/2006/extended-properties" xmlns:vt="' .
-            'http://schemas.openxmlformats.org/officeDocument/2006/' .
-            'docPropsVTypes"><Template>Normal.dotm</Template><TotalTime>' .
-            '0</TotalTime><Pages>1</Pages><Words>1</Words><Characters>1'
-            . '</Characters><Application>Microsoft Office Word</Application>' .
-            '<DocSecurity>4</DocSecurity><Lines>1</Lines><Paragraphs>1' .
-            '</Paragraphs><ScaleCrop>false</ScaleCrop><Company>Company' .
-            '</Company><LinksUpToDate>false</LinksUpToDate>' .
-            '<CharactersWithSpaces>1</CharactersWithSpaces><SharedDoc>' .
-            'false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged>' .
-            '<AppVersion>12.0000</AppVersion></Properties>';
-    }
-
-    /**
-     * Generate DocPropsCore XML template
-     *
-     * @access private
-     */
-    private function generateTemplateDocPropsCore()
-    {
-        date_default_timezone_set('UTC');
-        $this->_docPropsCoreT = 
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> ' .
-            '<cp:coreProperties xmlns:cp="http://schemas.openxmlformats' .
-            '.org/package/2006/metadata/core-properties" ' .
-            'xmlns:dc="http://purl.org/dc/elements/1.1/" ' .
-            'xmlns:dcterms="http://purl.org/dc/terms/" ' .
-            'xmlns:dcmitype="http://purl.org/dc/dcmitype/" ' .
-            'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' .
-            '<dc:title>Title</dc:title><dc:subject>Subject</dc:subject>' .
-            '<dc:creator>2mdc</dc:creator><dc:description>Description' .
-            '</dc:description><cp:lastModifiedBy>user' .
-            '</cp:lastModifiedBy><cp:revision>1</cp:revision>' .
-            '<dcterms:created xsi:type="dcterms:W3CDTF">' . date('c') .
-            '</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF' .
-            '">' . date('c') . '</dcterms:modified></cp:coreProperties>';
-    }
-
-    /**
-     * Generate RelsRels XML template
-     *
-     * @access private
-     */
-    private function generateTemplateRelsRels()
-    {
-        $this->_relsRelsT =
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<Relationships xmlns="http://schemas.openxmlformats.org/package/' .
-            '2006/relationships">' .
-            $this->generateRELATIONSHIP(
-                'rId3', 'extended-properties', 'docProps/app.xml'
-            ) .
-            '<Relationship Id="rId2" Type="http://schemas.openxmlformats' .
-            '.org/package/2006/relationships/metadata/core-properties"' .
-            ' Target="docProps/core.xml"/>' .
-            $this->generateRELATIONSHIP(
-                'rId1', 'officeDocument', 'word/document.xml'
-            );
-        $this->_relsRelsT .= '</Relationships>';
-    }
-
-    /**
-     * Generate WordDocument XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordDocument()
-    {
-        $arrArgs = func_get_args();
-        $this->generateSECTPR($arrArgs[0]);
-        if (!empty($this->_wordHeaderC)) {
-            $this->_wordDocumentC = str_replace(
-                '__GENERATEHEADERREFERENCE__',
-                '<' . CreateDocx::NAMESPACEWORD . ':headerReference ' .
-                CreateDocx::NAMESPACEWORD . ':type="default" r:id="rId' .
-                $this->_idWords['header'] . '"></' .
-                CreateDocx::NAMESPACEWORD . ':headerReference>',
-                $this->_wordDocumentC
-            );
-        }
-        if (!empty($this->_wordFooterC)) {
-            $this->_wordDocumentC = str_replace(
-                '__GENERATEFOOTERREFERENCE__',
-                '<' . CreateDocx::NAMESPACEWORD . ':footerReference ' .
-                CreateDocx::NAMESPACEWORD . ':type="default" r:id="rId' .
-                $this->_idWords['footer'] . '"></' .
-                CreateDocx::NAMESPACEWORD . ':footerReference>',
-                $this->_wordDocumentC
-            );
-        }
-        $this->_wordDocumentT =
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<' . CreateDocx::NAMESPACEWORD . ':document xmlns:ve=' .
-            '"http://schemas.openxmlformats.org/markup-compatibility/2006" ' .
-            'xmlns:o="urn:schemas-microsoft-com:office:office"' .
-            ' xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006' .
-            '/relationships" xmlns:m="http://schemas.openxmlformats.org/' .
-            'officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml"'.
-            ' xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/' .
-            'wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:' .
-            'office:word" xmlns:w="http://schemas.openxmlformats.org/' .
-            'wordprocessingml/2006/main" xmlns:wne="http://schemas' .
-            '.microsoft.com/office/word/2006/wordml">' .
-            '<' . CreateDocx::NAMESPACEWORD . ':body>' .
-            $this->_wordDocumentC .
-            '</' . CreateDocx::NAMESPACEWORD . ':body>' .
-            '</' . CreateDocx::NAMESPACEWORD . ':document>';
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Generate WordEndnotes XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordEndnotes()
-    {
-        $this->_wordEndnotesT = 
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<' . CreateDocx::NAMESPACEWORD . ':endnotes xmlns:ve' .
-            '="http://schemas.openxmlformats.org/markup-compatibility/2006" ' .
-            'xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="' .
-            'http://schemas.openxmlformats.org/officeDocument/2006/' .
-            'relationships" xmlns:m="http://schemas.openxmlformats.org/' .
-            'officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:' .
-            'vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006' .
-            '/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:' .
-            'office:word" xmlns:w="http://schemas.openxmlformats.org/' .
-            'wordprocessingml/2006/main" xmlns:wne="http://schemas' .
-            '.microsoft.com/office/word/2006/wordml">' .
-            $this->_wordEndnotesC .
-            '</' . CreateDocx::NAMESPACEWORD . ':endnotes>';
-        self::$intIdWord++;
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'endnotes', 'endnotes.xml'
-        );
-        $this->generateOVERRIDE(
-            '/word/endnotes.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml' .
-            '.endnotes+xml'
-        );
-    }
-
-    /**
-     * Generate WordFontTable XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordFontTable()
-    {
-        $this->_wordFontTableT =
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>' .
-            '<' . CreateDocx::NAMESPACEWORD . ':fonts xmlns:r="http://' .
-            'schemas.openxmlformats.org/officeDocument/2006/' .
-            'relationships" xmlns:w="http://schemas.openxmlformats.org/' .
-            'wordprocessingml/2006/main">' . $this->_wordFontTableC .
-            '</' . CreateDocx::NAMESPACEWORD . ':fonts>';
-    }
-
-    /**
-     * Generate WordFooter XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordFooter()
-    {
-        self::$intIdWord++;
-        $this->_idWords['footer'] = self::$intIdWord;
-        $this->_wordFooterT =
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-            <' . CreateDocx::NAMESPACEWORD . ':ftr xmlns:ve' .
-            '="http://schemas.openxmlformats.org/markup-compatibility/' .
-            '2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns' .
-            ':r="http://schemas.openxmlformats.org/officeDocument/2006/' .
-            'relationships" xmlns:m="http://schemas.openxmlformats.org/' .
-            'officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml' .
-            '" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/' .
-            'wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:' .
-            'office:word" xmlns:w="http://schemas.openxmlformats.org/' .
-            'wordprocessingml/2006/main" xmlns:wne="http://schemas' .
-            '.microsoft.com/office/word/2006/wordml">' . $this->_wordFooterC .
-            '</' . CreateDocx::NAMESPACEWORD . ':ftr>';
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'footer', 'footer.xml'
-        );
-    }
-
-    /**
-     * Generate WordFootnotes XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordFootnotes()
-    {
-        $this->_wordFootnotesT = 
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<' . CreateDocx::NAMESPACEWORD . ':footnotes xmlns:ve="' .
-            'http://schemas.openxmlformats.org/markup-compatibility/2006" ' .
-            'xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="' .
-            'http://schemas.openxmlformats.org/officeDocument/2006/' .
-            'relationships" xmlns:m="http://schemas.openxmlformats.org/' .
-            'officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:' .
-            'vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006' .
-            '/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:' .
-            'office:word" xmlns:w="http://schemas.openxmlformats.org/' .
-            'wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft' .
-            '.com/office/word/2006/wordml">' . $this->_wordFootnotesC .
-            '</' . CreateDocx::NAMESPACEWORD . ':footnotes>';
-        self::$intIdWord++;
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'footnotes', 'footnotes.xml'
-        );
-        $this->generateOVERRIDE(
-            '/word/footnotes.xml',
-            'application/vnd.openxmlformats-officedocument.wordprocessingml' .
-            '.footnotes+xml'
-        );
-    }
-
-    /**
-     * Generate WordHeader XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordHeader()
-    {
-        self::$intIdWord++;
-        $this->_idWords['header'] = self::$intIdWord;
-        $this->_wordHeaderT = '<?xml version="1.0" encoding="UTF-8" ' .
-            'standalone="yes"?>' .
-            '<' . CreateDocx::NAMESPACEWORD .
-            ':hdr xmlns:ve="http://schemas.openxmlformats.org/markup' .
-            '-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:' .
-            'office:office" xmlns:r="http://schemas.openxmlformats.org/' .
-            'officeDocument/2006/relationships" xmlns:m="http://schemas' .
-            '.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:' .
-            'schemas-microsoft-com:vml" xmlns:wp="http://schemas' .
-            '.openxmlformats.org/drawingml/2006/wordprocessingDrawing" ' .
-            'xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="' .
-            'http://schemas.openxmlformats.org/wordprocessingml/2006/' .
-            'main" xmlns:wne="http://schemas.microsoft.com/office/word/' .
-            '2006/wordml"> ' . $this->_wordHeaderC .
-            '</' . CreateDocx::NAMESPACEWORD . ':hdr>';
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'header', 'header.xml'
-        );
-    }
-
-    /**
-     * Generate WordNumbering XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordNumbering()
-    {
-        $this->_wordNumberingT = 
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<w:numbering xmlns:ve="http://schemas.openxmlformats' .
-            '.org/markup-compatibility/2006" xmlns:o="urn:schemas-' .
-            'microsoft-com:office:office" xmlns:r="http://schemas' .
-            '.openxmlformats.org/officeDocument/2006/relationships" ' .
-            'xmlns:m="http://schemas.openxmlformats.org/officeDocument/' .
-            '2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:' .
-            'wp="http://schemas.openxmlformats.org/drawingml/2006/' .
-            'wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com' .
-            ':office:word" xmlns:w="http://schemas.openxmlformats.org/' .
-            'wordprocessingml/2006/main" xmlns:wne="http://schemas.' .
-            'microsoft.com/office/word/2006/wordml"><w:abstractNum w:'
-            . 'abstractNumId="0"><w:nsid w:val="713727AE"/><w:multiLevelType' .
-            ' w:val="hybridMultilevel"/><w:tmpl w:val="F0B4B6B8"/>' .
-            '<w:lvl w:ilvl="0" w:tplc="0C0A0001"><w:start w:val="1"/>' .
-            '<w:numFmt w:val="bullet"/><w:lvlText w:val=""/><w:lvlJc ' .
-            'w:val="left"/><w:pPr><w:ind w:left="720" w:hanging="360"/>' .
-            '</w:pPr><w:rPr><w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" ' .
-            'w:hint="default"/></w:rPr></w:lvl><w:lvl w:ilvl="1" ' .
-            'w:tplc="0C0A0003" w:tentative="1"><w:start w:val="1"/>' .
-            '<w:numFmt w:val="bullet"/><w:lvlText w:val="o"/><w:lvlJc ' .
-            'w:val="left"/><w:pPr><w:ind w:left="1440" w:hanging="360"/>' . '
-                </w:pPr><w:rPr><w:rFonts w:ascii="Courier New" w:hAnsi=' .
-            '"Courier New" w:cs="Courier New" w:hint="default"/></w:rPr>' .
-            '</w:lvl><w:lvl w:ilvl="2" w:tplc="0C0A0005" w:tentative="1">' .
-            '<w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText ' .
-            'w:val=""/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="2160" ' .
-            'w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="Wingdings" ' .
-            'w:hAnsi="Wingdings" w:hint="default"/></w:rPr></w:lvl><w:lvl ' .
-            'w:ilvl="3" w:tplc="0C0A0001" w:tentative="1"><w:start ' .
-            'w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val=""/>' .
-            '<w:lvlJc w:val="left"/><w:pPr><w:ind w:left="2880" w:hanging=' .
-            '"360"/></w:pPr><w:rPr><w:rFonts w:ascii="Symbol" w:hAnsi=' .
-            '"Symbol" w:hint="default"/></w:rPr></w:lvl><w:lvl w:ilvl="4" ' .
-            'w:tplc="0C0A0003" w:tentative="1"><w:start w:val="1"/>' .
-            '<w:numFmt w:val="bullet"/><w:lvlText w:val="o"/><w:lvlJc ' .
-            'w:val="left"/><w:pPr><w:ind w:left="3600" w:hanging="360"/>' .
-            '</w:pPr><w:rPr><w:rFonts w:ascii="Courier New" w:hAnsi=' .
-            '"Courier New" w:cs="Courier New" w:hint="default"/></w:rPr>' .
-            '</w:lvl><w:lvl w:ilvl="5" w:tplc="0C0A0005" w:tentative="1">' .
-            '<w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText ' .
-            'w:val=""/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="4320" ' .
-            'w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="Wingdings" ' .
-            'w:hAnsi="Wingdings" w:hint="default"/></w:rPr></w:lvl><w:lvl ' .
-            'w:ilvl="6" w:tplc="0C0A0001" w:tentative="1"><w:start ' .
-            'w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val=""/>' .
-            '<w:lvlJc w:val="left"/><w:pPr><w:ind w:left="5040" ' .
-            'w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="Symbol" ' .
-            'w:hAnsi="Symbol" w:hint="default"/></w:rPr></w:lvl><w:lvl ' .
-            'w:ilvl="7" w:tplc="0C0A0003" w:tentative="1"><w:start ' .
-            'w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="o"/>' .
-            '<w:lvlJc w:val="left"/><w:pPr><w:ind w:left="5760" ' .
-            'w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="Courier New" ' .
-            'w:hAnsi="Courier New" w:cs="Courier New" w:hint="default"/>' .
-            '</w:rPr></w:lvl><w:lvl w:ilvl="8" w:tplc="0C0A0005" ' .
-            'w:tentative="1"><w:start w:val="1"/><w:numFmt w:val="bullet"' .
-            '/><w:lvlText w:val=""/><w:lvlJc w:val="left"/><w:pPr><w:ind ' .
-            'w:left="6480" w:hanging="360"/></w:pPr><w:rPr><w:rFonts ' .
-            'w:ascii="Wingdings" w:hAnsi="Wingdings" w:hint="default"/>' .
-            '</w:rPr></w:lvl></w:abstractNum><w:num w:numId="1">' .
-            '<w:abstractNumId w:val="0"/></w:num></w:numbering>';
-    }
-
-    /**
-     * Generate WordRelsDocumentRels XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordRelsDocumentRels()
-    {
-        $this->_wordRelsDocumentRelsT = 
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<Relationships xmlns="http://schemas.openxmlformats.org/' .
-            'package/2006/relationships">' . $this->_wordRelsDocumentRelsC .
-            '</Relationships>';
-    }
-
-    /**
-     * Generate WordRelsFooterRels XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordRelsFooterRels()
-    {
-        $this->_wordRelsFooterRelsT = 
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<Relationships xmlns="http://schemas.openxmlformats.org/' .
-            'package/2006/relationships">' . $this->_wordRelsFooterRelsC .
-            '</Relationships>';
-    }
-
-    /**
-     * Generate WordRelsHeaderRels XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordRelsHeaderRels()
-    {
-        $this->_wordRelsHeaderRelsT = 
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' .
-            '<Relationships xmlns="http://schemas.openxmlformats.org/' .
-            'package/2006/relationships">' . $this->_wordRelsHeaderRelsC .
-            '</Relationships>';
-    }
-
-    /**
-     * Generate WordSettings XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordSettings()
-    {
-        $this->_wordSettingsT = $this->_wordSettingsC;
-    }
-
-    /**
-     * Generate WordStyles XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordStyles()
-    {
-        $this->_wordStylesT =
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><' .
-            CreateDocx::NAMESPACEWORD . ':styles xmlns:r="http://' .
-            'schemas.openxmlformats.org/officeDocument/2006/relationships' .
-            '" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/' .
-            '2006/main">' . $this->_wordStylesC .
-            '</' . CreateDocx::NAMESPACEWORD . ':styles>';
-    }
-
-    /**
-     * Generate WordThemeTheme1 XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordThemeTheme1()
-    {
-        $this->addTheme($this->_defaultFont);
-        $this->_wordThemeThemeT =
-            '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><' .
-            CreateTheme1::NAMESPACEWORD . ':theme xmlns:a="http://' .
-            'schemas.openxmlformats.org/drawingml/2006/main" name="' .
-            'Tema de Office">' . $this->_wordThemeThemeC .
-            '</' . CreateTheme1::NAMESPACEWORD . ':theme>';
-    }
-
-    /**
-     * Generate WordWebSettings XML template
-     *
-     * @access private
-     */
-    private function generateTemplateWordWebSettings()
-    {
-        $this->_wordWebSettingsT = $this->_wordWebSettingsC;
-    }
-
-    /**
-     * Add settings
-     *
-     * @access private
-     */
-    private function addSettings()
-    {
-        $settings = CreateSettings::getInstance();
-        $settings->generateSettings();
-        $this->_wordSettingsC .= (string) $settings;
-    }
-
-    /**
-     * Add style
-     *
-     * @param string lang Language
-     * @access private
-     */
-    private function addStyle($lang = 'en-US')
-    {
-        $style = CreateStyle::getInstance();
-        $style->createStyle($lang);
-        $this->_wordStylesC .= (string) $style;
-    }
-
-    /**
-     * Add theme
-     *
-     * @access private
-     */
-    private function addTheme($strFont)
-    {
-        $theme = CreateTheme1::getInstance();
-        $theme->createTheme($strFont);
-        $this->_wordThemeThemeC .= (string) $theme;
-    }
-
-    /**
-     * Add websettings
-     *
-     * @access private
-     */
-    private function addWebSettings()
-    {
-        $webSettings = CreateWebSettings::getInstance();
-        $webSettings->generateWebSettings();
-        $this->_wordWebSettingsC .= (string) $webSettings;
-    }
-
-    /**
-     * Clean template
-     *
-     * @access private
-     */
-    private function cleanTemplate()
-    {
-        $this->_wordDocumentT = preg_replace(
-            '/__[A-Z]+__/',
-            '',
-            $this->_wordDocumentT
-        );
-    }
-
-    /**
-     * Generate DEFAULT
-     *
-     * @access private
-     */
-    private function generateDEFAULT($extension, $contentType)
-    {
-        if (
-            strpos($this->_contentTypeC, 'Extension="' . $extension)
-            === false
-        ) {
-            $this->_contentTypeC .= '<Default Extension="' .
-                $extension . '" ContentType="' . $contentType . '"> </Default>';
-        }
-    }
-
-    /**
-     *
-     *
-     * @access private
-     */
-    private function generateDefaultFonts()
-    {
-        $font = array(
-            'name' => 'Calibri', 'pitch' => 'variable', 'usb0' => 'A00002EF',
-            'usb1' => '4000207B', 'usb2' => '00000000', 'usb3' => '00000000',
-            'csb0' => '0000009F', 'csb1' => '00000000', 'family' => 'swiss',
-            'charset' => '00', 'panose1' => '020F0502020204030204'
-        );
-        $this->addFont($font);
-        $font = array(
-            'name' => 'Times New Roman', 'pitch' => 'variable',
-            'usb0' => 'E0002AEF', 'usb1' => 'C0007841', 'usb2' => '00000009',
-            'usb3' => '00000000', 'csb0' => '000001FF', 'csb1' => '00000000',
-            'family' => 'roman', 'charset' => '00',
-            'panose1' => '02020603050405020304'
-        );
-        $this->addFont($font);
-        $font = array(
-            'name' => 'Cambria', 'pitch' => 'variable', 'usb0' => 'A00002EF',
-            'usb1' => '4000004B', 'usb2' => '00000000', 'usb3' => '00000000',
-            'csb0' => '0000009F', 'csb1' => '00000000', 'family' => 'roman',
-            'charset' => '00', 'panose1' => '02040503050406030204'
-        );
-        $this->addFont($font);
-    }
-
-    /**
-     * Generate DefaultWordRels
-     *
-     * @access private
-     */
-    private function generateDefaultWordRels()
-    {
-        self::$intIdWord++;
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'numbering', 'numbering.xml'
-        );
-        self::$intIdWord++;
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'theme', 'theme/theme1.xml'
-        );
-        self::$intIdWord++;
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'webSettings', 'webSettings.xml'
-        );
-        self::$intIdWord++;
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'fontTable', 'fontTable.xml'
-        );
-        self::$intIdWord++;
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'settings', 'settings.xml'
-        );
-        self::$intIdWord++;
-        $this->_wordRelsDocumentRelsC .= $this->generateRELATIONSHIP(
-            'rId' . self::$intIdWord, 'styles', 'styles.xml'
-        );
-    }
-
-    /**
-     * Generate OVERRIDE
-     *
-     * @access private
-     * @param string $partName
-     * @param string $contentType
-     */
-    private function generateOVERRIDE($partName, $contentType)
-    {
-        if (
-            strpos($this->_contentTypeC, 'PartName="' . $partName . '"')
-            === false
-        ) {
-            $this->_contentTypeC .= '<Override PartName="' .
-                $partName . '" ContentType="' . $contentType . '"> </Override>';
-        }
-    }
-
-    /**
-     * Gnerate RELATIONSHIP
-     *
-     * @access private
-     */
-    private function generateRELATIONSHIP()
-    {
-        $arrArgs = func_get_args();
-        if ($arrArgs[1] == 'vbaProject')
-            $strType =
-            'http://schemas.microsoft.com/office/2006/relationships/vbaProject';
-        else
-            $strType = 
-            'http://schemas.openxmlformats.org/officeDocument/2006/' .
-            'relationships/' . $arrArgs[1];
-
-        return '<Relationship Id="' . $arrArgs[0] . '" Type="' . $strType .
-               '" Target="' . $arrArgs[2] . '"></Relationship>';
-    }
-
-    /**
-     * Parse path dir
-     *
-     * @access private
-     * @param string $dir Directory path
-     */
-    private function parsePath($dir)
-    {
-        $barra = 0;
-        $path = '';
-        if (($barra = strrpos($dir, '/')) !== false) {
-            $barra += 1;
-            $path = substr($dir, 0, $barra);
-        }
-        $punto = strpos(substr($dir, $barra), '.');
-
-        $nombre = substr($dir, $barra, $punto);
-        $extension = substr($dir, $punto + $barra + 1);
-        return array(
-            'path' => $path, 'nombre' => $nombre, 'extension' => $extension
-        );
-    }
-
-}

+ 0 - 929
main/inc/lib/phpdocx/classes/CreateElement.inc

@@ -1,929 +0,0 @@
-<?php
-
-/**
- * Create tag elements
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-
-/**
- * Main class, create tag elements
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateElement
-{
-    const MATHNAMESPACEWORD = 'm';
-    const NAMESPACEWORD = 'w';
-
-    /**
-     *
-     * @var string
-     * @access protected
-     */
-    protected $_xml;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-        
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-
-    }
-
-    /**
-     * Generate w:p
-     *
-     * @access protected
-     */
-    protected function generateP()
-    {
-        $this->_xml = '<' . CreateElement::NAMESPACEWORD .
-                ':p>__GENERATEP__</' . CreateElement::NAMESPACEWORD .
-                ':p>';
-    }
-
-    /**
-     * Generate w:ppr
-     *
-     * @access protected
-     */
-    protected function generatePPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':pPr>__GENERATEPPR__</' .
-                CreateElement::NAMESPACEWORD . ':pPr>__GENERATER__';
-
-        $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:t
-     *
-     * @param string $dat
-     * @access protected
-     */
-    protected function generateT($dat)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':t xml:space="preserve">' .
-                $dat . '</' . CreateElement::NAMESPACEWORD . ':t>';
-
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:rpr
-     *
-     * @access protected
-     */
-    protected function generateRPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':rPr>__GENERATERPR__</' . CreateElement::NAMESPACEWORD .
-                ':rPr>__GENERATER__';
-
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:jc
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateJC($val = '')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':jc ' . CreateElement::NAMESPACEWORD . ':val="' . $val .
-                '"></' . CreateElement::NAMESPACEWORD . ':jc>';
-
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:b
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateB($strVal = 'single')
-    {
-        $element = '<' . CreateElement::NAMESPACEWORD . ':b ' .
-                CreateElement::NAMESPACEWORD . ':val="' . $strVal . '"></' .
-                CreateElement::NAMESPACEWORD . ':b>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $element, $this->_xml);
-    }
-
-    /**
-     * Generate w:bcs
-     *
-     * @access protected
-     */
-    protected function generateBCS()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':bCs></' . CreateElement::NAMESPACEWORD .
-                ':bCs>__GENERATERPR__';
-
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:noproof
-     *
-     * @access protected
-     */
-    protected function generateNOPROOF()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':noProof></' . CreateElement::NAMESPACEWORD .
-                ':noProof>__GENERATEPPR__';
-
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:r
-     *
-     * @access protected
-     */
-    protected function generateR()
-    {
-        if (!empty($this->_xml)) {
-            if (preg_match("/__GENERATEP__/", $this->_xml)) {
-                $xml = '<' . CreateElement::NAMESPACEWORD .
-                        ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                        ':r>';
-                $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml);
-            } elseif (preg_match("/__GENERATER__/", $this->_xml)) {
-                $xml = '<' . CreateElement::NAMESPACEWORD .
-                        ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                        ':r>';
-                $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-            }
-        } else {
-            $this->_xml = '<' . CreateElement::NAMESPACEWORD .
-                    ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                    ':r>__GENERATER__';
-        }
-    }
-
-    /**
-     * Generate w:drawing
-     *
-     * @access protected
-     */
-    protected function generateDRAWING()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':drawing>__GENERATEDRAWING__</' .
-                CreateElement::NAMESPACEWORD .
-                ':drawing>';
-
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:inline
-     *
-     * @param string $distT
-     * @param string $distB
-     * @param string $distL
-     * @param string $distR
-     * @access protected
-     */
-    protected function generateINLINE($distT = '0', $distB ='0',
-                                      $distL = '0', $distR ='0')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD .
-                ':inline distT="' . $distT . '" distB="' . $distB .
-                '" distL="' . $distL . '" distR="' . $distR .
-                '">__GENERATEINLINE__</' . CreateImage::NAMESPACEWORD .
-                ':inline>';
-
-        $this->_xml = str_replace('__GENERATEDRAWING__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:anchor
-     *
-     * @param string $behindDoc
-     * @param string $distT
-     * @param string $distB
-     * @param string $distL
-     * @param string $distR
-     * @param int $simplePos
-     * @param string $relativeHeight
-     * @param string $locked
-     * @param string $layoutInCell
-     * @param string $allowOverlap
-     * @access protected
-     */
-    protected function generateANCHOR($behindDoc = 0, $distT = '0',
-                                      $distB = '0', $distL = '114300',
-                                      $distR = '114300', $simplePos = 0,
-                                      $relativeHeight = '251658240',
-                                      $locked = 0, $layoutInCell = 1,
-                                      $allowOverlap = 1)
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . ':anchor distT="' . $distT .
-                '" distB="' . $distB . '" distL="' . $distL .
-                '" distR="' . $distR . '" simplePos="' . $simplePos .
-                '" relativeHeight="' . $relativeHeight .
-                '" behindDoc="' . $behindDoc .
-                '" locked="' . $locked .
-                '" layoutInCell="' . $layoutInCell .
-                '" allowOverlap="' . $allowOverlap .
-                '">__GENERATEINLINE__</' . CreateImage::NAMESPACEWORD .
-                ':anchor>';
-
-        $this->_xml = str_replace('__GENERATEDRAWING__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:simplepos
-     *
-     * @param string $x
-     * @param string $y
-     * @access protected
-     */
-    protected function generateSIMPLEPOS($x = '0', $y = '0')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD .
-                ':simplePos x="' . $x . '" y="' . $y .
-                '"></' . CreateImage::NAMESPACEWORD .
-                ':simplePos>__GENERATEINLINE__';
-
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:positionh
-     *
-     * @param string $relativeFrom
-     * @access protected
-     */
-    protected function generatePOSITIONH($relativeFrom = 'column')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD .
-                ':positionH relativeFrom="' . $relativeFrom .
-                '">__GENERATEPOSITION__</' . CreateImage::NAMESPACEWORD .
-                ':positionH>__GENERATEINLINE__';
-
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:positionv
-     *
-     * @param string $relativeFrom
-     * @access protected
-     */
-    protected function generatePOSITIONV($relativeFrom = 'paragraph')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD .
-                ':positionV relativeFrom="' . $relativeFrom .
-                '">__GENERATEPOSITION__</' . CreateImage::NAMESPACEWORD .
-                ':positionV>__GENERATEINLINE__';
-
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:posoffset
-     *
-     * @param int $num
-     * @access protected
-     */
-    protected function generatePOSOFFSET($num)
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . ':posOffset>' . $num . 
-                '</' . CreateImage::NAMESPACEWORD . ':posOffset>';
-        
-        $this->_xml = str_replace('__GENERATEPOSITION__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:extent
-     *
-     * @param string $cx
-     * @param string $cy
-     * @access protected
-     */
-    protected function generateEXTENT($cx = '2986543', $cy = '2239906')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . ':extent cx="' . $cx .
-                '" cy="' . $cy . '"></' . CreateImage::NAMESPACEWORD .
-                ':extent>__GENERATEINLINE__';
-
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:effectextent
-     *
-     * @param string $l
-     * @param string $t
-     * @param string $r
-     * @param string $b
-     * @access protected
-     */
-    protected function generateEFFECTEXTENT($l = "19050", $t = "0",
-                                            $r = "4307", $b = "0")
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . ':effectExtent l="' . $l . 
-                '" t="' . $t . '" r="' . $r . '" b="' . $b .
-                '"></' . CreateImage::NAMESPACEWORD .
-                ':effectExtent>__GENERATEINLINE__';
-        
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:wrapsquare
-     *
-     * @param string $wrapText
-     * @access protected
-     */
-    protected function generateWRAPSQUARE($wrapText = "bothSides")
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . 
-                ':wrapSquare wrapText="' . $wrapText .
-                '"></' . CreateImage::NAMESPACEWORD .
-                ':wrapSquare>__GENERATEINLINE__';
-        
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:wrapnone
-     *
-     * @access protected
-     */
-    protected function generateWRAPNONE()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD .
-                ':wrapNone></' . CreateImage::NAMESPACEWORD .
-                ':wrapNone>__GENERATEINLINE__';
-        
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:wraptopandbottom
-     *
-     * @access protected
-     */
-    protected function generateWRAPTOPANDBOTTOM()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD .
-                ':wrapTopAndBottom></' . CreateImage::NAMESPACEWORD .
-                ':wrapTopAndBottom>__GENERATEINLINE__';
-        
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:wrapthrough
-     *
-     * @param string $wrapText
-     * @access protected
-     */
-    protected function generateWRAPTHROUGH($wrapText = 'bothSides')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . 
-                ':wrapThrough wrapText="' . $wrapText .
-                '">__GENERATEWRAPTHROUGH__</' . CreateImage::NAMESPACEWORD .
-                ':wrapThrough>__GENERATEINLINE__';
-
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:wrappolygon
-     *
-     * @param string $edited
-     * @access protected
-     */
-    protected function generateWRAPPOLYGON($edited = '0')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . 
-                ':wrapPolygon edited="' . $edited .
-                '">__GENERATEWRAPPOLYGON__</' . CreateImage::NAMESPACEWORD .
-                ':wrapPolygon>';
-        
-        $this->_xml = str_replace('__GENERATEWRAPTHROUGH__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:start
-     *
-     * @param string $x
-     * @param string $y
-     * @access protected
-     */
-    protected function generateSTART($x = '-198', $y = '0')
-    {
-
-        $xml = '<' . CreateImage::NAMESPACEWORD . 
-                ':start x="' . $x . '" y="' . $y .
-                '"></' . CreateImage::NAMESPACEWORD .
-                ':start>__GENERATEWRAPPOLYGON__';
-        
-        $this->_xml = str_replace('__GENERATEWRAPPOLYGON__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:lineto
-     *
-     * @param string $x
-     * @param string $y
-     * @access protected
-     */
-    protected function generateLINETO($x = '-198', $y = '21342')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . 
-                ':lineTo x="' . $x . '" y="' . $y .
-                '"></' . CreateImage::NAMESPACEWORD .
-                ':lineTo>__GENERATEWRAPPOLYGON__';
-        
-        $this->_xml = str_replace('__GENERATEWRAPPOLYGON__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:docpr
-     *
-     * @param string $id
-     * @param string $name
-     * @access protected
-     */
-    protected function generateDOCPR($id = "1", $name = "0 Imagen")
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . ':docPr id="' . $id . 
-                '" name="' . $name . '" descr="' . $this->getName() .
-                '"></' . CreateImage::NAMESPACEWORD .
-                ':docPr>__GENERATEINLINE__';
-        
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:cnvgraphicframepr
-     *
-     * @access protected
-     */
-    protected function generateCNVGRAPHICFRAMEPR()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD . 
-                ':cNvGraphicFramePr>__GENERATECNVGRAPHICFRAMEPR__</' .
-                CreateImage::NAMESPACEWORD .
-                ':cNvGraphicFramePr>__GENERATEINLINE__';
-        
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:graphicpframelocks
-     *
-     * @param string $noChangeAspect
-     * @access protected
-     */
-    protected function generateGRAPHICPRAMELOCKS($noChangeAspect = '')
-    {
-        $xmlAux = '<' . CreateImage::NAMESPACEWORD1 . 
-                    ':graphicFrameLocks xmlns:a="' .
-                    'http://schemas.openxmlformats.org/drawingml/2006/main"';
-
-        if ($noChangeAspect != '')
-            $xmlAux .= ' noChangeAspect="' . $noChangeAspect . '"';
-        $xmlAux .= '></' . CreateImage::NAMESPACEWORD1 . ':graphicFrameLocks>';
-
-        $this->_xml = str_replace(
-            '__GENERATECNVGRAPHICFRAMEPR__', $xmlAux, $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:graphic
-     *
-     * @param string $xmlns
-     * @access protected
-     */
-    protected function generateGRAPHIC(
-        $xmlns = 'http://schemas.openxmlformats.org/drawingml/2006/main')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-                ':graphic xmlns:a="' . $xmlns .
-                '">__GENERATEGRAPHIC__</' . CreateImage::NAMESPACEWORD1 .
-                ':graphic>';
-        
-        $this->_xml = str_replace('__GENERATEINLINE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:graphicdata
-     *
-     * @param string $uri
-     * @access protected
-     */
-    protected function generateGRAPHICDATA(
-        $uri = 'http://schemas.openxmlformats.org/drawingml/2006/picture')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . 
-                ':graphicData uri="' . $uri .
-                '">__GENERATEGRAPHICDATA__</' . CreateImage::NAMESPACEWORD1 .
-                ':graphicData>';
-
-        $this->_xml = str_replace('__GENERATEGRAPHIC__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:pic
-     *
-     * @param string $pic
-     * @access protected
-     */
-    protected function generatePIC(
-        $pic = 'http://schemas.openxmlformats.org/drawingml/2006/picture')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD2 . 
-                ':pic xmlns:pic="' . $pic .
-                '">__GENERATEPIC__</' . CreateImage::NAMESPACEWORD2 .
-                ':pic>';
-
-        $this->_xml = str_replace('__GENERATEGRAPHICDATA__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:nvpicpr
-     *
-     * @access protected
-     */
-    protected function generateNVPICPR()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD2 .
-                ':nvPicPr>__GENERATENVPICPR__</' . CreateImage::NAMESPACEWORD2 .
-                ':nvPicPr>__GENERATEPIC__';
-
-        $this->_xml = str_replace('__GENERATEPIC__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:cnvpr
-     *
-     * @param string $id
-     * @access protected
-     */
-    protected function generateCNVPR($id = '0')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD2 .
-                ':cNvPr id="' . $id . '" name="' . $this->getName() .
-                '"></' . CreateImage::NAMESPACEWORD2 .
-                ':cNvPr>__GENERATENVPICPR__';
-
-        $this->_xml = str_replace('__GENERATENVPICPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:cnvpicpr
-     *
-     * @access protected
-     */
-    protected function generateCNVPICPR()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD2 .
-                ':cNvPicPr></' . CreateImage::NAMESPACEWORD2 .
-                ':cNvPicPr>__GENERATENVPICPR__';
-
-        $this->_xml = str_replace('__GENERATENVPICPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:blipfill
-     *
-     * @access protected
-     */
-    protected function generateBLIPFILL()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD2 .
-                ':blipFill>__GENERATEBLIPFILL__</' .
-                CreateImage::NAMESPACEWORD2 . ':blipFill>__GENERATEPIC__';
-
-        $this->_xml = str_replace('__GENERATEPIC__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:blip
-     *
-     * @param string $cstate
-     * @access protected
-     */
-    protected function generateBLIP($cstate = 'print')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-                ':blip r:embed="rId' . $this->getRId() .
-                '" cstate="' . $cstate .
-                '"></' . CreateImage::NAMESPACEWORD1 .
-                ':blip>__GENERATEBLIPFILL__';
-        
-        $this->_xml = str_replace('__GENERATEBLIPFILL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:stretch
-     *
-     * @access protected
-     */
-    protected function generateSTRETCH()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-                ':stretch>__GENERATESTRETCH__</' . CreateImage::NAMESPACEWORD1 .
-                ':stretch>__GENERATEBLIPFILL__';
-
-        $this->_xml = str_replace('__GENERATEBLIPFILL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:fillrect
-     *
-     * @access protected
-     */
-    protected function generateFILLRECT()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-                ':fillRect></' . CreateImage::NAMESPACEWORD1 .
-                ':fillRect>';
-
-        $this->_xml = str_replace('__GENERATESTRETCH__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:sppr
-     *
-     * @access protected
-     */
-    protected function generateSPPR()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD2 .
-                ':spPr>__GENERATESPPR__</' . CreateImage::NAMESPACEWORD2 .
-                ':spPr>';
-        
-        $this->_xml = str_replace('__GENERATEPIC__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:xfrm
-     *
-     * @access protected
-     */
-    protected function generateXFRM()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-                ':xfrm>__GENERATEXFRM__</' . CreateImage::NAMESPACEWORD1 .
-                ':xfrm>__GENERATESPPR__';
-
-        $this->_xml = str_replace('__GENERATESPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:off
-     *
-     * @param string $x
-     * @param string $y
-     * @access protected
-     */
-    protected function generateOFF($x = '0', $y = '0')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . 
-                ':off x="' . $x . '" y="' . $y .
-                '"></' . CreateImage::NAMESPACEWORD1 .
-                ':off>__GENERATEXFRM__';
-
-        $this->_xml = str_replace('__GENERATEXFRM__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:ext
-     *
-     * @param string $cx
-     * @param string $cy
-     * @access protected
-     */
-    protected function generateEXT($cx = '2997226', $cy = '2247918')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . 
-                ':ext cx="' . $cx . '" cy="' . $cy .
-                '"></' . CreateImage::NAMESPACEWORD1 .
-                ':ext>__GENERATEXFRM__';
-        
-        $this->_xml = str_replace('__GENERATEXFRM__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:prstgeom
-     *
-     * @param string $prst
-     * @access protected
-     */
-    protected function generatePRSTGEOM($prst = 'rect')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . 
-                ':prstGeom prst="' . $prst .
-                '">__GENERATEPRSTGEOM__</' . CreateImage::NAMESPACEWORD1 .
-                ':prstGeom>__GENERATESPPR__';
-
-        $this->_xml = str_replace('__GENERATESPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:avlst
-     *
-     * @access protected
-     */
-    protected function generateAVLST()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-                ':avLst></' . CreateImage::NAMESPACEWORD1 .
-                ':avLst>__GENERATEPRSTGEOM__';
-
-        $this->_xml = str_replace('__GENERATEPRSTGEOM__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:ln
-     *
-     * @param string $w
-     * @access protected
-     */
-    protected function generateLN($w = '12700')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-                ':ln w="' . $w . '">__GENERATELN__</' .
-                CreateImage::NAMESPACEWORD1 .
-                ':ln>__GENERATESPPR__';
-
-        $this->_xml = str_replace('__GENERATESPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:solidfill
-     *
-     * @access protected
-     */
-    protected function generateSOLIDFILL()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-                ':solidFill>__GENERATESOLIDFILL__</' .
-                CreateImage::NAMESPACEWORD1 .
-                ':solidFill>__GENERATELN__';
-        $this->_xml = str_replace('__GENERATELN__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:schemeclr
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateSCHEMECLR($val = 'tx1')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . ':schemeClr val="' . $val .
-                '"></' . CreateImage::NAMESPACEWORD1 . ':schemeClr>';
-        
-        $this->_xml = str_replace('__GENERATESOLIDFILL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:prstdash
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generatePRSTDASH($val = 'sysDash')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . ':prstDash val="' . $val .
-                '"></' . CreateImage::NAMESPACEWORD1 .
-                ':prstDash>__GENERATELN__';
-        
-        $this->_xml = str_replace('__GENERATELN__', $xml, $this->_xml);
-    }
-
-    /**
-     * Delete pending tags
-     *
-     * @access protected
-     */
-    protected function cleanTemplate()
-    {
-        $this->_xml = preg_replace('/__[A-Z]+__/', '', $this->_xml);
-    }
-
-    /**
-     * Delete first w:rpr
-     *
-     * @access protected
-     */
-    protected function cleanTemplateFirstRPR()
-    {
-        $this->_xml = preg_replace('/__GENERATERPR__/', '', $this->_xml, 1);
-    }
-
-    /**
-     * Generate w:r
-     *
-     * @access protected
-     */
-    protected function generateQUITAR()
-    {
-        $this->_xml = '<' . CreateElement::NAMESPACEWORD .
-                      ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                      ':r>';
-    }
-
-    /**
-     * Generate w:pstyle
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generatePSTYLE($val = 'Textonotaalfinal')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . 
-                ':pStyle ' . CreateElement::NAMESPACEWORD .
-                ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-                ':pStyle>';
-
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:rstyle
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateRSTYLE($val = 'Refdenotaalfinal')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . 
-                ':rStyle ' . CreateElement::NAMESPACEWORD .
-                ':val="' . $val .
-                '"></' . CreateElement::NAMESPACEWORD .
-                ':rStyle>';
-        
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:rfonts
-     *
-     * @param string $font
-     * @access protected
-     */
-    protected function generateRFONTS($font)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . 
-                ':rFonts ' . CreateElement::NAMESPACEWORD .
-                ':ascii="' . $font . '" ' . CreateElement::NAMESPACEWORD .
-                ':hAnsi="' . $font . '" ' . CreateElement::NAMESPACEWORD .
-                ':cs="' . $font . '"></' . CreateElement::NAMESPACEWORD .
-                ':rFonts>__GENERATERPR__';
-        
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-}

+ 0 - 176
main/inc/lib/phpdocx/classes/CreateExcelSharedStrings.inc

@@ -1,176 +0,0 @@
-<?php
-
-/**
- * Generate excel shared strings
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Generate excel shared strings
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateExcelSharedStrings extends CreateElement
-{
-    /**
-     *
-     * @var CreateExcelSharedStrings
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @return string
-     * @access public
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateExcelSharedStrings
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateExcelSharedStrings();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create excel shared strings
-     *
-     * @param string $args[0]
-     * @param string $args[1]
-     * @access public
-     */
-    public function createExcelSharedStrings()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        $type = $args[1];
-        $dats = $args[0];
-        $tamDatos = count($dats);
-        foreach ($dats as $ind => $data) {
-            $tamCols = count($data);
-            break;
-        }
-        $tamDatos = count($dats);
-        if (strpos($type, 'pie') !== false) {
-            $tamCols = 1;
-        } else {
-            $tamDatos--;
-        }
-        $this->generateSST($tamDatos + $tamCols + 2);
-
-
-        for ($i = 0; $i < $tamCols; $i++) {
-            if (strpos($type, 'pie') !== false) {
-                $this->generateSI();
-                $this->generateT('0');
-                break;
-            }else
-                $this->generateSI();
-            $this->generateT($dats[0][$i]);
-        }
-
-        foreach ($dats as $ind => $val) {
-            if ($ind == '0')
-                continue;
-            $this->generateSI();
-            $this->generateT($ind);
-        }
-        $this->generateSI();
-        $this->generateT(' ', 'preserve');
-
-        $msg = 'To change the range size of values,
-                drag the bottom right corner';
-        $this->generateSI();
-        $this->generateT($msg);
-
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Generate sst
-     *
-     * @param string $num
-     * @access protected
-     */
-    protected function generateSST($num)
-    {
-        $this->_xml = '<?xml version="1.0" encoding="UTF-8" '.
-                      'standalone="yes" ?><sst xmlns="http://schemas.'.
-                      'openxmlformats.org/spreadsheetml/2006/main" '.
-                      'count="' . $num . '" uniqueCount="' . $num .
-                      '">__GENERATESST__</sst>';
-    }
-
-    /**
-     * Generate si
-     * @access protected
-     */
-    protected function generateSI()
-    {
-        $xml = '<si>__GENERATESI__</si>__GENERATESST__';
-        $this->_xml = str_replace('__GENERATESST__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate t
-     *
-     * @param string $name
-     * @param string $space
-     * @access protected
-     */
-    protected function generateT($name, $space = '')
-    {
-        $xmlAux = '<t';
-        if ($space != '')
-            $xmlAux .= ' xml:space="' . $space . '"';
-        $xmlAux .= '>' . $name . '</t>';
-        $this->_xml = str_replace('__GENERATESI__', $xmlAux, $this->_xml);
-    }
-}

+ 0 - 426
main/inc/lib/phpdocx/classes/CreateExcelSheet.inc

@@ -1,426 +0,0 @@
-<?php
-
-/**
- * Create excel sheet
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create excel sheet
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateExcelSheet extends CreateElement
-{
-    /**
-     *
-     * @var CreateExcelSheet
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-    
-    /**
-     *
-     * @return string
-     * @access public
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateExcelSheet
-     * @access public
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateExcelSheet();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create excel sheet
-     *
-     * @access public
-     * @param string $args[0]
-     * @param array $args[1]
-     */
-    public function createExcelSheet()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        $type = $args[1];
-        $dats = $args[0];
-        $sizeDats = count($dats);
-        foreach ($dats as $ind => $data) {
-            $sizeCols = count($data);
-            break;
-        }
-        $sizeDats = count($dats);
-        if (strpos($type, 'pie') !== false) {
-            $sizeCols = 1;
-        } else {
-            $sizeDats--;
-        }
-        $this->generateWORKSHEET();
-        $this->generateDIMENSION($sizeDats, $sizeCols);
-        $this->generateSHEETVIEWS();
-        $this->generateSHEETVIEW();
-        $this->generateSELECTION($sizeDats + $sizeCols);
-        $this->generateSHEETFORMATPR();
-        $this->generateCOLS();
-        $this->generateCOL();
-        $this->generateSHEETDATA();
-        $row = 1;
-        foreach ($dats as $ind => $val) {
-            $col = 1;
-            $letra = 'A';
-            $this->generateROW($row, $sizeCols);
-            $this->generateC($letra . $row, '', 's');
-            $this->generateV($sizeDats + $sizeCols);
-            $letra++;
-            foreach ($val as $valores) {
-                $this->generateC($letra . $row, '', 's');
-                $this->generateV($col - 1);
-                $col++;
-                $letra++;
-            }
-            $this->cleanTemplateROW();
-            $row++;
-            break;
-        }
-        foreach ($dats as $ind => $val) {
-            if ($ind == '0')
-                continue;
-            $this->generateROW($row, $sizeCols);
-            $col = 1;
-            $letra = 'A';
-            $this->generateC($letra . $row, 1, 's');
-            $this->generateV($sizeCols + $row - 2);
-            $letra++;
-            foreach ($val as $valores) {
-                $s = '';
-                if ($col != $sizeCols)
-                    $s = 1;
-                $this->generateC($letra . $row, $s);
-                $this->generateV($valores);
-                $col++;
-                $letra++;
-            }
-            $row++;
-            $this->cleanTemplateROW();
-        }
-        $this->generateROW($row + 1, $sizeCols);
-        $row++;
-        $this->generateC('B' . $row, 2, 's');
-        $this->generateV($sizeDats + $sizeCols + 1);
-        $this->generatePAGEMARGINS();
-        $this->generateTABLEPARTS();
-        $this->generateTABLEPART(1);
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Generate worksheet
-     *
-     * @access protected
-     */
-    protected function generateWORKSHEET()
-    {
-        $this->_xml = '<?xml version="1.0" encoding="UTF-8" ' . 
-                      'standalone="yes" ?><worksheet ' .
-                      'xmlns="http://schemas.openxmlformats.org/' .
-                      'spreadsheetml/2006/main" ' . 'xmlns:r="http://schemas.' .
-                      'openxmlformats.org/officeDocument/2006/relationships"' .
-                      '>__GENERATEWORKSHEET__</worksheet>';
-    }
-
-    /**
-     * Generate dimension
-     *
-     * @param int $sizeX
-     * @param int $sizeY
-     * @access protected
-     */
-    protected function generateDIMENSION($sizeX, $sizeY)
-    {
-        $char = 'A';
-        for ($i = 0; $i < $sizeY; $i++)
-            $char++;
-        $sizeX += $sizeY;
-        $xml = '<dimension ref="A1:' . $char . $sizeX .
-                '"></dimension>__GENERATEWORKSHEET__';
-        
-        $this->_xml = str_replace('__GENERATEWORKSHEET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate sheetviews
-     *
-     * @access protected
-     */
-    protected function generateSHEETVIEWS()
-    {
-        $xml = '<sheetViews>__GENERATESHEETVIEWS__' .
-            '</sheetViews>__GENERATEWORKSHEET__';
-        $this->_xml = str_replace('__GENERATEWORKSHEET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate sheetview
-     *
-     * @param string $tabSelected
-     * @param string $workbookViewId
-     * @access protected
-     */
-    protected function generateSHEETVIEW($tabSelected = '1',
-                                         $workbookViewId = '0')
-    {
-        $xml = '<sheetView tabSelected="' . $tabSelected .
-                '" workbookViewId="' . $workbookViewId .
-                '">__GENERATESHEETVIEW__</sheetView>';
-        
-        $this->_xml = str_replace('__GENERATESHEETVIEWS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate selection
-     *
-     * @param string $num
-     * @access protected
-     */
-    protected function generateSELECTION($num)
-    {
-        $xml = '<selection activeCell="B' . $num . 
-                '" sqref="B' . $num . '"></selection>';
-        
-        $this->_xml = str_replace('__GENERATESHEETVIEW__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate sheetformatpr
-     *
-     * @param string $baseColWidth
-     * @param string $defaultRowHeight
-     * @access protected
-     */
-    protected function generateSHEETFORMATPR($baseColWidth = '10',
-                                             $defaultRowHeight = '15')
-    {
-        $xml = '<sheetFormatPr baseColWidth="' . $baseColWidth .
-                '" defaultRowHeight="' . $defaultRowHeight .
-                '"></sheetFormatPr>__GENERATEWORKSHEET__';
-
-        $this->_xml = str_replace('__GENERATEWORKSHEET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate cols
-     *
-     * @access protected
-     */
-    protected function generateCOLS()
-    {
-        $xml = '<cols>__GENERATECOLS__</cols>__GENERATEWORKSHEET__';
-        $this->_xml = str_replace('__GENERATEWORKSHEET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate col
-     *
-     * @param string $min
-     * @param string $max
-     * @param string $width
-     * @param string $customWidth
-     * @access protected
-     */
-    protected function generateCOL($min = '1', $max = '1',
-                                   $width = '11.85546875', $customWidth = '1')
-    {
-        $xml = '<col min="' . $min . '" max="' . $max . '" width="' . $width . 
-                '" customWidth="' . $customWidth . '"></col>';
-
-        $this->_xml = str_replace('__GENERATECOLS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate sheetdata
-     *
-     * @access protected
-     */
-    protected function generateSHEETDATA()
-    {
-        $xml = '<sheetData>__GENERATESHEETDATA__</sheetData>' .
-            '__GENERATEWORKSHEET__';
-        $this->_xml = str_replace('__GENERATEWORKSHEET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate row
-     *
-     * @param string $r
-     * @param string $spans
-     * @access protected
-     */
-    protected function generateROW($r, $spans)
-    {
-        $spans = '1:' . ($spans + 1);
-        $xml = '<row r="' . $r . '" spans="' . $spans . 
-                '">__GENERATEROW__</row>__GENERATESHEETDATA__';
-
-        $this->_xml = str_replace('__GENERATESHEETDATA__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate c
-     *
-     * @param string $r
-     * @param string $s
-     * @param string $t
-     * @access protected
-     */
-    protected function generateC($r, $s, $t = '')
-    {
-        $xmlAux = '<c r="' . $r . '"';
-        if ($s != '') {
-            $xmlAux .= ' s="' . $s . '"';
-        }
-        if ($t != '') {
-            $xmlAux .= ' t="' . $t . '"';
-        }
-        $xmlAux .= '>__GENERATEC__</c>__GENERATEROW__';
-        $this->_xml = str_replace('__GENERATEROW__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate v
-     *
-     * @param string $num
-     * @access protected
-     */
-    protected function generateV($num)
-    {
-        $this->_xml = str_replace(
-            '__GENERATEC__', '<v>' . $num . '</v>', $this->_xml
-        );
-    }
-
-    /**
-     * Generate pagemargins
-     *
-     * @param string $left
-     * @param string $rigth
-     * @param string $bottom
-     * @param string $top
-     * @param string $header
-     * @param string $footer
-     * @access protected
-     */
-    protected function generatePAGEMARGINS($left = '0.7', $rigth = '0.7',
-                                           $bottom = '0.75', $top = '0.75',
-                                           $header = '0.3', $footer = '0.3')
-    {
-        $xml = '<pageMargins left="' . $left . '" right="' . $rigth . 
-                '" top="' . $top . '" bottom="' . $bottom .
-                '" header="' . $header . '" footer="' . $footer .
-                '"></pageMargins>__GENERATEWORKSHEET__';
-        
-        $this->_xml = str_replace('__GENERATEWORKSHEET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate pagesetup
-     *
-     * @param string $paperSize
-     * @param string $orientation
-     * @param string $id
-     * @access protected
-     */
-    protected function generatePAGESETUP($paperSize = '9',
-                                         $orientation = 'portrait', $id = '1')
-    {
-        $xml = '<pageSetup paperSize="' . $paperSize .
-                '" orientation="' . $orientation . '" r:id="rId' . $id .
-                '"></pageSetup>__GENERATEWORKSHEET__';
-        
-        $this->_xml = str_replace('__GENERATEWORKSHEET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate tableparts
-     *
-     * @param string $count
-     * @access protected
-     */
-    protected function generateTABLEPARTS($count = '1')
-    {
-        $xml = '<tableParts count="' . $count . 
-                '">__GENERATETABLEPARTS__</tableParts>';
-
-        $this->_xml = str_replace('__GENERATEWORKSHEET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate tablepart
-     *
-     * @param string $id
-     * @access protected
-     */
-    protected function generateTABLEPART($id = '1')
-    {
-        $xml = '<tablePart r:id="rId' . $id . '"></tablePart>';
-        $this->_xml = str_replace('__GENERATETABLEPARTS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Clean template row tags
-     *
-     * @access private
-     */
-    private function cleanTemplateROW()
-    {
-        $this->_xml = str_replace('__GENERATEROW__', '', $this->_xml);
-    }
-}

+ 0 - 198
main/inc/lib/phpdocx/classes/CreateExcelTable.inc

@@ -1,198 +0,0 @@
-<?php
-
-/**
- * Create excel table
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create excel table
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-class CreateExcelTable extends CreateElement
-{
-    /**
-     *
-     * @var CreateExcelTable
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @return string
-     * @access public
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateExcelTable
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateExcelTable();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create excel table
-     * 
-     * @access public
-     * @param string args[0]
-     * @param string args[1]
-     */
-    public function createExcelTable()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        $type = $args[1];
-        $dats = $args[0];
-        $tamDatos = count($dats);
-        foreach ($dats as $ind => $data) {
-            $tamCols = count($data);
-            break;
-        }
-        $tamDatos = count($dats);
-        if (strpos($type, 'pie') !== false) {
-            $tamCols = 1;
-        } else {
-            $tamDatos--;
-        }
-        $this->generateTABLE($tamDatos, $tamCols);
-        $this->generateTABLECOLUMNS($tamCols + 1);
-        $this->generateTABLECOLUMN(1, ' ');
-        for ($i = 0; $i < $tamCols; $i++) {
-            if (strpos($type, 'pie') !== false) {
-                $this->generateTABLECOLUMN($i + 2, '0');
-                break;
-            }else
-                $this->generateTABLECOLUMN($i + 2, $dats[0][$i]);
-        }
-        $this->generateTABLESTYLEINFO();
-        $this->cleanTemplate();
-    }
-
-
-    /**
-     * Generate table
-     *
-     * @param int $rows
-     * @param int $cols
-     * @access protected
-     */
-    protected function generateTABLE($rows, $cols)
-    {
-        $chart = 'A';
-        for ($i = 0; $i < $cols; $i++)
-            $chart++;
-        $rows++;
-        $this->_xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'.
-                      '<table xmlns="http://schemas.openxmlformats.org/spreads'.
-                      'heetml/2006/main" id="1" name="Tabla1" displayName='.
-                      '"Tabla1" ref="A1:' . $chart . $rows .
-                      '" totalsRowShown="0" tableBorderDxfId="0">'.
-                      '__GENERATETABLE__</table>';
-    }
-
-    /**
-     * Generate tablecolumns
-     *
-     * @param string $count
-     * @access protected
-     */
-    protected function generateTABLECOLUMNS($count = '2')
-    {
-        $xml = '<tableColumns count="' . $count .
-               '">__GENERATETABLECOLUMNS__</tableColumns>__GENERATETABLE__';
-        
-        $this->_xml = str_replace('__GENERATETABLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate tablecolumn
-     *
-     * @param string $id
-     * @param string $name
-     * @access protected
-     */
-    protected function generateTABLECOLUMN($id = '2', $name = '')
-    {
-        $xml =  '<tableColumn id="' . $id . '" name="' . $name .
-                '"></tableColumn >__GENERATETABLECOLUMNS__';
-        
-        $this->_xml = str_replace(
-            '__GENERATETABLECOLUMNS__', $xml, $this->_xml
-        );
-    }
-
-    /**
-     * Generate tablestyleinfo
-     *
-     * @param string $showFirstColumn
-     * @param string $showLastColumn
-     * @param string $showRowStripes
-     * @param string $showColumnStripes
-     * @access protected
-     */
-    protected function generateTABLESTYLEINFO($showFirstColumn = '0',
-                                               $showLastColumn  = "0",
-                                               $showRowStripes  = "1",
-                                               $showColumnStripes = "0")
-    {
-        $xml = '<tableStyleInfo   showFirstColumn="' . $showFirstColumn .
-               '" showLastColumn="' . $showLastColumn .
-               '" showRowStripes="' . $showRowStripes .
-               '" showColumnStripes="' . $showColumnStripes .
-               '"></tableStyleInfo >';
-        
-        $this->_xml = str_replace('__GENERATETABLE__', $xml, $this->_xml);
-    }
-
-    
-
-}

+ 0 - 230
main/inc/lib/phpdocx/classes/CreateFontTable.inc

@@ -1,230 +0,0 @@
-<?php
-
-/**
- * Create font table
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create font table
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateFontTable extends CreateElement
-{
-    /**
-     *
-     * @var string
-     * @access protected
-     */
-    protected $_xml;
-
-    /**
-     *
-     * @var CreateFontTable
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @return string
-     * @access public
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateFontTable
-     * @access public
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateFontTable();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create font
-     *
-     * @access public
-     * @param array args[0]
-     */
-    public function createFont()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        if (!empty($args[0]['name']) && !empty($args[0]['pitch']) &&
-            !empty($args[0]['usb0']) && !empty($args[0]['usb1']) &&
-            !empty($args[0]['usb2']) && !empty($args[0]['usb3']) &&
-            !empty($args[0]['csb0']) && !empty($args[0]['csb1']) &&
-            !empty($args[0]['family']) && !empty($args[0]['charset']) &&
-            !empty($args[0]['panose1'])
-        ) {
-            $this->generateFONT($args[0]['name']);
-            $this->generatePANOSE1($args[0]['panose1']);
-            $this->generateCHARSET($args[0]['charset']);
-            $this->generateFAMILY($args[0]['family']);
-            $this->generatePITCH($args[0]['pitch']);
-            $this->generateSIG(
-                $args[0]['usb0'], $args[0]['usb1'], $args[0]['usb2'],
-                $args[0]['usb3'], $args[0]['csb0'], $args[0]['csb1']
-            );
-        } else {
-            exit('You`re adding an empty font');
-        }
-    }
-
-    /**
-     * Generate w:font
-     *
-     * @param string $name
-     * @access protected
-     */
-    protected function generateFONT($name = 'Calibri')
-    {
-        $this->_xml = '<' . CreateElement::NAMESPACEWORD . 
-                       ':font ' . CreateDocx::NAMESPACEWORD .
-                       ':name="' . $name .
-                       '">__GENERATEFONT__</' . CreateElement::NAMESPACEWORD .
-                       ':font>';
-    }
-
-    /**
-     * Generate w:panose1
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generatePANOSE1($val = '020F0502020204030204')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-               ':panose1 ' . CreateElement::NAMESPACEWORD .
-               ':val="' . $val .
-               '"></' . CreateElement::NAMESPACEWORD .
-               ':panose1>__GENERATEPANOSE1__';
-
-        $this->_xml = str_replace('__GENERATEFONT__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:charset
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateCHARSET($val = '00')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-               ':charset ' . CreateElement::NAMESPACEWORD .
-               ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-               ':charset>__GENERATECHARSET__';
-
-        $this->_xml = str_replace('__GENERATEPANOSE1__', $xml, $this->_xml);
-    }
-    
-    /**
-     * Generate w:family
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateFAMILY($val = 'swiss')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':family ' . CreateElement::NAMESPACEWORD .
-                ':val="' . $val .
-                '"></' . CreateElement::NAMESPACEWORD .
-                ':family>__GENERATEFAMILY__';
-        
-        $this->_xml = str_replace('__GENERATECHARSET__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:pitch
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generatePITCH($val = '00')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':pitch ' . CreateElement::NAMESPACEWORD .
-                ':val="' . $val .
-                '"></' . CreateElement::NAMESPACEWORD .
-                ':pitch>__GENERATEPITCH__';
-        
-        $this->_xml = str_replace('__GENERATEFAMILY__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:sig
-     *
-     * @param string $usbA
-     * @param string $usbB
-     * @param string $usbC
-     * @param string $usbD
-     * @param string $csbA
-     * @param string $csbB
-     * @access protected
-     */
-    protected function generateSIG($usbA = 'A00002EF', $usbB = '4000207B',
-                                   $usbC = '00000000', $usbD = '00000000',
-                                   $csbA = '0000009F', $csbB = '00000000')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-               ':sig ' . CreateElement::NAMESPACEWORD .
-               ':usb0="' . $usbA . '" ' . CreateElement::NAMESPACEWORD .
-               ':usb1="' . $usbB . '" ' . CreateElement::NAMESPACEWORD .
-               ':usb2="' . $usbC . '" ' . CreateElement::NAMESPACEWORD .
-               ':usb3="' . $usbD . '" ' . CreateElement::NAMESPACEWORD .
-               ':csb0="' . $csbA . '" ' . CreateElement::NAMESPACEWORD .
-               ':csb1="' . $csbB . '"></' . CreateElement::NAMESPACEWORD .
-               ':sig>';
-
-        $this->_xml = str_replace('__GENERATEPITCH__', $xml, $this->_xml);
-    }
-}

+ 0 - 214
main/inc/lib/phpdocx/classes/CreateFooter.inc

@@ -1,214 +0,0 @@
-<?php
-
-/**
- * Create footer
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create footer
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateFooter extends CreateElement
-{
-    /**
-     *
-     * @var CreateFooter
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     *
-     * @var int
-     * @access private
-     * @static
-     */
-    private static $_numberPage = 0;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-    
-    /**
-     *
-     * @return string
-     * @access public
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateFooter
-     * @access public
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateFooter();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create footer
-     *
-     * @access public
-     * @param string args[0]
-     * @param array args[1]
-     */
-    public function createFooter()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        $this->generateFTR();
-        if ($args[1]['pager'] == 'true') {
-            $this->generateP();
-            $this->generateR();
-            $this->generatePTAB('margin', $args[1]['pagerAlignment']);
-            $this->generateFLDSIMPLE();
-        }
-        $text = CreateText::getInstance();
-        $text->createText($args[0], $args[1]);
-        $obj = preg_replace('/__[A-Z]+__/', '', (string) $text);
-        $xml = $obj . '__GENERATEFTR__';
-        $this->_xml = str_replace('__GENERATEFTR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate ftr token
-     *
-     * @access protected
-     */
-    protected function generateFTR()
-    {
-        //$this->_xml = '__GENERATEFTR____GENERATEIMGFTR__';
-        $this->_xml = '';
-    }
-
-    /**
-     * Generate w:p
-     *
-     * @access protected
-     */
-    protected function generateP()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':p>__GENERATEP__</' . CreateElement::NAMESPACEWORD .
-                ':p>__GENERATEFTR__';
-        $this->_xml = str_replace('__GENERATEFTR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:r
-     *
-     * @access protected
-     */
-    protected function generateR()
-    {
-        if (!empty($this->_xml)) {
-            if (preg_match("/__GENERATEP__/", $this->_xml)) {
-                $xml = '<' . CreateElement::NAMESPACEWORD .
-                        ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                        ':r>__GENERATERSUB__';
-                
-                $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml);
-            } elseif (preg_match("/__GENERATER__/", $this->_xml)) {
-                $xml = '<' . CreateElement::NAMESPACEWORD .
-                        ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                        ':r>__GENERATERSUB__';
-
-                $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-            } elseif (preg_match("/__GENERATERSUB__/", $this->_xml)) {
-                $xml = '<' . CreateElement::NAMESPACEWORD .
-                        ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                        ':r>__GENERATERSUB__';
-
-                $this->_xml = str_replace(
-                    '__GENERATERSUB__', $xml, $this->_xml
-                );
-            }
-        } else {
-            $this->_xml = '<' . CreateElement::NAMESPACEWORD .
-                          ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                          ':r>__GENERATERSUB__';
-        }
-    }
-
-    /**
-     * Generate w:ptab
-     *
-     * @param string $relativeTo
-     * @param string $alignment
-     * @param string $leader
-     * @access protected
-     */
-    protected function generatePTAB($relativeTo = 'margin',
-                                     $alignment = 'right',
-                                     $leader = 'none')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':ptab ' . CreateElement::NAMESPACEWORD .
-                ':relativeTo="' . $relativeTo .
-                '" ' . CreateElement::NAMESPACEWORD .
-                ':alignment="' . $alignment .
-                '" ' . CreateElement::NAMESPACEWORD .
-                ':leader="' . $leader .
-                '"></' . CreateElement::NAMESPACEWORD . ':ptab>';
-
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:fldsimple
-     *
-     * @access protected
-     */
-    protected function generateFLDSIMPLE()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':fldSimple ' . CreateElement::NAMESPACEWORD .
-                ':instr=" PAGE   \* MERGEFORMAT "></'
-                . CreateElement::NAMESPACEWORD . ':fldSimple>';
-
-        $this->_xml = str_replace('__GENERATERSUB__', $xml, $this->_xml);
-    }
-}

+ 0 - 312
main/inc/lib/phpdocx/classes/CreateFootnote.inc

@@ -1,312 +0,0 @@
-<?php
-
-/**
- * Create footnote
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create footnote
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateFootnote extends CreateElement
-{
-    /**
-     *
-     * @var bool
-     * @access public
-     * @static
-     */
-    public static $init = 0;
-
-    /**
-     *
-     * @var CreateFootnote
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     *
-     * @var int
-     * @access private
-     * @static
-     */
-    private static $_id;
-    
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @return string
-     * @access public
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateFootnote
-     * @access public
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateFootnote();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create footnote
-     *
-     * @access public
-     * @param array $args[0]
-     *
-     */
-    public function createFootnote()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        $this->generateFOOTNOTE('');
-        $this->generateP();
-        $this->generatePPR();
-        $this->generatePSTYLE();
-        $this->generateR();
-        $this->generateRPR();
-        $this->generateRSTYLE();
-        $this->generateFOOTNOTEREF();
-        $this->generateR();
-        if ($args[0]['font'] != '') {
-            $this->generateRPR();
-            $this->generateRFONTS($args[0]['font']);
-        }
-        $this->generateT($args[0]['textEndNote']);
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Create document footnote
-     *
-     * @access public
-     * @param array $args[0]
-     *
-     */
-    public function createDocumentFootnote()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        parent::generateP();
-        $this->generateR();
-        if ($args[0]['font'] != '') {
-            $this->generateRPR();
-            $this->generateRFONTS($args[0]['font']);
-        }
-        $xml = '';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-        $this->generateT($args[0]['textDocument']);
-        $this->generateR();
-        $this->generateRPR();
-        $this->generateRSTYLE();
-        $this->generateFOOTNOTEREFERENCE(self::$_id - 2);
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Create init footnote
-     *
-     * @access public
-     * @param array $args[0]
-     *
-     */
-    public function createInitFootnote()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        $this->generateFOOTNOTE($args[0]['type']);
-        $this->generateP();
-        $this->generatePPR();
-        $this->generateSPACING();
-        $this->generateR();
-        $this->generateSEPARATOR($args[0]['type']);
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Generate w:footnote
-     *
-     * @param string $type
-     * @access protected
-     */
-    protected function generateFOOTNOTE($type)
-    {
-        self::$init = 1;
-        if (empty(self::$_id)) {
-            self::$_id = 1;
-        } else {
-            self::$_id++;
-        }
-
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':footnote';
-
-        if ($type != '')
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . 
-                       ':type="' . $type . '"';
-
-        $this->_xml = $xmlAux . ' ' . CreateElement::NAMESPACEWORD .
-                    ':id="' . (self::$_id - 2) .
-                    '">__GENERATEFOOTNOTE__</' . CreateElement::NAMESPACEWORD .
-                    ':footnote>';
-    }
-
-    /**
-     * Generate w:p
-     *
-     * @param string $rsidR
-     * @param string $rsidRDefault
-     * @param string $rsidP
-     * @access protected
-     */
-    protected function generateP($rsidR = '005F02E5', 
-                                 $rsidRDefault = '005F02E5',
-                                 $rsidP = '005F02E5')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-               ':p>__GENERATEP__</' . CreateElement::NAMESPACEWORD . ':p>';
-
-        $this->_xml = str_replace('__GENERATEFOOTNOTE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:separator
-     *
-     * @param string $type
-     * @access protected
-     */
-    protected function generateSEPARATOR($type = 'separator')
-    {
-        $xml = '<w:' . $type . '></w:' . $type . '>';
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:ppr
-     *
-     * @access protected
-     */
-    protected function generatePPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':pPr>__GENERATEPPR__</' . CreateElement::NAMESPACEWORD .
-                ':pPr>__GENERATEP__';
-
-        $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:spacing
-     *
-     * @param string $after
-     * @param string $line
-     * @param string $lineRule
-     * @access protected
-     */
-    protected function generateSPACING($after = '0',
-                                       $line = '240', $lineRule = 'auto')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':spacing w:after="' . $after .
-                '" ' . CreateElement::NAMESPACEWORD .
-                ':line="' . $line .
-                '" ' . CreateElement::NAMESPACEWORD .
-                ':lineRule="' . $lineRule .
-                '"></' . CreateElement::NAMESPACEWORD .
-                ':spacing>';
-
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:r
-     *
-     * @access protected
-     */
-    protected function generateR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':r>__GENERATER__</' . CreateElement::NAMESPACEWORD .
-                ':r>__GENERATEP__';
-
-        $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:footnoteref
-     *
-     * @access protected
-     */
-    protected function generateFOOTNOTEREF()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':footnoteRef></' . CreateElement::NAMESPACEWORD .
-                ':footnoteRef>';
-
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:footnotereference
-     *
-     * @param string $id
-     * @access protected
-     */
-    protected function generateFOOTNOTEREFERENCE($id = '')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':footnoteReference ' . CreateElement::NAMESPACEWORD .
-                ':id="' . $id . '"></' . CreateElement::NAMESPACEWORD .
-                ':footnoteReference>';
-        
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-}

+ 0 - 1746
main/inc/lib/phpdocx/classes/CreateGraphic.inc

@@ -1,1746 +0,0 @@
-<?php
-
-/**
- * Create graphics (charts)
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create graphics (charts)
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateGraphic extends CreateElement
-{
-    const NAMESPACEWORD = 'c';
-
-    /**
-     *
-     * @access protected
-     * @var <type>
-     */
-    protected $_xmlChart;
-    
-    /**
-     * @access private
-     * @var CreateGraphic
-     * @static
-     */
-    private static $_instance = null;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_rId;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_textalign;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_jc;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_sizeX;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_sizeY;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_type;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_showPercent;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_data;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_cornerX;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_cornerY;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_cornerP;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_color;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_groupBar;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_title;
-
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_name;
-
-    /**
-     * @access private
-     * @var string
-     */
-    private $_font;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-        $this->_rId = '';
-        $this->_textalign = '';
-        $this->_jc = '';
-        $this->_sizeX = '';
-        $this->_sizeY = '';
-        $this->_type = '';
-        $this->_showPercent = '';
-        $this->_data = '';
-        $this->_cornerX = '';
-        $this->_cornerY = '';
-        $this->_cornerP = '';
-        $this->_color = '';
-        $this->_groupBar = '';
-        $this->_title = '';
-        $this->_font = '';
-        $this->_xml = '';
-        $this->_name = '';
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @access public
-     * @return CreateGraphic
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateGraphic();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Setter. Rid
-     *
-     * @access public
-     * @param string $rId
-     */
-    public function setRId($rId)
-    {
-        $this->_rId = $rId;
-    }
-
-    /**
-     * Getter. Rid
-     *
-     * @access public
-     * @return string
-     */
-    public function getRId()
-    {
-        return $this->_rId;
-    }
-
-    /**
-     * Setter. Name
-     *
-     * @access public
-     * @param string $name
-     */
-    public function setName($name)
-    {
-        $this->_name = $name;
-    }
-
-    /**
-     * Getter. Name
-     *
-     * @access public
-     * @return string
-     */
-    public function getName()
-    {
-        return $this->_name;
-    }
-
-    /**
-     * Setter. Xml chart
-     *
-     * @access public
-     * @param string $xmlChart
-     */
-    public function setXmlChart($xmlChart)
-    {
-        $this->_xmlChart = $xmlChart;
-    }
-
-    /**
-     * Getter. Xml chart
-     *
-     * @access public
-     * @return string
-     */
-    public function getXmlChart()
-    {
-        return $this->_xmlChart;
-    }
-
-    /**
-     * Create graphic
-     *
-     * @access public
-     * @param array $args[0]
-     * @param array $args[1]
-     * @return boolean
-     */
-    public function createGraphic()
-    {
-        $this->_xmlChart = '';
-        $args = func_get_args();
-        if (!empty($args[1]['type']) && !empty($args[0])) {
-            if ($this->createCHARTXML($args) == false) {
-                echo 'You haven`t added legends';
-                return false;
-            }
-            $this->createDOCUEMNTXML($args);
-            return true;
-        } else {
-            echo 'You haven`t added a chart type';
-            return false;
-        }
-    }
-
-    /**
-     * Generate chartspace XML
-     *
-     * @access protected
-     */
-    protected function generateCHARTSPACE()
-    {
-        $this->_xmlChart = '<?xml version="1.0" encoding="UTF-8" ' .
-            'standalone="yes" ?><' . CreateGraphic::NAMESPACEWORD .
-            ':chartSpace xmlns:c="http://schemas.openxmlformats.o' .
-            'rg/drawingml/2006/chart" xmlns:a="http://schemas.open' .
-            'xmlformats.org/drawingml/2006/main" xmlns:r="http://s' .
-            'chemas.openxmlformats.org/officeDocument/2006/relatio' .
-            'nships">__GENERATECHARTSPACE__</' .
-            CreateGraphic::NAMESPACEWORD . ':chartSpace>';
-    }
-
-    /**
-     * Generate w:date1904
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateDATE1904($val = '1')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':date1904 val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':date1904>__GENERATECHARTSPACE__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHARTSPACE__',
-            $xml,
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:lang
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateLANG($val = 'es-ES')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':lang val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':lang>__GENERATECHARTSPACE__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHARTSPACE__',
-            $xml,
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:style
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSTYLE($val = '2')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':style val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':style>__GENERATECHARTSPACE__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHARTSPACE__',
-            $xml,
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:title
-     *
-     * @access protected
-     */
-    protected function generateTITLE()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':title>__GENERATETITLE__</' . CreateGraphic::NAMESPACEWORD .
-            ':title>__GENERATECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:titletx
-     *
-     * @access protected
-     */
-    protected function generateTITLETX()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':tx>__GENERATETITLETX__</' . CreateGraphic::NAMESPACEWORD .
-            ':tx>__GENERATETITLE__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLE__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:rich
-     *
-     * @access protected
-     */
-    protected function generateRICH()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':rich>__GENERATERICH__</' . CreateGraphic::NAMESPACEWORD .
-            ':rich>__GENERATETITLETX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLETX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:bodypr
-     *
-     * @access protected
-     */
-    protected function generateBODYPR()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . ':bodyPr></' .
-            CreateImage::NAMESPACEWORD1 . ':bodyPr>__GENERATERICH__';
-        $this->_xmlChart = str_replace(
-            '__GENERATERICH__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:lststyle
-     *
-     * @access protected
-     */
-    protected function generateLSTSTYLE()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-            ':lstStyle></' . CreateImage::NAMESPACEWORD1 .
-            ':lstStyle>__GENERATERICH__';
-        $this->_xmlChart = str_replace(
-            '__GENERATERICH__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:titlep
-     *
-     * @access protected
-     */
-    protected function generateTITLEP()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-            ':p>__GENERATETITLEP__</' . CreateImage::NAMESPACEWORD1 .
-            ':p>__GENERATERICH__';
-        $this->_xmlChart = str_replace(
-            '__GENERATERICH__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:titleppr
-     *
-     * @access protected
-     */
-    protected function generateTITLEPPR()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-            ':pPr>__GENERATETITLEPPR__</' . CreateImage::NAMESPACEWORD1 .
-            ':pPr>__GENERATETITLEP__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLEP__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:titlerfonts
-     *
-     * @access protected
-     * @param string $font
-     */
-    protected function generateTITLERFONTS($font = '')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . ':latin typeface="' .
-            $font . '" pitchFamily="34" charset="0"></' .
-            CreateImage::NAMESPACEWORD1 . ':latin ><' .
-            CreateImage::NAMESPACEWORD1 .
-            ':cs typeface="' . $font . '" pitchFamily="34" charset="0"></' .
-            CreateImage::NAMESPACEWORD1 . ':cs>';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLERPR__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:defrpr
-     *
-     * @access protected
-     */
-    protected function generateDEFRPR()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-            ':defRPr>__GENERATEDEFRPR__</' . CreateImage::NAMESPACEWORD1 .
-            ':defRPr>__GENERATETITLEPPR__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLEPPR__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:titler
-     *
-     * @access protected
-     */
-    protected function generateTITLER()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-            ':r>__GENERATETITLER__</' . CreateImage::NAMESPACEWORD1 .
-            ':r>__GENERATETITLEP__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLEP__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:titlerpr
-     *
-     * @access protected
-     */
-    protected function generateTITLERPR($lang = 'es-ES')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . ':rPr lang="' .
-            $lang . '">__GENERATETITLERPR__</' . CreateImage::NAMESPACEWORD1 .
-            ':rPr>__GENERATETITLER__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLER__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:titlet
-     *
-     * @access protected
-     * @param string $nombre
-     */
-    protected function generateTITLET($nombre = '')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . ':t>' .
-            $nombre . '</' . CreateImage::NAMESPACEWORD1 .
-            ':t>__GENERATETITLER__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLER__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:titlelayout
-     *
-     * @access protected
-     * @param string $nombre
-     */
-    protected function generateTITLELAYOUT($nombre = '')
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 .
-            ':layout></' . CreateImage::NAMESPACEWORD1 .
-            ':layout>';
-        $this->_xmlChart = str_replace(
-            '__GENERATETITLE__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:autotitledeleted
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateAUTOTITLEDELETED($val = '1')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':autoTitleDeleted val="' . $val .
-            '"></' . CreateGraphic::NAMESPACEWORD .
-            ':autoTitleDeleted>__GENERATECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:chart
-     *
-     * @access protected
-     */
-    protected function generateCHART()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':chart>__GENERATECHART__</' . CreateGraphic::NAMESPACEWORD .
-            ':chart>__GENERATECHARTSPACE__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHARTSPACE__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:plotarea
-     *
-     * @access protected
-     */
-    protected function generatePLOTAREA()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':plotArea>__GENERATEPLOTAREA__</' . CreateGraphic::NAMESPACEWORD .
-            ':plotArea>__GENERATECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:layout
-     *
-     * @access protected
-     */
-    protected function generateLAYOUT()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':layout></' . CreateGraphic::NAMESPACEWORD .
-            ':layout>__GENERATEPLOTAREA__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEPLOTAREA__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:piechart
-     *
-     * @access protected
-     */
-    protected function generatePIECHART()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':pieChart>__GENERATETYPECHART__</' .
-            CreateGraphic::NAMESPACEWORD .
-            ':pieChart>__GENERATEPLOTAREA__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEPLOTAREA__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:barChart
-     *
-     * @access protected
-     */
-    protected function generateBARCHART()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':barChart>__GENERATETYPECHART__</' .
-            CreateGraphic::NAMESPACEWORD .
-            ':barChart>__GENERATEPLOTAREA__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEPLOTAREA__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:lineChart
-     *
-     * @access protected
-     */
-    protected function generateLINECHART()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':lineChart>__GENERATETYPECHART__</' .
-            CreateGraphic::NAMESPACEWORD .
-            ':lineChart>__GENERATEPLOTAREA__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEPLOTAREA__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:varyColors
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateVARYCOLORS($val = '1')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':varyColors val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':varyColors>__GENERATETYPECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:barDir
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateBARDIR($val = 'bar')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':barDir val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':barDir>__GENERATETYPECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:grouping
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateGROUPING($val = 'stacked')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':grouping val="' . $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':grouping>__GENERATETYPECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:ser
-     *
-     * @access protected
-     */
-    protected function generateSER()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':ser>__GENERATESER__</' . CreateGraphic::NAMESPACEWORD .
-            ':ser>__GENERATETYPECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:idx
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateIDX($val = '0')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':idx val="' . $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':idx>__GENERATESER__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESER__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:order
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateORDER($val = '0')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':order val="' . $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':order>__GENERATESER__';
-        $this->_xml = str_replace(
-            '__GENERATESER__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:tx
-     *
-     * @access protected
-     */
-    protected function generateTX()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':tx>__GENERATETX__</' . CreateGraphic::NAMESPACEWORD .
-            ':tx>__GENERATESER__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESER__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:strref
-     *
-     * @access protected
-     */
-    protected function generateSTRREF()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':strRef>__GENERATESTRREF__</' . CreateGraphic::NAMESPACEWORD .
-            ':strRef>__GENERATETX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:f
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateF($val = 'Hoja1!$B$1')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':f>' .
-            $val . '</' . CreateGraphic::NAMESPACEWORD .
-            ':f>__GENERATESTRREF__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESTRREF__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:strcache
-     *
-     * @access protected
-     */
-    protected function generateSTRCACHE()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':strCache>__GENERATESTRCACHE__</' . CreateGraphic::NAMESPACEWORD .
-            ':strCache>__GENERATESTRREF__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESTRREF__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:ptcount
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generatePTCOUNT($val = '1')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':ptCount val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':ptCount>__GENERATESTRCACHE__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESTRCACHE__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:pt
-     *
-     * @access protected
-     * @param string $idx
-     */
-    protected function generatePT($idx = '0')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':pt idx="' .
-            $idx . '">__GENERATEPT__</' . CreateGraphic::NAMESPACEWORD .
-            ':pt>__GENERATESTRCACHE__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESTRCACHE__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:v
-     *
-     * @access protected
-     * @param string $idx
-     */
-    protected function generateV($idx = 'Ventas')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':v>' .
-            $idx . '</' . CreateGraphic::NAMESPACEWORD . ':v>';
-        $this->_xmlChart = str_replace(
-            '__GENERATEPT__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:cat
-     *
-     * @access protected
-     */
-    protected function generateCAT()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':cat>__GENERATETX__</' . CreateGraphic::NAMESPACEWORD .
-            ':cat>__GENERATESER__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESER__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:val
-     *
-     * @access protected
-     */
-    protected function generateVAL()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':val>__GENERATETX__</' . CreateGraphic::NAMESPACEWORD .
-            ':val>__GENERATESER__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESER__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:numcache
-     *
-     * @access protected
-     */
-    protected function generateNUMCACHE()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':numCache>__GENERATESTRCACHE__</' .
-            CreateGraphic::NAMESPACEWORD . ':numCache>__GENERATESTRREF__';
-        $this->_xmlChart = str_replace(
-            '__GENERATESTRREF__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:numRef
-     *
-     * @access protected
-     */
-    protected function generateNUMREF()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':numRef>__GENERATESTRREF__</' . CreateGraphic::NAMESPACEWORD .
-            ':numRef>__GENERATETX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:formatCode
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateFORMATCODE($val = 'General')
-    {
-        $this->_xmlChart = str_replace(
-            '__GENERATESTRCACHE__',
-            '<' . CreateGraphic::NAMESPACEWORD . ':formatCode>' . $val .
-            '</' . CreateGraphic::NAMESPACEWORD .
-            ':formatCode>__GENERATESTRCACHE__',
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:legend
-     *
-     * @access protected
-     */
-    protected function generateLEGEND()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':legend>__GENERATELEGEND__</' .
-            CreateGraphic::NAMESPACEWORD . ':legend>__GENERATECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHART__',
-            $xml,
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:legendPos
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateLEGENDPOS($val = 'r')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':legendPos val="' . 
-             $val . '"></' . CreateGraphic::NAMESPACEWORD .
-             ':legendPos>__GENERATELEGEND__';
-        $this->_xmlChart = str_replace(
-            '__GENERATELEGEND__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate c:layout
-     *
-     * @access protected
-     * @param string $font
-     */
-    protected function generateLEGENDFONT($font = '')
-    {
-        $xml = '<c:layout /><c:txPr><a:bodyPr /><a:lstStyle />' .
-            '<a:p><a:pPr><a:defRPr><a:latin typeface="' . $font .
-            '" pitchFamily="34" charset="0" /><a:cs typeface="' .
-            $font . '" pitchFamily="34" charset="0" /></a:defRPr>' .
-            '</a:pPr><a:endParaRPr lang="es-ES" /></a:p></c:txPr>';
-        $this->_xmlChart = str_replace(
-            '__GENERATELEGEND__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:poltVisOnly
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generatePLOTVISONLY($val = '1')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':plotVisOnly val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':plotVisOnly>__GENERATECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:externalData
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateEXTERNALDATA($val = 'rId1')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':externalData r:id="' . $val . '"></' .
-            CreateGraphic::NAMESPACEWORD . ':externalData>';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHARTSPACE__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:spPr
-     *
-     * @access protected
-     */
-    protected function generateSPPR()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':spPr>__GENERATESPPR__</' . CreateGraphic::NAMESPACEWORD .
-            ':spPr>__GENERATECHARTSPACE__';
-        $this->_xmlChart = str_replace(
-            '__GENERATECHARTSPACE__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:ln
-     *
-     * @access protected
-     */
-    protected function generateLN()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . ':ln>__GENERATELN__</' .
-            CreateImage::NAMESPACEWORD1 . ':ln>';
-        $this->_xmlChart = str_replace(
-            '__GENERATESPPR__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:noFill
-     *
-     * @access protected
-     */
-    protected function generateNOFILL()
-    {
-        $xml = '<' . CreateImage::NAMESPACEWORD1 . ':noFill></' .
-            CreateImage::NAMESPACEWORD1 . ':noFill>';
-        $this->_xmlChart = str_replace(
-            '__GENERATELN__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:overlap
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateOVERLAP($val = '100')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':overlap val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':overlap>__GENERATETYPECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:shape
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSHAPE($val = 'box')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':shape val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':shape>__GENERATETYPECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:axid
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateAXID($val = '59034624')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':axId val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':axId>__GENERATETYPECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:firstSliceAng
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateFIRSTSLICEANG($val = '0')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':firstSliceAng val="' . $val . '"></' .
-            CreateGraphic::NAMESPACEWORD . ':firstSliceAng>';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:dLbls
-     *
-     * @access protected
-     */
-    protected function generateDLBLS()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':dLbls>__GENERATEDLBLS__</' . CreateGraphic::NAMESPACEWORD .
-            ':dLbls>__GENERATETYPECHART__';
-        $this->_xmlChart = str_replace(
-            '__GENERATETYPECHART__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:showPercent
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSHOWPERCENT($val = '0')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':showPercent val="' . $val . '"></' .
-            CreateGraphic::NAMESPACEWORD . ':showPercent>';
-        $this->_xmlChart = str_replace(
-            '__GENERATEDLBLS__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:chart
-     *
-     * @access protected
-     */
-    protected function generateDOCUMENTCHART()
-    {
-        $this->_xml = str_replace(
-            '__GENERATEGRAPHICDATA__',
-            '<' . CreateGraphic::NAMESPACEWORD .
-            ':chart xmlns:c="http://schemas.openxmlformats.org/drawingml/' .
-            '2006/chart" xmlns:r="http://schemas.openxmlformats.org/offic' .
-            'eDocument/2006/relationships" r:id="rId' . $this->getRId() .
-            '"></' . CreateGraphic::NAMESPACEWORD .
-            ':chart>',
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:catAx
-     *
-     * @access protected
-     */
-    protected function generateCATAX()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':catAx>__GENERATEAX__</' . CreateGraphic::NAMESPACEWORD .
-            ':catAx>__GENERATEPLOTAREA__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEPLOTAREA__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:valAx
-     *
-     * @access protected
-     */
-    protected function generateVALAX()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':valAx>__GENERATEAX__</' .
-            CreateGraphic::NAMESPACEWORD .
-            ':valAx>';
-        $this->_xmlChart = str_replace(
-            '__GENERATEPLOTAREA__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:axId
-     *
-     * @access protected
-     * @param <type> $val
-     */
-    protected function generateAXAXID($val = '59034624')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':axId val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':axId>__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:scaling
-     *
-     * @access protected
-     */
-    protected function generateSCALING()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD .
-            ':scaling>__GENERATESCALING__</' . CreateGraphic::NAMESPACEWORD .
-            ':scaling>__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:orientation
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateORIENTATION($val = 'minMax')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':orientation val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD . ':orientation>';
-        $this->_xmlChart = str_replace(
-            '__GENERATESCALING__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:axPos
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateAXPOS($val = 'b')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':axPos val="' . $val .
-            '"></' . CreateGraphic::NAMESPACEWORD . ':axPos>__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:tickLblPos
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateTICKLBLPOS($val = 'nextTo')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':tickLblPos val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':tickLblPos>__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:crossAx
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateCROSSAX($val = '59040512')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':crossAx  val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':crossAx >__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:crosses
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateCROSSES($val = 'autoZero')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':crosses val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':crosses>__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:auto
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateAUTO($val = '1')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':auto val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':auto>__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:lblAlgn
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateLBLALGN($val = 'ctr')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':lblAlgn val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':lblAlgn>__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:lblOffset
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateLBLOFFSET($val = '100')
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':lblOffset val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD . ':lblOffset>';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:majorGridlines
-     *
-     * @access protected
-     */
-    protected function generateMAJORGRIDLINES()
-    {
-        $xml = '<' . CreateGraphic::NAMESPACEWORD . ':majorGridlines></' .
-            CreateGraphic::NAMESPACEWORD . ':majorGridlines>__GENERATEAX__';
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', $xml, $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:numFmt
-     *
-     * @access protected
-     * @param string $formatCode
-     * @param string $sourceLinked
-     */
-    protected function generateNUMFMT($formatCode='General',
-                                      $sourceLinked = '1')
-    {
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', '<' .
-            CreateGraphic::NAMESPACEWORD .
-            ':numFmt formatCode="' . $formatCode .
-            '" sourceLinked="' . $sourceLinked . '"></' .
-            CreateGraphic::NAMESPACEWORD . ':numFmt>__GENERATEAX__',
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate w:crossBetween
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateCROSSBETWEEN($val = 'between')
-    {
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__', '<' .
-            CreateGraphic::NAMESPACEWORD . ':crossBetween val="' .
-            $val . '"></' . CreateGraphic::NAMESPACEWORD .
-            ':crossBetween>',
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Create chart xml
-     *
-     * @access protected
-     * @param array $args[0]
-     */
-    protected function createCHARTXML()
-    {
-        $this->_xmlChart = '';
-        $args = func_get_args();
-        $type = $args[0][1]['type'];
-        $this->setRId($args[0][0]);
-        $this->generateCHARTSPACE();
-        $this->generateDATE1904(1);
-        $this->generateLANG();
-        $this->generateSTYLE();
-        $this->generateCHART();
-        if (!empty($args[0][1]['title'])) {
-            $this->generateTITLE();
-            $title = $args[0][1]['title'];
-            $this->generateTITLETX();
-            $this->generateRICH();
-            $this->generateBODYPR();
-            $this->generateLSTSTYLE();
-            $this->generateTITLEP();
-            $this->generateTITLEPPR();
-            $this->generateDEFRPR();
-            if (!empty($args[0][1]['font'])) {
-                $this->generateRFONTS($args[0][1]['font']);
-            }
-            $this->generateTITLER();
-            $this->generateTITLERPR();
-            if (!empty($args[0][1]['font'])) {
-                $this->generateTITLERFONTS($args[0][1]['font']);
-            }
-            $this->generateTITLET($title);
-            $this->generateTITLELAYOUT();
-        } else {
-            $this->generateAUTOTITLEDELETED();
-            $title = '';
-        }
-        if (empty($args[0][1]['data'])) {
-            exit('You haven`t added data');
-        }
-        $dats = $args[0][1]['data'];
-        $this->generatePLOTAREA();
-        $this->generateLAYOUT();
-        if (strpos($type, 'pie') !== false) {
-            $this->generatePIECHART();
-            $this->generateVARYCOLORS();
-            if (isset($dats[0])) { 
-                $legends = $dats[0];
-            } else {
-                $legends = array($title);
-            }
-            $sizeDats = count($dats);
-        } elseif (
-            (strpos($type, 'bar') !== false) ||
-            (strpos($type, 'col') !== false)
-            ) {
-            $this->generateBARCHART();
-            $typeBar = 'bar';
-            if (strpos($type, 'col') !== false) {
-                $typeBar = 'col';
-            }
-            $this->generateBARDIR($typeBar);
-            $groupBar = 'clustered';
-            $this->generateGROUPING($groupBar);
-            if (isset($dats[0])) {
-                $legends = $dats[0];
-            } else {
-                echo('You must write a legend');
-                return false;
-            }
-            $sizeDats = count($dats) - 1;
-        } elseif (strpos($type, 'line') !== false) {
-            $this->generateLINECHART();
-            $this->generateGROUPING('standard');
-            if (isset($dats[0])) $legends = $dats[0];
-            else {
-                echo('You must write a legend');
-                return false;
-            }
-            $sizeDats = count($dats) - 1;
-        } else {
-            echo('The graphic is not available');
-            return false;
-        }
-
-
-        $chart = 'A';
-        for ($i = 0; $i < count($legends); $i++) {
-            $this->generateSER();
-            $this->generateIDX($i);
-            $this->generateORDER($i);
-            $chart++;
-
-            $this->generateTX();
-            $this->generateSTRREF();
-            $this->generateF(' Hoja1!$' . $chart . '$1');
-            $this->generateSTRCACHE();
-            $this->generatePTCOUNT();
-            $this->generatePT();
-            if (strpos($args[0][1]['type'], 'pie') !== false) {
-                $this->generateV($title);
-            } else {
-                $this->generateV($legends[$i]);
-            }
-
-            $this->cleanTemplate2();
-            $this->generateCAT();
-            $this->generateSTRREF();
-            $this->generateF('Hoja1!$A$2:$A$' . ($sizeDats + 1));
-            $this->generateSTRCACHE();
-            $this->generatePTCOUNT($sizeDats);
-
-            $num = 0;
-            foreach ($dats as $legend => $dat) {
-                if ($legend == '0') continue;
-                $this->generatePT($num);
-                $this->generateV($legend);
-                $num++;
-            }
-            $this->cleanTemplate2();
-            $this->generateVAL();
-            $this->generateNUMREF();
-            $this->generateF('Hoja1!$' . $chart . '$2:$B$' . ($sizeDats + 1));
-            $this->generateNUMCACHE();
-            $this->generateFORMATCODE();
-            $this->generatePTCOUNT($sizeDats);
-            $num = 0;
-            foreach ($dats as $legend => $dat) {
-                if ($legend == '0') continue;
-                $this->generatePT($num);
-                $this->generateV($dat[$i]);
-                $num++;
-            }
-            $this->cleanTemplate3();
-        }
-        if (strpos($args[0][1]['type'], 'pie') !== false) {
-            $this->generateDLBLS();
-            $this->generateSHOWPERCENT();
-            $this->generateFIRSTSLICEANG();
-        } else {
-            $this->generateSHAPE();
-            $this->generateAXID();
-            $this->generateAXID(59040512);
-            $this->generateCATAX();
-            $this->generateAXAXID(59034624);
-            $this->generateSCALING();
-            $this->generateORIENTATION();
-            $this->generateAXPOS();
-            $this->generateTICKLBLPOS();
-            $this->generateCROSSAX();
-            $this->generateCROSSES();
-            $this->generateAUTO();
-            $this->generateLBLALGN();
-            $this->generateLBLOFFSET();
-            $this->generateVALAX();
-            $this->generateAXAXID(59040512);
-            $this->generateSCALING();
-            $this->generateORIENTATION();
-            $this->generateAXPOS('l');
-            $this->generateMAJORGRIDLINES();
-            $this->generateNUMFMT();
-            $this->generateTICKLBLPOS();
-            if (!empty($args[0][1]['font'])) {
-                $this->generateRFONTS2($args[0][1]['font']);
-            }
-            $this->generateCROSSAX(59034624);
-            $this->generateCROSSES();
-            $this->generateCROSSBETWEEN();
-        }
-
-        $this->generateLEGEND();
-        $this->generateLEGENDPOS();
-        if (!empty($args[0][1]['font'])) {
-            $this->generateLEGENDFONT($args[0][1]['font']);
-        }
-
-        $this->generatePLOTVISONLY();
-        if (strpos($args[0][1]['type'], 'pieChart') === false) {
-            $this->generateSPPR();
-            $this->generateLN();
-            $this->generateNOFILL();
-        }
-
-        $this->generateEXTERNALDATA();
-        $this->cleanTemplateDocument();
-        return true;
-    }
-
-    /**
-     * Create document xml
-     *
-     * @access protected
-     * @param array $args[0]
-     */
-    protected function createDOCUEMNTXML()
-    {
-        $args = func_get_args();
-        $ajusteTexto = 0;
-        if (isset($args[0][1]['sizeX']))
-            $sizeX = $args[0][1]['sizeX'] * CreateImage::CONSTWORD;
-        else {
-            $sizeX = 2993296;
-        }
-        if (isset($args[0][1]['sizeY']))
-            $sizeY = $args[0][1]['sizeY'] * CreateImage::CONSTWORD;
-        else {
-            $sizeY = 2238233;
-        }
-
-
-        $this->_xml = '';
-        $this->generateP();
-        $this->generateR();
-        $this->generateRPR();
-        $this->generateNOPROOF();
-        $this->generateDRAWING();
-        $this->generateINLINE();
-        $this->generateEXTENT($sizeX, $sizeY);
-        $this->generateEFFECTEXTENT();
-        $this->generateDOCPR();
-        $this->generateCNVGRAPHICFRAMEPR();
-        $this->generateGRAPHIC();
-        $this->generateGRAPHICDATA(
-            'http://schemas.openxmlformats.org/'.
-            'drawingml/2006/chart'
-        );
-        $this->generateDOCUMENTCHART();
-        $this->cleanTemplate();
-        return true;
-    }
-
-    /**
-     * Clean tags in template document
-     *
-     * @access protected
-     */
-    private function cleanTemplateDocument()
-    {
-        $this->_xmlChart = preg_replace('/__[A-Z]+__/', '', $this->_xmlChart);
-    }
-
-    /**
-     * Clean tags in template document
-     *
-     * @access protected
-     */
-    private function cleanTemplate2()
-    {
-        $this->_xmlChart = preg_replace(
-            array(
-                '/__GENERATE[A-B,D-O,Q-R,U-Z][A-Z]+__/',
-                '/__GENERATES[A-D,F-Z][A-Z]+__/', '/__GENERATETX__/'),
-            '',
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Clean tags in template document
-     *
-     * @access protected
-     */
-    private function cleanTemplate3()
-    {
-        $this->_xmlChart = preg_replace(
-            array(
-                '/__GENERATE[A-B,D-O,Q-S,U-Z][A-Z]+__/',
-                '/__GENERATES[A-D,F-Z][A-Z]+__/',
-                '/__GENERATETX__/'
-                ),
-            '',
-            $this->_xmlChart
-        );
-    }
-
-    /**
-     * Generate c:txPr
-     *
-     * @access protected
-     * @param string $font
-     */
-    private function generateRFONTS2($font)
-    {
-        $this->_xmlChart = str_replace(
-            '__GENERATEAX__',
-            '<c:txPr><a:bodyPr /><a:lstStyle /><a:p>' .
-            '<a:pPr><a:defRPr><a:latin typeface="' .
-            $font . '" pitchFamily="34" charset="0" /><a:cs typeface="' .
-            $font . '" pitchFamily="34" charset="0" /></a:defRPr>' .
-            '</a:pPr><a:endParaRPr lang="es-ES" /></a:p></c:txPr>' .
-            '__GENERATEAX__', $this->_xmlChart
-        );
-    }
-
-}

+ 0 - 130
main/inc/lib/phpdocx/classes/CreateHeader.inc

@@ -1,130 +0,0 @@
-<?php
-
-/**
- * Create header
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create header
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateHeader extends CreateElement
-{
-    /**
-     *
-     * @var CreateFooter
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @return string
-     * @access public
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateHeader
-     * @access public
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateHeader();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Generate w:p
-     *
-     * @access protected
-     */
-    protected function generateP()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-                ':p>__GENERATEP__</' . CreateElement::NAMESPACEWORD .
-                ':p>__GENERATEHDR__';
-
-        $this->_xml = str_replace('__GENERATEHDR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate hdr token
-     *
-     * @access protected
-     */
-    protected function generateHDR()
-    {
-        //$this->_xml = '__GENERATEHDR____GENERATEHDRIMG__';
-        $this->_xml = '__GENERATEHDR__';
-    }
-
-    /**
-     * Create header
-     *
-     * @access public
-     * @param string args[0]
-     * @param array args[1]
-     */
-    public function createHeader()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-
-        $text = CreateText::getInstance();
-        $text->createText($args[0], $args[1]);
-        $this->generateHDR();
-        $this->_xml = str_replace(
-//            '__GENERATEHDR__', (string) $text . '__GENERATEHDR__',
-            '__GENERATEHDR__', (string) $text,
-            $this->_xml
-        );
-    }
-
-}

+ 0 - 365
main/inc/lib/phpdocx/classes/CreateImage.inc

@@ -1,365 +0,0 @@
-<?php
-
-/**
- * Create images
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create images
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateImage extends CreateElement
-{
-    const NAMESPACEWORD = 'wp';
-    const NAMESPACEWORD1 = 'a';
-    const NAMESPACEWORD2 = 'pic';
-    const CONSTWORD = 360000;
-    const TAMBORDER = 12700;
-
-    /**
-     * @access private
-     * @var CreateImage
-     * @static
-     */
-    private static $_instance = NULL;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_name;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_rId;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_ajusteTexto;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_sizeX;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_sizeY;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_spacingTop;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_spacingBottom;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_spacingLeft;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_spacingRight;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_jc;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_border;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_borderDiscontinuo;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private $_scaling;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-        $this->_name = '';
-        $this->_rId = '';
-        $this->_ajusteTexto = '';
-        $this->_sizeX = '';
-        $this->_sizeY = '';
-        $this->_spacingTop = '';
-        $this->_spacingBottom = '';
-        $this->_spacingLeft = '';
-        $this->_spacingRight = '';
-        $this->_jc = '';
-        $this->_border = '';
-        $this->_borderDiscontinuo = '';
-        $this->_scaling = '';
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @return string
-     * @access public
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateImage
-     * @access public
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateImage();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Setter. Name
-     *
-     * @access public
-     * @param string $name
-     */
-    public function setName($name)
-    {
-        $this->_name = $name;
-    }
-
-    /**
-     * Getter. Name
-     *
-     * @access public
-     * @return <type>
-     */
-    public function getName()
-    {
-        return $this->_name;
-    }
-
-    /**
-     * Setter. Rid
-     *
-     * @access public
-     * @param string $rId
-     */
-    public function setRId($rId)
-    {
-        $this->_rId = $rId;
-    }
-
-    /**
-     * Getter. Rid
-     *
-     * @access public
-     * @return <type>
-     */
-    public function getRId()
-    {
-        return $this->_rId;
-    }
-
-    /**
-     * Create image
-     *
-     * @access public
-     * @param array $args[0]
-     */
-    public function createImage()
-    {
-        $this->_xml = '';
-        $this->_name = '';
-        $this->_rId = '';
-        $args = func_get_args();
-        if (!empty($args[0]['rId']) && (!empty($args[0]['name']))) {
-            $arr = array();
-            $atributos = getimagesize($args[0]['name']);
-
-            $ajusteTexto = 0;
-
-            if (!empty($args[0]['sizeX'])) {
-                $tamPxX = $args[0]['sizeX'];
-            } elseif (!empty($args[0]['scaling'])) {
-                $tamPxX = $atributos[0] * $args[0]['scaling'] / 100;
-            } else {
-                $tamPxX = $atributos[0];
-            }
-
-            if (!empty($args[0]['scaling'])) {
-                $tamPxY = $atributos[1] * $args[0]['scaling'] / 100;
-            } elseif (!empty($args[0]['sizeY'])) {
-                $tamPxY = $args[0]['sizeY'];
-            } else {
-                $tamPxY = $atributos[1];
-            }
-
-            $this->setName($args[0]['name']);
-            $this->setRId($args[0]['rId']);
-            $top = '0';
-            $bottom = '0';
-            $left = '0';
-            $right = '0';
-
-            switch ($atributos['mime']) {
-                case 'image/png':
-                    list($dpiX, $dpiY) =
-                        $this->get_dpi_png($args[0]['name']);
-                    $tamWordX =
-                        round($tamPxX * 100 / $dpiX * CreateImage::CONSTWORD);
-                    $tamWordY =
-                        round($tamPxY * 100 / $dpiY * CreateImage::CONSTWORD);
-                    break;
-                case 'image/jpg':
-                case 'image/jpeg':
-                    list($dpiX, $dpiY) = $this->get_dpi_jpg($args[0]['name']);
-                    $tamWordX = round(
-                        $tamPxX * 2.54 /
-                        $dpiX * CreateImage::CONSTWORD
-                    );
-                    $tamWordY = round(
-                        $tamPxY * 2.54 /
-                        $dpiY * CreateImage::CONSTWORD
-                    );
-                    break;
-                case 'image/gif':
-                    $tamWordX = round(
-                        $tamPxX * 2.54 /
-                        96 * CreateImage::CONSTWORD
-                    );
-                    $tamWordY = round(
-                        $tamPxY * 2.54 /
-                        96 * CreateImage::CONSTWORD
-                    );
-                    break;
-            }
-            $align = '';
-            $this->generateP();
-            $this->generateR();
-            $this->generateRPR();
-            $this->generateNOPROOF();
-            $this->generateDRAWING();
-            $this->generateINLINE();
-            $this->generateEXTENT($tamWordX, $tamWordY);
-            $this->generateEFFECTEXTENT($left, $top, $right, $bottom);
-            $this->generateDOCPR();
-            $this->generateCNVGRAPHICFRAMEPR();
-            $this->generateGRAPHICPRAMELOCKS(1);
-            $this->generateGRAPHIC();
-            $this->generateGRAPHICDATA();
-            $this->generatePIC();
-            $this->generateNVPICPR();
-            $this->generateCNVPR();
-            $this->generateCNVPICPR();
-            $this->generateBLIPFILL();
-            $this->generateBLIP();
-            $this->generateSTRETCH();
-            $this->generateFILLRECT();
-            $this->generateSPPR();
-            $this->generateXFRM();
-            $this->generateOFF();
-            $this->generateEXT($tamWordX, $tamWordY);
-            $this->generatePRSTGEOM();
-            $this->generateAVLST();
-            $this->cleanTemplate();
-        } else {
-            echo 'There was an error adding the image';
-        }
-    }
-
-    /**
-     * Get image jpg dpi
-     *
-     * @access private
-     * @param string $filename
-     * @return array
-     */
-    private function get_dpi_jpg($filename)
-    {
-        $a = fopen($filename, 'r');
-        $string = fread($a, 20);
-        fclose($a);
-        $data = bin2hex(substr($string, 14, 4));
-        $x = substr($data, 0, 4);
-        $y = substr($data, 4, 4);
-        return array(hexdec($x), hexdec($y));
-    }
-
-    /**
-     * Get image png dpi
-     *
-     * @access private
-     * @param string $filename
-     * @return array
-     */
-    private function get_dpi_png($filename)
-    {
-        $a = fopen($filename, 'r');
-        $string = fread($a, 1000);
-        $aux = strpos($string, 'pHYs');
-        $data = bin2hex(substr($string, $aux + strlen('pHYs'), 16));
-        fclose($a);
-        $x = substr($data, 0, 8);
-        $y = substr($data, 8, 8);
-        return array(hexdec($x), hexdec($y));
-    }
-}

+ 0 - 263
main/inc/lib/phpdocx/classes/CreateLink.inc

@@ -1,263 +0,0 @@
-<?php
-
-/**
- * Create links using text strings
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create links using text strings
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateLink extends CreateElement
-{
-
-    /**
-     *
-     * @access private
-     * @static
-     */
-    private static $_instance = null;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_link;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_title;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_font;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     * Magic method, returns current XML
-     *
-     * @access public
-     * @return string Return current XML
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     * Singleton, return instance of class
-     *
-     * @access public
-     * @return CreateLink
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateLink();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Getter. Access to link var
-     *
-     * @access public
-     * @return string
-     */
-    public function getLink()
-    {
-        return $this->_link;
-    }
-
-    /**
-     * Getter. Access to title var
-     *
-     * @access public
-     * @return string
-     */
-    public function getTitle()
-    {
-        return $this->_title;
-    }
-
-    /**
-     * Getter. Access to font var
-     *
-     * @access public
-     * @return string
-     */
-    public function getFont()
-    {
-        return $this->_font;
-    }
-
-    /**
-     * Create a link
-     *
-     * @access public
-     * @param string $arrArgs[0] Text to add
-     * @param string $arrArgs[1] URL to add
-     * @param string $arrArgs[2] RFONTS
-     */
-    public function createLink()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-
-        $this->generateP();
-        $this->generateR();
-        $this->generateFLDCHAR('begin');
-        $this->generateR();
-        $this->generateINSTRTEXT($args[1]);
-        $this->generateR();
-        $this->generateFLDCHAR('separate');
-        $this->generatePROOFERR('gramStart');
-        $this->generateR();
-        $this->generateRPR();
-        $this->generateRFONTS($args[2]);
-        $this->generateRSTYLE('Hipervnculo');
-        $this->generateT($args[0]);
-        $this->generatePROOFERR('gramEnd');
-        $this->generateR();
-        $this->generateFLDCHAR('end');
-    }
-
-    /**
-     * Generate w:fldChar
-     * 
-     * @access protected
-     * @param string $fldCharType
-     */
-    protected function generateFLDCHAR($fldCharType)
-    {
-        $strXML = '<' . CreateElement::NAMESPACEWORD . ':fldChar '
-                . CreateElement::NAMESPACEWORD . ':fldCharType="'
-                . $fldCharType . '"></'
-                . CreateElement::NAMESPACEWORD . ':fldChar>';
-        $this->_xml = str_replace('__GENERATER__', $strXML, $this->_xml);
-    }
-
-    /**
-     * Generate w:hyperlink
-     * 
-     * @access protected
-     * @param string $type
-     */
-    protected function generateHYPERLINK($type)
-    {
-        $this->_xml = '<' . createElement::NAMESPACEWORD
-                . ':hyperlink r:id="rId5" w:history="1">__GENERATEP__</'
-                . createElement::NAMESPACEWORD . ':hyperlink>';
-    }
-
-    /**
-     * Generate w:instrText
-     * 
-     * @access protected
-     * @param string $link. Optional, use http://localhost as default
-     */
-    protected function generateINSTRTEXT($link = 'http://localhost')
-    {
-        $xml = '<' . createElement::NAMESPACEWORD
-                . ':instrText xml:space="preserve"> HYPERLINK "'
-                . $link . '"</' . createElement::NAMESPACEWORD
-                . ':instrText>';
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:proofErr
-     * 
-     * @access protected
-     * @param string $type
-     */
-    protected function generatePROOFERR($type)
-    {
-        $xml = '<' . createElement::NAMESPACEWORD . ':proofErr '
-                . createElement::NAMESPACEWORD . ':type="' . $type
-                . '"></' . createElement::NAMESPACEWORD
-                . ':proofErr>__GENERATERSUB__';
-        $this->_xml = str_replace('__GENERATERSUB__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:r
-     * 
-     * @access protected
-     */
-    protected function generateR()
-    {
-        if (preg_match("/__GENERATEP__/", $this->_xml)) {
-            $xml = '<' . createElement::NAMESPACEWORD
-                    . ':r>__GENERATER__</' . createElement::NAMESPACEWORD
-                    . ':r>__GENERATERSUB__';
-            $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml);
-        } elseif (preg_match("/__GENERATERSUB__/", $this->_xml)) {
-            $xml = '<' . createElement::NAMESPACEWORD . ':r>'
-                    . '__GENERATER__</' . createElement::NAMESPACEWORD
-                    . ':r>__GENERATERSUB__';
-            $this->_xml = str_replace('__GENERATERSUB__', $xml, $this->_xml);
-        } else {
-            $this->_xml = '<' . createElement::NAMESPACEWORD
-                    . ':r>__GENERATER__</' . createElement::NAMESPACEWORD
-                    . ':r>__GENERATERSUB__';
-        }
-    }
-
-    /**
-     * Generate w:rStyle
-     * 
-     * @access protected
-     * @param string $val
-     */
-    protected function generateRSTYLE($val)
-    {
-        $xml = '<' . createElement::NAMESPACEWORD . ':rStyle '
-                . createElement::NAMESPACEWORD . ':val="' . $val . '"></'
-                . createElement::NAMESPACEWORD . ':rStyle>';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-}

+ 0 - 267
main/inc/lib/phpdocx/classes/CreateList.inc

@@ -1,267 +0,0 @@
-<?php
-
-/**
- * Create lists
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create lists
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateList extends CreateElement
-{
-    /**
-     *
-     * @var mixed
-     * @access public
-     */
-    public $list;
-    /**
-     *
-     * @var array
-     * @access public
-     */
-    public $val;
-    /**
-     *
-     * @var string
-     * @access public
-     */
-    public $font;
-    /**
-     *
-     * @var array
-     * @access public
-     */
-    public $data;
-    /**
-     * @access private
-     * @var CreateList
-     * @static
-     */
-    private static $_instance = NULL;
-    /**
-     *
-     * @access private
-     * @var int
-     * @static
-     */
-    private static $_numericList = -1;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-        $this->cleanTemplate();
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @access public
-     * @return CreateList
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateList();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create list
-     * 
-     * @access public
-     * @param array args[0]
-     * @param array args[1]
-     */
-    public function createList()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        $this->list = '';
-
-        if ($args[1]['val'] == 2) {
-            self::$_numericList++;
-            $this->runArray(
-                $args[0],
-                $args[1]['val'] + self::$_numericList,
-                1,
-                $args[1]['font']
-            );
-        } else {
-            $this->runArray($args[0], $args[1]['val'], 1, $args[1]['font']);
-        }
-
-        $this->_xml = $this->list;
-    }
-
-    /**
-     * Add list
-     *
-     * @param string $list
-     * @access protected
-     */
-    protected function addList($list)
-    {
-        $this->_xml = str_replace('__GENERATER__', $list, $this->_xml);
-    }
-
-    /**
-     * Generate w:ilfo
-     *
-     * @param int $val
-     * @access protected
-     */
-    protected function generateILFO($val = 0)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':ilfo ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val .
-            '"></' . CreateElement::NAMESPACEWORD .
-            ':ilfo>';
-        $this->_xml = str_replace('__GENERATEILFO__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:ilvl
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateILVL($val = '')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':ilvl ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':ilvl>__GENERATEPSTYLE__';
-        $this->_xml = str_replace('__GENERATEPSTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:listpr
-     *
-     * @access protected
-     */
-    protected function generateLISTPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':listPr>__GENERATEILVL____GENERATEILFO__</' .
-            CreateElement::NAMESPACEWORD . ':listPr>__GENERATER__';
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:numid
-     *
-     * @param int $val
-     * @access protected
-     */
-    protected function generateNUMID($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':numId ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':numId>';
-        $this->_xml = str_replace('__GENERATEPSTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:numpr
-     *
-     * @access protected
-     */
-    protected function generateNUMPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':numPr>__GENERATEPSTYLE__</' . CreateElement::NAMESPACEWORD .
-            ':numPr>';
-        $this->_xml = str_replace('__GENERATEPSTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:pstyle
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generatePSTYLE($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':pStyle ' . CreateElement::NAMESPACEWORD . ':val="' . $val .
-            '">__GENERATEPSTYLE__</' . CreateElement::NAMESPACEWORD .
-            ':pStyle>';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Recursive generation of lists
-     *
-     * @param array $dat
-     * @param string $val
-     * @param int $depth
-     * @param string $font
-     * @access protected
-     */
-    protected function runArray($dat, $val, $depth, $font = '')
-    {
-        foreach ($dat as $cont) {
-                $this->generateP();
-                $this->generatePPR();
-                $this->generatePSTYLE('Prrafodelista');
-                $this->generateNUMPR();
-                $this->generateILVL($depth);
-                $this->generateNUMID($val);
-                $this->generateR();
-                if ($font != '') {
-                    $this->generateRPR();
-                    $this->generateRFONTS($font);
-                }
-                $this->generateT($cont);
-                $this->list .= $this->_xml;
-        }
-    }
-}

+ 0 - 299
main/inc/lib/phpdocx/classes/CreatePage.inc

@@ -1,299 +0,0 @@
-<?php
-
-/**
- * Create pages
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create pages
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreatePage extends CreateElement
-{
-
-    /**
-     * @access protected
-     * @var string
-     */
-    protected $_xml;
-    
-    /**
-     * @access private
-     * @var CreatePage
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @access public
-     * @return CreatePage
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreatePage();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create page
-     */
-    public function createPage()
-    {
-        $this->_xml = '';
-    }
-
-    /**
-     * Create sectpr
-     *
-     * @access public
-     * @param array args[0]
-     */
-    public function createSECTPR()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        $this->generateSECTPR();
-        if (!empty($args[0]['orient']) && $args[0]['orient'] == 'landscape') {
-            $this->generatePGSZ(16838, 11906, 'landscape');
-        } else {
-            $this->generatePGSZ(11906, 16838);
-        }
-        $this->generatePGMAR($args);
-        $this->generateCOLS();
-        if (!empty($args[0]['titlePage'])) $this->generateTITLEPG();
-        $this->generateDOCGRID();
-    }
-
-    /**
-     * Gnerate pagebreak
-     *
-     * @access public
-     * @param string $type
-     */
-    public function generatePageBreak($type)
-    {
-        $this->_xml = '';
-        $this->generateP();
-        if ($type != 'line' && $type != '') {
-            $this->generateR();
-            $this->generateBR($type);
-        }
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Generate w:sectpr
-     *
-     * @access protected
-     * @param string $rId
-     */
-    protected function generateSECTPR($rId = '12240')
-    {
-        $this->_xml = '<' . CreateElement::NAMESPACEWORD . ':sectPr ' .
-            CreateDocx::NAMESPACEWORD . ':rsidR="' . $rId . '" ' .
-            CreateDocx::NAMESPACEWORD . ':rsidRPr="' . $rId . '" ' .
-            CreateDocx::NAMESPACEWORD . ':rsidSect="' . $rId .
-            '">__GENERATEHEADERREFERENCE____GENERATEFOOTERREFERENCE____' .
-            'GENERATESECTPR__</' . CreateElement::NAMESPACEWORD .
-            ':sectPr>';
-    }
-
-    /**
-     * Generate w:pgsz
-     *
-     * @access protected
-     * @param string $w
-     * @param string $h
-     * @param string $orient
-     */
-    protected function generatePGSZ($w = '11906', $h = '16838', $orient = '')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':pgSz ' .
-            CreateElement::NAMESPACEWORD . ':w="' . $w . '" ' .
-            CreateElement::NAMESPACEWORD . ':h="' . $h . '"';
-        if ($orient != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . ':orient="' .
-                $orient . '"';
-        }
-
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':pgSz>__GENERATEPGSZ__';
-
-        $this->_xml = str_replace('__GENERATESECTPR__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate w:pgmar
-     *
-     * @access protected
-     * @param array $args[0]
-     */
-    protected function generatePGMAR()
-    {
-        $top = '1440';
-        $right = '1800';
-        $bottom = '1440';
-        $left = '1800';
-        $header = '0';
-        $footer = '0';
-        $gutter = '0';
-        $args = func_get_args();
-        if (isset($args[0][0]['top'])) $top = $args[0][0]['top'];
-        if (isset($args[0][0]['bottom'])) $bottom = $args[0][0]['bottom'];
-        if (isset($args[0][0]['right'])) $right = $args[0][0]['right'];
-        if (isset($args[0][0]['left'])) $left = $args[0][0]['left'];
-
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':pgMar ' .
-            CreateElement::NAMESPACEWORD . ':top="' . $top . '" ' .
-            CreateElement::NAMESPACEWORD . ':right="' . $right . '" ' .
-            CreateElement::NAMESPACEWORD . ':bottom="' . $bottom . '" ' .
-            CreateElement::NAMESPACEWORD . ':left="' . $left . '" ' .
-            CreateElement::NAMESPACEWORD . ':header="' . $header . '" ' .
-            CreateElement::NAMESPACEWORD . ':footer="' . $footer . '" ' .
-            CreateElement::NAMESPACEWORD . ':gutter="' . $gutter . '"></' .
-            CreateElement::NAMESPACEWORD . ':pgMar>__GENERATEPGMAR__';
-        $this->_xml = str_replace('__GENERATEPGSZ__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:cols
-     *
-     * @access protected
-     * @param string $num
-     * @param string $sep
-     * @param string $space
-     * @param string $equalWidth
-     */
-    protected function generateCOLS($num = '', $sep = '', $space = '708',
-                                    $equalWidth = '')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':cols ' .
-            CreateElement::NAMESPACEWORD . ':space="' . $space . '"></' .
-            CreateElement::NAMESPACEWORD . ':cols>__GENERATECOLS__';
-        $this->_xml = str_replace('__GENERATEPGMAR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:col
-     *
-     * @access protected
-     * @deprecated
-     * @param string $w
-     * @param string $space
-     */
-    protected function generateCOL($w = '', $space = '708')
-    {
-
-    }
-
-    /**
-     * Generate w:docgrid
-     *
-     * @access protected
-     * @param string $linepitch
-     */
-    protected function generateDOCGRID($linepitch = '360')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':docGrid ' .
-            CreateElement::NAMESPACEWORD . ':linePitch="' .
-            $linepitch . '"></' . CreateElement::NAMESPACEWORD . ':docGrid>';
-        $this->_xml = str_replace('__GENERATECOLS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:br
-     *
-     * @access protected
-     * @param string $type
-     */
-    protected function generateBR($type = '')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':br ' .
-            CreateElement::NAMESPACEWORD . ':type="' . $type . '"></' .
-            CreateElement::NAMESPACEWORD . ':br>';
-        $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:sectionsectpr
-     *
-     * @access protected
-     * @param string $rId
-     */
-    protected function generateSECTIONSECTPR($rId = '12240')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':sectPr ' .
-            CreateDocx::NAMESPACEWORD . ':rsidR="' . $rId . '" ' .
-            CreateDocx::NAMESPACEWORD . ':rsidRPr="' . $rId . '" ' .
-            CreateDocx::NAMESPACEWORD . ':rsidSect="' . $rId .
-            '">__GENERATEHEADERREFERENCE____GENERATEFOOTERREFERENCE____' .
-            'GENERATESECTPR__</' . CreateElement::NAMESPACEWORD .
-            ':sectPr>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:titlepg
-     *
-     * @access protected
-     */
-    protected function generateTITLEPG()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':titlePg></' .
-            CreateElement::NAMESPACEWORD . ':titlePg>__GENERATECOLS__';
-        $this->_xml = str_replace('__GENERATECOLS__', $xml, $this->_xml);
-    }
-
-}

+ 0 - 125
main/inc/lib/phpdocx/classes/CreateSettings.inc

@@ -1,125 +0,0 @@
-<?php
-
-/**
- * Create default settings
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create default settings
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateSettings extends CreateElement
-{
-
-    /**
-     *
-     * @access protected
-     */
-    protected $_xml;
-    /**
-     *
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     * Magic method, returns current XML
-     *
-     * @access public
-     * @return string Return current XML
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     * Singleton, return instance of class
-     *
-     * @access public
-     * @return CreateLink
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateSettings();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Generate settings
-     */
-    public function generateSettings()
-    {
-        $this->_xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'
-                . '<w:settings xmlns:o="urn:schemas-microsoft-com:office:offi'
-                . 'ce" xmlns:r="http://schemas.openxmlformats.org/officeDocume'
-                . 'nt/2006/relationships" xmlns:m="http://schemas.openxmlfor'
-                . 'mats.org/officeDocument/2006/math" xmlns:v="urn:schemas-'
-                . 'microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:'
-                . 'office:word" xmlns:w="http://schemas.openxmlformats.org/'
-                . 'wordprocessingml/2006/main" xmlns:sl="http://schemas.'
-                . 'openxmlformats.org/schemaLibrary/2006/main"><w:zoom w:'
-                . 'percent="100"/><w:proofState w:grammar="clean"/>'
-                . '<w:defaultTabStop w:val="708"/><w:hyphenationZone w:val='
-                . '"425"/><w:characterSpacingControl w:val="doNotCompress"/>'
-                . '<w:compat/><w:rsids><w:rsidRoot w:val="00A84D90"/><w:rsid '
-                . 'w:val="00A84D90"/><w:rsid w:val="00BD6F4D"/></w:rsids>'
-                . '<m:mathPr><m:mathFont m:val="Cambria Math"/><m:brkBin '
-                . 'm:val="before"/><m:brkBinSub m:val="--"/><m:smallFrac '
-                . 'm:val="off"/><m:dispDef/><m:lMargin m:val="0"/><m:rMargin '
-                . 'm:val="0"/><m:defJc m:val="centerGroup"/><m:wrapIndent '
-                . 'm:val="1440"/><m:intLim m:val="subSup"/><m:naryLim '
-                . 'm:val="undOvr"/></m:mathPr><w:themeFontLang w:val="es-ES"/>'
-                . '<w:clrSchemeMapping w:bg1="light1" w:t1="dark1" '
-                . 'w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2='
-                . '"accent2" w:accent3="accent3" w:accent4="accent4" w:accent5='
-                . '"accent5" w:accent6="accent6" w:hyperlink="hyperlink" '
-                . 'w:followedHyperlink="followedHyperlink"/><w:shapeDefaults>'
-                . '<o:shapedefaults v:ext="edit" spidmax="2050"/>'
-                . '<o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/>'
-                . '</o:shapelayout></w:shapeDefaults><w:decimalSymbol'
-                . ' w:val=","/><w:listSeparator w:val=";"/></w:settings>';
-    }
-
-}

+ 0 - 2643
main/inc/lib/phpdocx/classes/CreateStyle.inc

@@ -1,2643 +0,0 @@
-<?php
-
-/**
- * Create styles
- *
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    2.1
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create styles
- *
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    2.1
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateStyle extends CreateElement
-{
-
-    /**
-     * @access protected
-     * @var string
-     */
-    protected $_xml;
-    /**
-     * @access private
-     * @var CreateStyle
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-        
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-        
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @access public
-     * @return CreateStyle
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateStyle();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Add style
-     *
-     * @access public
-     * @param array $args[0]
-     */
-    public function addStyle()
-    {
-        $args = func_get_args();
-        if (!empty($args[0][0]['type']) && !empty($args[0][0]['styleId'])) {
-            $this->generateSTYLE(
-                $args[0][0]['type'], $args[0][0]['styleId'],
-                $args[0][0]['default'], $args[0][0]['customStyle']
-            );
-        }
-        if (!empty($args[0][0]['name'])) {
-            $this->generateNAME($args[0][0]['name']);
-        }
-        if (!empty($args[0][0]['basedOn'])) {
-            $this->generateBASEDON($args[0][0]['basedOn']);
-        }
-        if (!empty($args[0][0]['next'])) {
-            $this->generateNEXT($args[0][0]['next']);
-        }
-        if (!empty($args[0][0]['link'])) {
-            $this->generateLINK($args[0][0]['link']);
-        }
-        if ($args[0][0]['autoRedefine'] == 1) {
-            $this->generateAUTOREDEFINE();
-        }
-        if (!empty($args[0][0]['uiPriority'])) {
-            $this->generateUIPRIORITY($args[0][0]['uiPriority']);
-        }
-        if ($args[0][0]['semiHidden'] == 1) {
-            $this->generateSEMIHIDDEN();
-        }
-        if ($args[0][0]['unhideWhenUsed'] == 1) {
-            $this->generateUNHIDEWHENUSED();
-        }
-        if ($args[0][0]['qFormat'] == 1) {
-            $this->generateQFORMAT();
-        }
-        if (!empty($args[0][0]['rsid'])) {
-            $this->generateRSID($args[0][0]['rsid']);
-        }
-        if ($args[0][0]['keepNext'] == 1 ||
-            !empty($args[0][0]['keepLines']) ||
-            (isset($args[0][0]['spacing_before']) ||
-            isset($args[0][0]['spacing_after']) ||
-            isset($args[0][0]['spacing_line']) ||
-            isset($args[0][0]['spacing_lineRule'])) ||
-            !empty($args[0][0]['outlineLvl']) ||
-            $args[0][0]['contextualSpacing'] == 1 ||
-            isset($args[0][0]['ilvl']) ||
-            isset($args[0][0]['ind_left'])) {
-            $this->generatePPR();
-            if ($args[0][0]['keepNext'] == 1)
-                $this->generateKEEPNEXT();
-
-            if (!empty($args[0][0]['keepLines'])) {
-                $this->generateKEEPLINES($args[0][0]['keepLines']);
-            }
-
-            if (isset($args[0][0]['pBdr_bottom_val']) &&
-                isset($args[0][0]['pBdr_bottom_sz']) &&
-                isset($args[0][0]['pBdr_bottom_space']) &&
-                isset($args[0][0]['pBdr_bottom_color']) &&
-                isset($args[0][0]['pBdr_bottom_themeColor'])) {
-                $this->generatePBDR();
-                $this->generatePBDR_BOTTOM(
-                    $args[0][0]['pBdr_bottom_val'],
-                    $args[0][0]['pBdr_bottom_sz'],
-                    $args[0][0]['pBdr_bottom_space'],
-                    $args[0][0]['pBdr_bottom_color'],
-                    $args[0][0]['pBdr_bottom_themeColor']
-                );
-            }
-
-            if (!empty($args[0][0]['tab_center']) || $args[0][0]['tab_right']) {
-                $this->generateTABS();
-                if (!empty($args[0][0]['tab_center'])) {
-                    $this->generateTABCENTER($args[0][0]['tab_center']);
-                }
-                if (!empty($args[0][0]['tab_right'])) {
-                    $this->generateTABRIGHT($args[0][0]['tab_right']);
-                }
-            }
-
-            if (isset($args[0][0]['spacing_before']) ||
-                isset($args[0][0]['spacing_after']) ||
-                isset($args[0][0]['spacing_line']) ||
-                isset($args[0][0]['spacing_lineRule'])) {
-                $this->generateSPACING(
-                    $args[0][0]['spacing_before'],
-                    $args[0][0]['spacing_after'],
-                    $args[0][0]['spacing_line'],
-                    $args[0][0]['spacing_lineRule']
-                );
-            }
-            if (isset($args[0][0]['ind_left'])) {
-                $this->generateIND($args[0][0]['ind_left']);
-            }
-            if ($args[0][0]['contextualSpacing'] == 1) {
-                $this->generateCONTEXTUALSPACING();
-            }
-            if (isset($args[0][0]['outlineLvl'])) {
-                $this->generateOUTLINELVL($args[0][0]['outlineLvl']);
-            }
-            if (isset($args[0][0]['ilvl'])) {
-                $this->generateNUMPR();
-                $this->generateILVL($args[0][0]['ilvl']);
-            }
-        }
-        if ((!empty($args[0][0]['rFonts_asciiTheme']) &&
-            !empty($args[0][0]['rFonts_eastAsiaTheme']) &&
-            !empty($args[0][0]['rFonts_hAnsiTheme']) &&
-            !empty($args[0][0]['rFonts_cstheme'])) ||
-            $args[0][0]['b'] == 1 ||
-            $args[0][0]['bCs'] == 1 ||
-            $args[0][0]['i'] == 1 ||
-            $args[0][0]['iCs'] == 1 ||
-            $args[0][0]['u'] == 1 ||
-            !empty($args[0][0]['color_val']) ||
-            !empty($args[0][0]['sz']) ||
-            !empty($args[0][0]['szCs']) ||
-            !empty($args[0][0]['kern']) ||
-            !empty($args[0][0]['rPr_spacing']) ||
-            !empty($args[0][0]['u']) ||
-            !empty($args[0][0]['vertAlign'])) {
-            $this->generateRPR();
-            if (!empty($args[0][0]['rFonts_asciiTheme']) &&
-                !empty($args[0][0]['rFonts_eastAsiaTheme']) &&
-                !empty($args[0][0]['rFonts_hAnsiTheme']) &&
-                !empty($args[0][0]['rFonts_cstheme']))
-                $this->generateRFONTS(
-                    $args[0][0]['rFonts_asciiTheme'],
-                    $args[0][0]['rFonts_eastAsiaTheme'],
-                    $args[0][0]['rFonts_hAnsiTheme'],
-                    $args[0][0]['rFonts_cstheme']
-                );
-
-            if (!empty($args[0][0]['rFonts_ascii']) &&
-                !empty($args[0][0]['rFonts_hAnsi']) &&
-                !empty($args[0][0]['rFonts_cs'])) {
-                $this->generateRFONTS2(
-                    $args[0][0]['rFonts_ascii'],
-                    $args[0][0]['rFonts_hAnsi'],
-                    $args[0][0]['rFonts_cs']
-                );
-            }
-            if (isset($args[0][0]['b']) && $args[0][0]['b'] == 1) {
-                $this->generateB();
-            }
-            if (isset($args[0][0]['bCs']) && $args[0][0]['bCs'] == 1) {
-                $this->generateBCS();
-            }
-            if (isset($args[0][0]['i'])) {
-                $this->generateI($args[0][0]['i']);
-            }
-            if (isset($args[0][0]['iCs'])) {
-                $this->generateICS($args[0][0]['iCs']);
-            }
-            if (isset($args[0][0]['u']) && $args[0][0]['u'] == 1) {
-                $this->generateU();
-            }
-            if (!empty($args[0][0]['color_val'])) {
-                $this->generateCOLOR(
-                    $args[0][0]['color_val'],
-                    $args[0][0]['color_themeColor'],
-                    $args[0][0]['color_themeShade']
-                );
-            }
-            if (!empty($args[0][0]['u'])) {
-                $this->generateU($args[0][0]['u']);
-            }
-            if (!empty($args[0][0]['rPr_spacing'])) {
-                $this->generateRPR_SPACING($args[0][0]['rPr_spacing']);
-            }
-            if (!empty($args[0][0]['kern'])) {
-                $this->generateKERN($args[0][0]['kern']);
-            }
-            if (!empty($args[0][0]['sz'])) {
-                $this->generateSZ($args[0][0]['sz']);
-            }
-            if (!empty($args[0][0]['szCs'])) {
-                $this->generateSZCS($args[0][0]['szCs']);
-            }
-            if (!empty($args[0][0]['vertAlign'])) {
-                $this->generateVERTALIGN($args[0][0]['vertAlign']);
-            }
-        }
-        if ((isset($args[0][0]['top_w']) &&
-            isset($args[0][0]['top_type'])) ||
-            (isset($args[0][0]['left_w']) &&
-            isset($args[0][0]['left_type'])) ||
-            (isset($args[0][0]['bottom_w']) &&
-            isset($args[0][0]['bottom_type'])) ||
-            (isset($args[0][0]['right_w']) &&
-            isset($args[0][0]['right_type'])) ||
-            (isset($args[0][0]['tblInd_w']) &&
-            isset($args[0][0]['tblInd_type'])) &&
-            (isset($args[0][0]['tblborder_top_val'])) ||
-            (isset($args[0][0]['tblborder_left_val'])) ||
-            (isset($args[0][0]['tblborder_bottom_val'])) ||
-            (isset($args[0][0]['tblborder_right_val'])) ||
-            (isset($args[0][0]['tblborder_insideH_val'])) ||
-            (isset($args[0][0]['tblborder_insideV_val']))) {
-            $this->generateTBLPR();
-            if (isset($args[0][0]['tbl_style_row'])) {
-                $this->generateTBLSTYLEROWBANDSIZE(
-                    $args[0][0]['tbl_style_row']
-                );
-            }
-            if (isset($args[0][0]['tbl_style_col'])) {
-                $this->generateTBLSTYLECOLBANDSIZE(
-                    $args[0][0]['tbl_style_col']
-                );
-            }
-            if (isset($args[0][0]['tblInd_w']) &&
-                isset($args[0][0]['tblInd_type'])) {
-                $this->generateTBLIND(
-                    $args[0][0]['tblInd_w'],
-                    $args[0][0]['tblInd_type']
-                );
-            }
-            if ((isset($args[0][0]['tblborder_top_val'])) ||
-                (isset($args[0][0]['tblborder_left_val'])) ||
-                (isset($args[0][0]['tblborder_bottom_val'])) ||
-                (isset($args[0][0]['tblborder_right_val'])) ||
-                (isset($args[0][0]['tblborder_insideH_val'])) ||
-                (isset($args[0][0]['tblborder_insideV_val']))) {
-                $this->generateTBLBORDERS();
-
-                if (isset($args[0][0]['tblborder_top_val'])) {
-                    $this->generateTBLBORDERS_TOP(
-                        $args[0][0]['tblborder_top_val'],
-                        $args[0][0]['tblborder_top_sz'],
-                        $args[0][0]['tblborder_top_space'],
-                        $args[0][0]['tblborder_top_color'],
-                        $args[0][0]['tblborder_top_themeColor'],
-                        $args[0][0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0][0]['tblborder_left_val'])) {
-                    $this->generateTBLBORDERS_LEFT(
-                        $args[0][0]['tblborder_left_val'],
-                        $args[0][0]['tblborder_left_sz'],
-                        $args[0][0]['tblborder_left_space'],
-                        $args[0][0]['tblborder_left_color'],
-                        $args[0][0]['tblborder_left_themeColor'],
-                        $args[0][0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0][0]['tblborder_bottom_val'])) {
-                    $this->generateTBLBORDERS_BOTTOM(
-                        $args[0][0]['tblborder_bottom_val'],
-                        $args[0][0]['tblborder_bottom_sz'],
-                        $args[0][0]['tblborder_bottom_space'],
-                        $args[0][0]['tblborder_bottom_color'],
-                        $args[0][0]['tblborder_bottom_themeColor'],
-                        $args[0][0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0][0]['tblborder_right_val'])) {
-                    $this->generateTBLBORDERS_RIGHT(
-                        $args[0][0]['tblborder_right_val'],
-                        $args[0][0]['tblborder_right_sz'],
-                        $args[0][0]['tblborder_right_space'],
-                        $args[0][0]['tblborder_right_color'],
-                        $args[0][0]['tblborder_right_themeColor'],
-                        $args[0][0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0][0]['tblborder_insideH_val'])) {
-                    $this->generateTBLBORDERS_INSIDEH(
-                        $args[0][0]['tblborder_insideH_val'],
-                        $args[0][0]['tblborder_insideH_sz'],
-                        $args[0][0]['tblborder_insideH_space'],
-                        $args[0][0]['tblborder_insideH_color'],
-                        $args[0][0]['tblborder_insideH_themeColor'],
-                        $args[0][0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0][0]['tblborder_insideV_val'])) {
-                    $this->generateTBLBORDERS_INSIDEV(
-                        $args[0][0]['tblborder_insideV_val'],
-                        $args[0][0]['tblborder_insideV_sz'],
-                        $args[0][0]['tblborder_insideV_space'],
-                        $args[0][0]['tblborder_insideV_color'],
-                        $args[0][0]['tblborder_insideV_themeColor'],
-                        $args[0][0]['tblborder_insideV_themeTint']
-                    );
-                }
-            }
-
-            if ((isset($args[0][0]['top_w']) &&
-                isset($args[0][0]['top_type'])) ||
-                (isset($args[0][0]['left_w']) &&
-                isset($args[0][0]['left_type'])) ||
-                (isset($args[0][0]['bottom_w']) &&
-                isset($args[0][0]['bottom_type'])) ||
-                (isset($args[0][0]['right_w']) &&
-                isset($args[0][0]['right_type']))) {
-
-                $this->generateTBLCELLMAR();
-                if (isset($args[0][0]['top_w']) &&
-                    isset($args[0][0]['top_type'])) {
-                    $this->generateTOP(
-                        $args[0][0]['top_w'],
-                        $args[0][0]['top_type']
-                    );
-                }
-                if (isset($args[0][0]['left_w']) &&
-                    isset($args[0][0]['left_type'])) {
-                    $this->generateLEFT(
-                        $args[0][0]['left_w'],
-                        $args[0][0]['left_type']
-                    );
-                }
-                if (isset($args[0][0]['bottom_w']) &&
-                    isset($args[0][0]['bottom_type'])) {
-                    $this->generateBOTTOM(
-                        $args[0][0]['bottom_w'],
-                        $args[0][0]['bottom_type']
-                    );
-                }
-                if (isset($args[0][0]['right_w']) &&
-                    isset($args[0][0]['right_type'])) {
-                    $this->generateRIGHT(
-                        $args[0][0]['right_w'],
-                        $args[0][0]['right_type']
-                    );
-                }
-            }
-        }
-        if (isset($args[0][0]['shd_val']) &&
-            isset($args[0][0]['shd_color']) &&
-            isset($args[0][0]['shd_fill']) &&
-            isset($args[0][0]['shd_themeFill'])) {
-            $this->generateTCPR();
-            $this->generateSHD(
-                $args[0][0]['shd_val'],
-                $args[0][0]['shd_color'],
-                $args[0][0]['shd_fill'],
-                $args[0][0]['shd_themeFill'],
-                $args[0][0]['shd_themeFillTint']
-            );
-        }
-        if (count($args[0]) > 1) {
-            for ($i = 1; $i < count($args[0]); $i++) {
-                $this->addStyleTabla($args[0][$i]);
-            }
-        }
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Create style
-     *
-     * @access public
-     * @param string $lang
-     */
-    public function createStyle($lang = 'en-US')
-    {
-        $this->_xml .= '<w:docDefaults><w:rPrDefault><w:rPr>' .
-            '<w:rFonts w:asciiTheme="minorHAnsi" w:eastAsiaTh' .
-            'eme="minorHAnsi" w:hAnsiTheme="minorHAnsi" w:cst' .
-            'heme="minorBidi"/><w:sz w:val="22"/><w:szCs w:val="22"/>' .
-            '<w:lang w:val="' . $lang . '" w:eastAsia="' . $lang .
-            '" w:bidi="ar-SA"/></w:rPr></w:rPrDefault><w:pPrDefault>' .
-            '<w:pPr><w:spacing w:after="200" w:line="276" w:lineRule' .
-            '="auto"/></w:pPr></w:pPrDefault></w:docDefaults>' .
-            '<w:latentStyles w:defLockedState="0" w:defUIPriority="99" ' .
-            'w:defSemiHidden="1" w:defUnhideWhenUsed="1" w:defQFormat' .
-            '="0" w:count="267">' .
-            '<w:lsdException w:name="Normal" w:semiHidden="0" w:uiPriorit' .
-            'y="0" w:unhideWhenUsed="0" w:qFormat="1"/><w:lsdException w:n' .
-            'ame="heading 1" w:semiHidden="0" w:uiPriority="9" w:unhideWhen' .
-            'Used="0" w:qFormat="1"/><w:lsdException w:name="heading 2" w:u' .
-            'iPriority="9" w:qFormat="1"/><w:lsdException w:name="heading ' .
-            '3" w:uiPriority="9" w:qFormat="1"/><w:lsdException w:name="h' .
-            'eading 4" w:uiPriority="9" w:qFormat="1"/><w:lsdException ' .
-            'w:name="heading 5" w:uiPriority="9" w:qFormat="1"/><w:lsd' .
-            'Exception w:name="heading 6" w:uiPriority="9" w:qFormat=' .
-            '"1"/><w:lsdException w:name="heading 7" w:uiPriority="9" ' .
-            'w:qFormat="1"/><w:lsdException w:name="heading 8" w:uiPriority' .
-            '="9" w:qFormat="1"/><w:lsdException w:name="heading 9" w:uiPr' .
-            'iority="9" w:qFormat="1"/><w:lsdException w:name="toc 1" ' .
-            'w:uiPriority="39"/><w:lsdException w:name="toc 2" w:ui' .
-            'Priority="39"/><w:lsdException w:name="toc 3" w:ui' .
-            'Priority="39"/><w:lsdException w:name="toc 4" w:uiPr' .
-            'iority="39"/><w:lsdException w:name="toc 5" w:uiPrior' .
-            'ity="39"/><w:lsdException w:name="toc 6" w:uiPriority="39"/>' .
-            '<w:lsdException w:name="toc 7" w:uiPriority="39"/>' .
-            '<w:lsdException w:name="toc 8" w:uiPriority="39"/>' .
-            '<w:lsdException w:name="toc 9" w:uiPriority="39"/>' .
-            '<w:lsdException w:name="caption" w:uiPriority="35" ' .
-            'w:qFormat="1"/><w:lsdException w:name="Title" w:sem' .
-            'iHidden="0" w:uiPriority="10" w:unhideWhenUsed="0" w:qFo' .
-            'rmat="1"/><w:lsdException w:name="Default Paragraph Font" w:ui' .
-            'Priority="1"/><w:lsdException w:name="Subtitle" w:semiHidd' .
-            'en="0" w:uiPriority="11" w:unhideWhenUsed="0" w:qForm' .
-            'at="1"/><w:lsdException w:name="Strong" w:semiHidden="0" w:uiP' .
-            'riority="22" w:unhideWhenUsed="0" w:qFormat="1"/><w:lsdExc' .
-            'eption w:name="Emphasis" w:semiHidden="0" w:uiPriority="20" w:u' .
-            'nhideWhenUsed="0" w:qFormat="1"/><w:lsdException w:name="Ta' .
-            'ble Grid" w:semiHidden="0" w:uiPriority="59" w:unhideWhenUs' .
-            'ed="0"/><w:lsdException w:name="Placeholder Text" w:unhide' .
-            'WhenUsed="0"/><w:lsdException w:name="No Spacing" w:semiHi' .
-            'dden="0" w:uiPriority="1" w:unhideWhenUsed="0" w:qForm' .
-            'at="1"/><w:lsdException w:name="Light Shading" w:semiHi' .
-            'dden="0" w:uiPriority="60" w:unhideWhenUsed="0"/><w:lsd' .
-            'Exception w:name="Light List" w:semiHidden="0" w:uiPrior' .
-            'ity="61" w:unhideWhenUsed="0"/><w:lsdException w:name' .
-            '="Light Grid" w:semiHidden="0" w:uiPriority="62" w:unhid' .
-            'eWhenUsed="0"/><w:lsdException w:name="Medium Shading 1" w:semi' .
-            'Hidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/><w:lsdEx' .
-            'ception w:name="Medium Shading 2" w:semiHidden="0" w:uiPri' .
-            'ority="64" w:unhideWhenUsed="0"/><w:lsdException w:name="Me' .
-            'dium List 1" w:semiHidden="0" w:uiPriority="65" w:unhideWhe' .
-            'nUsed="0"/><w:lsdException w:name="Medium List 2" w:semiHid' .
-            'den="0" w:uiPriority="66" w:unhideWhenUsed="0"/><w:lsdExcep' .
-            'tion w:name="Medium Grid 1" w:semiHidden="0" w:uiPriorit' .
-            'y="67" w:unhideWhenUsed="0"/><w:lsdException w:name="Mediu' .
-            'm Grid 2" w:semiHidden="0" w:uiPriority="68" w:unhideWhe' .
-            'nUsed="0"/><w:lsdException w:name="Medium Grid 3" w:semi' .
-            'Hidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/><w:lsd' .
-            'Exception w:name="Dark List" w:semiHidden="0" w:uiPrio' .
-            'rity="70" w:unhideWhenUsed="0"/><w:lsdException w:name="Colo' .
-            'rful Shading" w:semiHidden="0" w:uiPriority="71" w:unh' .
-            'ideWhenUsed="0"/><w:lsdException w:name="Colorful List" w:sem' .
-            'iHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/><w:lsdEx' .
-            'ception w:name="Colorful Grid" w:semiHidden="0" w:uiPrio' .
-            'rity="73" w:unhideWhenUsed="0"/><w:lsdException w:name="Lig' .
-            'ht Shading Accent 1" w:semiHidden="0" w:uiPriority="60" w:un' .
-            'hideWhenUsed="0"/><w:lsdException w:name="Light List Acce' .
-            'nt 1" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUs' .
-            'ed="0"/><w:lsdException w:name="Light Grid Accent 1" w:sem' .
-            'iHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>' .
-            '<w:lsdException w:name="Medium Shading 1 Accent 1" w' .
-            ':semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="' .
-            '0"/><w:lsdException w:name="Medium Shading 2 Accent' .
-            ' 1" w:semiHidden="0" w:uiPriority="64" w:unhideWhen' .
-            'Used="0"/><w:lsdException w:name="Medium List 1 Acc' .
-            'ent 1" w:semiHidden="0" w:uiPriority="65" w:unhideW' .
-            'henUsed="0"/><w:lsdException w:name="Revision" w:un' .
-            'hideWhenUsed="0"/><w:lsdException w:name="List Para' .
-            'graph" w:semiHidden="0" w:uiPriority="34" w:unhideW' .
-            'henUsed="0" w:qFormat="1"/><w:lsdException w:name=' .
-            '"Quote" w:semiHidden="0" w:uiPriority="29" w:unhi' .
-            'deWhenUsed="0" w:qFormat="1"/><w:lsdException w:n' .
-            'ame="Intense Quote" w:semiHidden="0" w:uiPriority' .
-            '="30" w:unhideWhenUsed="0" w:qFormat="1"/><w:lsdE' .
-            'xception w:name="Medium List 2 Accent 1" w:semiHi' .
-            'dden="0" w:uiPriority="66" w:unhideWhenUsed="0"/' .
-            '><w:lsdException w:name="Medium Grid 1 Accent 1"' .
-            ' w:semiHidden="0" w:uiPriority="67" w:unhideWhenU' .
-            'sed="0"/><w:lsdException w:name="Medium Grid 2 A' .
-            'ccent 1" w:semiHidden="0" w:uiPriority="68" w:un' .
-            'hideWhenUsed="0"/><w:lsdException w:name="Medium' .
-            ' Grid 3 Accent 1" w:semiHidden="0" w:uiPriority=' .
-            '"69" w:unhideWhenUsed="0"/><w:lsdException w:nam' .
-            'e="Dark List Accent 1" w:semiHidden="0" w:uiPri' .
-            'ority="70" w:unhideWhenUsed="0"/><w:lsdExceptio' .
-            'n w:name="Colorful Shading Accent 1" w:semiHidd' .
-            'en="0" w:uiPriority="71" w:unhideWhenUsed="0"/' .
-            '><w:lsdException w:name="Colorful List Accent 1" w:' .
-            'semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/><w:l' .
-            'sdException w:name="Colorful Grid Accent 1" w:semiHidden="' .
-            '0" w:uiPriority="73" w:unhideWhenUsed="0"/><w:lsdException' .
-            ' w:name="Light Shading Accent 2" w:semiHidden="0" w:uiPrio' .
-            'rity="60" w:unhideWhenUsed="0"/><w:lsdException w:name="Lig' .
-            'ht List Accent 2" w:semiHidden="0" w:uiPriority="61" w:unhi' .
-            'deWhenUsed="0"/><w:lsdException w:name="Light Grid Accen' .
-            't 2" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"' .
-            '/><w:lsdException w:name="Medium Shading 1 Accent 2" w:semiH' .
-            'idden="0" w:uiPriority="63" w:unhideWhenUsed="0"/><w:lsdExce' .
-            'ption w:name="Medium Shading 2 Accent 2" w:semiHidden="0" w:' .
-            'uiPriority="64" w:unhideWhenUsed="0"/><w:lsdException w:name=' .
-            '"Medium List 1 Accent 2" w:semiHidden="0" w:uiPriority="65"' .
-            ' w:unhideWhenUsed="0"/><w:lsdException w:name="Medium List 2 ' .
-            'Accent 2" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed=' .
-            '"0"/><w:lsdException w:name="Medium Grid 1 Accent 2" w:semiH' .
-            'idden="0" w:uiPriority="67" w:unhideWhenUsed="0"/><w:lsdExcept' .
-            'ion w:name="Medium Grid 2 Accent 2" w:semiHidden="0" w:uiPriori' .
-            'ty="68" w:unhideWhenUsed="0"/><w:lsdException w:name="Medi' .
-            'um Grid 3 Accent 2" w:semiHidden="0" w:uiPriority="69" w:unh' .
-            'ideWhenUsed="0"/><w:lsdException w:name="Dark List Accent 2' .
-            '" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/' .
-            '><w:lsdException w:name="Colorful Shading Accent 2" w:semi' .
-            'Hidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/><w:lsdE' .
-            'xception w:name="Colorful List Accent 2" w:semiHidden="0" ' .
-            'w:uiPriority="72" w:unhideWhenUsed="0"/><w:lsdException w:' .
-            'name="Colorful Grid Accent 2" w:semiHidden="0" w:uiPriorit' .
-            'y="73" w:unhideWhenUsed="0"/><w:lsdException w:name="Ligh' .
-            't Shading Accent 3" w:semiHidden="0" w:uiPriority="60" w:' .
-            'unhideWhenUsed="0"/><w:lsdException w:name="Light List Acc' .
-            'ent 3" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed' .
-            '="0"/><w:lsdException w:name="Light Grid Accent 3" w:semiH' .
-            'idden="0" w:uiPriority="62" w:unhideWhenUsed="0"/><w:lsdEx' .
-            'ception w:name="Medium Shading 1 Accent 3" w:semiHidden="0' .
-            '" w:uiPriority="63" w:unhideWhenUsed="0"/><w:lsdException ' .
-            'w:name="Medium Shading 2 Accent 3" w:semiHidden="0" w:uiP' .
-            'riority="64" w:unhideWhenUsed="0"/><w:lsdException w:name' .
-            '="Medium List 1 Accent 3" w:semiHidden="0" w:uiPriority' .
-            '="65" w:unhideWhenUsed="0"/><w:lsdException w:nam' .
-            'e="Medium List 2 Accent 3" w:semiHidden="0" w:uiPr' .
-            'iority="66" w:unhideWhenUsed="0"/><w:lsdException ' .
-            'w:name="Medium Grid 1 Accent 3" w:semiHidden="0" w' .
-            ':uiPriority="67" w:unhideWhenUsed="0"/><w:lsdExcep' .
-            'tion w:name="Medium Grid 2 Accent 3" w:semiHidden="0" w:uiPr' .
-            'iority="68" w:unhideWhenUsed="0"/><w:lsdException w:name=' .
-            '"Medium Grid 3 Accent 3" w:semiHidden="0" w:uiPriority="' .
-            '69" w:unhideWhenUsed="0"/><w:lsdException w:name="Dark L' .
-            'ist Accent 3" w:semiHidden="0" w:uiPriority="70" w:unhid' .
-            'eWhenUsed="0"/><w:lsdException w:name="Colorful Shading ' .
-            'Accent 3" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUse' .
-            'd="0"/><w:lsdException w:name="Colorful List Accent 3" w:sem' .
-            'iHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/><w:lsdEx' .
-            'ception w:name="Colorful Grid Accent 3" w:semiHidden="0" w:ui' .
-            'Priority="73" w:unhideWhenUsed="0"/><w:lsdException w:name="' .
-            'Light Shading Accent 4" w:semiHidden="0" w:uiPriority="60" w:' .
-            'unhideWhenUsed="0"/><w:lsdException w:name="Light List Accen' .
-            't 4" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"' .
-            '/><w:lsdException w:name="Light Grid Accent 4" w:semiHidden=' .
-            '"0" w:uiPriority="62" w:unhideWhenUsed="0"/><w:lsdException ' .
-            'w:name="Medium Shading 1 Accent 4" w:semiHidden="0" w:uiPrio' .
-            'rity="63" w:unhideWhenUsed="0"/><w:lsdException w:name="Mediu' .
-            'm Shading 2 Accent 4" w:semiHidden="0" w:uiPriority="64" w:' .
-            'unhideWhenUsed="0"/><w:lsdException w:name="Medium List 1 A' .
-            'ccent 4" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUse' .
-            'd="0"/><w:lsdException w:name="Medium List 2 Accent 4" w:se' .
-            'miHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/><w:ls' .
-            'dException w:name="Medium Grid 1 Accent 4" w:semiHidden="0" ' .
-            'w:uiPriority="67" w:unhideWhenUsed="0"/><w:lsdException w:nam' .
-            'e="Medium Grid 2 Accent 4" w:semiHidden="0" w:uiPriority="68"' .
-            ' w:unhideWhenUsed="0"/><w:lsdException w:name="Medium Grid 3 A' .
-            'ccent 4" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="' .
-            '0"/><w:lsdException w:name="Dark List Accent 4" w:semiHidden="' .
-            '0" w:uiPriority="70" w:unhideWhenUsed="0"/><w:lsdException w:n' .
-            'ame="Colorful Shading Accent 4" w:semiHidden="0" w:uiPriority=' .
-            '"71" w:unhideWhenUsed="0"/><w:lsdException w:name="Colorful ' .
-            'List Accent 4" w:semiHidden="0" w:uiPriority="72" w:unhideWhe' .
-            'nUsed="0"/><w:lsdException w:name="Colorful Grid Accent 4" w' .
-            ':semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/><w:ls' .
-            'dException w:name="Light Shading Accent 5" w:semiHidden="0" w:' .
-            'uiPriority="60" w:unhideWhenUsed="0"/><w:lsdException w:name="' .
-            'Light List Accent 5" w:semiHidden="0" w:uiPriority="61" w:unh' .
-            'ideWhenUsed="0"/><w:lsdException w:name="Light Grid Accent 5"' .
-            ' w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/><w' .
-            ':lsdException w:name="Medium Shading 1 Accent 5" w:semiHidden' .
-            '="0" w:uiPriority="63" w:unhideWhenUsed="0"/><w:lsdException' .
-            ' w:name="Medium Shading 2 Accent 5" w:semiHidden="0" w:uiPrio' .
-            'rity="64" w:unhideWhenUsed="0"/><w:lsdException w:name="Medium' .
-            ' List 1 Accent 5" w:semiHidden="0" w:uiPriority="65" w:unhideWh' .
-            'enUsed="0"/><w:lsdException w:name="Medium List 2 Accent 5" w:' .
-            'semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/><w:lsdE' .
-            'xception w:name="Medium Grid 1 Accent 5" w:semiHidden="0" w:ui' .
-            'Priority="67" w:unhideWhenUsed="0"/><w:lsdException w:name="M' .
-            'edium Grid 2 Accent 5" w:semiHidden="0" w:uiPriority="68" w:u' .
-            'nhideWhenUsed="0"/><w:lsdException w:name="Medium Grid 3 Acce' .
-            'nt 5" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"' .
-            '/><w:lsdException w:name="Dark List Accent 5" w:semiHidden="' .
-            '0" w:uiPriority="70" w:unhideWhenUsed="0"/><w:lsdException w' .
-            ':name="Colorful Shading Accent 5" w:semiHidden="0" w:uiPriori' .
-            'ty="71" w:unhideWhenUsed="0"/><w:lsdException w:name="Colorf' .
-            'ul List Accent 5" w:semiHidden="0" w:uiPriority="72" w:unhid' .
-            'eWhenUsed="0"/><w:lsdException w:name="Colorful Grid Accent 5' .
-            '" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/><w' .
-            ':lsdException w:name="Light Shading Accent 6" w:semiHidden="0' .
-            '" w:uiPriority="60" w:unhideWhenUsed="0"/><w:lsdException w:' .
-            'name="Light List Accent 6" w:semiHidden="0" w:uiPriority="61' .
-            '" w:unhideWhenUsed="0"/><w:lsdException w:name="Light Grid A' .
-            'ccent 6" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed' .
-            '="0"/><w:lsdException w:name="Medium Shading 1 Accent 6" w:s' .
-            'emiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/><w:lsd' .
-            'Exception w:name="Medium Shading 2 Accent 6" w:semiHidden="' .
-            '0" w:uiPriority="64" w:unhideWhenUsed="0"/><w:lsdException ' .
-            'w:name="Medium List 1 Accent 6" w:semiHidden="0" w:uiPriority="' .
-            '65" w:unhideWhenUsed="0"/><w:lsdException w:name="Medium List ' .
-            '2 Accent 6" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUs' .
-            'ed="0"/><w:lsdException w:name="Medium Grid 1 Accent 6" w:sem' .
-            'iHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/><w:lsdExc' .
-            'eption w:name="Medium Grid 2 Accent 6" w:semiHidden="0" w:uiP' .
-            'riority="68" w:unhideWhenUsed="0"/><w:lsdException w:name="M' .
-            'edium Grid 3 Accent 6" w:semiHidden="0" w:uiPriority="69" w:' .
-            'unhideWhenUsed="0"/><w:lsdException w:name="Dark List Accent' .
-            ' 6" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"' .
-            '/><w:lsdException w:name="Colorful Shading Accent 6" w:semi' .
-            'Hidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/><w:lsdEx' .
-            'ception w:name="Colorful List Accent 6" w:semiHidden="0" w:ui' .
-            'Priority="72" w:unhideWhenUsed="0"/><w:lsdException w:name="C' .
-            'olorful Grid Accent 6" w:semiHidden="0" w:uiPriority="73" w:un' .
-            'hideWhenUsed="0"/><w:lsdException w:name="Subtle Emphasis" w:' .
-            'semiHidden="0" w:uiPriority="19" w:unhideWhenUsed="0" w:qFormat' .
-            '="1"/><w:lsdException w:name="Intense Emphasis" w:semiHidden="' .
-            '0" w:uiPriority="21" w:unhideWhenUsed="0" w:qFormat="1"/><w:l' .
-            'sdException w:name="Subtle Reference" w:semiHidden="0" w:uiPr' .
-            'iority="31" w:unhideWhenUsed="0" w:qFormat="1"/><w:lsdExcept' .
-            'ion w:name="Intense Reference" w:semiHidden="0" w:uiPrior' .
-            'ity="32" w:unhideWhenUsed="0" w:qFormat="1"/><w:lsdException' .
-            ' w:name="Book Title" w:semiHidden="0" w:uiPriority="33" w:un' .
-            'hideWhenUsed="0" w:qFormat="1"/><w:lsdException w:name="Bib' .
-            'liography" w:uiPriority="37"/><w:lsdException w:name="TOC Hea' .
-            'ding" w:uiPriority="39" w:qFormat="1"/></w:latentStyles>';
-
-        $parameters = array('type' => 'paragraph',
-            'default' => '1', 'styleId' => 'Normal',
-            'name' => 'Normal',
-            'qFormat' => 1, 'rsid' => '000415ED');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Ttulo1',
-            'name' => 'heading 1',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'link' => 'Ttulo1Car',
-            'uiPriority' => '9', 'qFormat' => 1,
-            'rsid' => '00CF3BFC',
-            'keepNext' => 1, 'keepLines' => 1, 'spacing_before' => '480',
-            'spacing_after' => '0', 'outlineLvl' => '0',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1, 'color_val' => '365F91',
-            'color_themeColor' => 'accent1',
-            'color_themeShade' => 'BF',
-            'sz' => 28, 'szCs' => 28);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Ttulo2',
-            'name' => 'heading 2',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'link' => 'Ttulo2Car',
-            'uiPriority' => '9', 'unhideWhenUsed' => 1, 'qFormat' => 1,
-            'rsid' => '005235DC',
-            'keepNext' => 1, 'keepLines' => 1, 'spacing_before' => '200',
-            'spacing_after' => '0', 'outlineLvl' => '1',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1, 'color_val' => '200290',
-            'sz' => 32, 'szCs' => 26);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Ttulo3',
-            'name' => 'heading 3',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'link' => 'Ttulo3Car',
-            'uiPriority' => '9', 'unhideWhenUsed' => 1, 'qFormat' => 1,
-            'rsid' => '005235DC',
-            'keepNext' => 1, 'keepLines' => 1, 'spacing_before' => '200',
-            'spacing_after' => '0', 'outlineLvl' => '2',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1, 'color_val' => '000000',
-            'color_themeColor' => 'text1',
-            'sz' => 28);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Ttulo4',
-            'name' => 'heading 4',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'link' => 'Ttulo4Car',
-            'uiPriority' => '9', 'unhideWhenUsed' => 1, 'qFormat' => 1,
-            'rsid' => '007D6ADC',
-            'keepNext' => 1, 'keepLines' => 1, 'spacing_before' => '200',
-            'spacing_after' => '0', 'outlineLvl' => '3',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1, 'i' => 1, 'iCs' => 1, 'color_val' => '4F81BD',
-            'color_themeColor' => 'accent1');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'default' => '1', 'styleId' => 'Fuentedeprrafopredeter',
-            'name' => 'Default Paragraph Font',
-            'uiPriority' => '1', 'unhideWhenUsed' => 1,
-            'semiHidden' => 1);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'table',
-            'default' => '1', 'styleId' => 'Tablanormal',
-            'name' => 'Normal Table',
-            'uiPriority' => '99',
-            'semiHidden' => 1, 'unhideWhenUsed' => 1, 'qFormat' => 1,
-            'tblInd_w' => '0', 'tblInd_type' => 'dxa',
-            'top_w' => '0', 'top_type' => 'dxa',
-            'left_w' => '108',
-            'left_type' => 'dxa',
-            'bottom_w' => '0', 'bottom_type' => 'dxa',
-            'right_w' => '108',
-            'right_type' => 'dxa');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'numbering',
-            'default' => '1', 'styleId' => 'Sinlista',
-            'name' => 'No List',
-            'uiPriority' => '99',
-            'semiHidden' => 1, 'unhideWhenUsed' => 1);
-        $this->addStyle(array($parameters));
-        // falla x el acento!!!
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'Ttulo1Car',
-            'name' => 'Titulo 1 Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Ttulo1',
-            'uiPriority' => '9',
-            'rsid' => '005235DC',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1,
-            'color_val' => '365F91',
-            'color_themeColor' => 'accent1',
-            'color_themeShade' => 'BF',
-            'sz' => '28',
-            'szCs' => '28');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'Ttulo2Car',
-            'name' => 'Titulo 2 Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Ttulo2',
-            'uiPriority' => '9',
-            'rsid' => '00CF3BFC',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1,
-            'color_val' => '200290',
-            'sz' => 32, 'szCs' => 26);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'Ttulo3Car',
-            'name' => 'Titulo 3 Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Ttulo3',
-            'uiPriority' => '9',
-            'rsid' => '005235DC',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1,
-            'color_val' => '000000',
-            'color_themeColor' => 'text1',
-            'sz' => 28);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Ttulo',
-            'name' => 'Title',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'link' => 'TtuloCar',
-            'uiPriority' => '10',
-            'qFormat' => 1,
-            'rsid' => '00CF3BFC',
-            'pBdr_bottom_val' => 'single',
-            'pBdr_bottom_sz' => 8, 'pBdr_bottom_space' => 4,
-            'pBdr_bottom_color' => '4F81BD',
-            'pBdr_bottom_themeColor' => 'accent1',
-            'spacing_after' => '300',
-            'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'contextualSpacing' => 1, 'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'color_val' => '17365D',
-            'color_themeColor' => 'text2',
-            'color_themeShade' => 'BF',
-            'rPr_spacing' => '5', 'kern' => '28',
-            'sz' => 52, 'szCs' => 52);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'TtuloCar',
-            'name' => 'Titulo Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Ttulo',
-            'uiPriority' => '10',
-            'rsid' => '00CF3BFC',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'color_val' => '17365D',
-            'color_themeColor' => 'text2',
-            'color_themeShade' => 'BF',
-            'rPr_spacing' => '5', 'kern' => '28',
-            'sz' => 52, 'szCs' => 52);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Subttulo',
-            'name' => 'Subtitle',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'link' => 'SubttuloCar',
-            'uiPriority' => '11',
-            'qFormat' => 1,
-            'rsid' => '00CF3BFC',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'ilvl' => '1', 'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'i' => 1, 'iCs' => 1, 'color_val' => '4F81BD',
-            'color_themeColor' => 'accent1',
-            'rPr_spacing' => '15',
-            'sz' => 24, 'szCs' => 24);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Sinespaciado',
-            'name' => 'No Spacing',
-            'uiPriority' => '1', 'qFormat' => 1, 'rsid' => '007D6ADC',
-            'spacing_after' => '0',
-            'spacing_line' => '240',
-            'spacing_lineRule' => 'auto');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'Ttulo4Car',
-            'name' => 'Titulo 4 Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Ttulo4',
-            'uiPriority' => '9',
-            'rsid' => '007D6ADC',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1,
-            'i' => 1, 'iCs' => 1, 'color_val' => '4F81BD',
-            'color_themeColor' => 'accent1');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'styleId' => 'Hipervnculo',
-            'name' => 'Hyperlink',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'uiPriority' => '99',
-            'unhideWhenUsed' => 1,
-            'rsid' => '00EF1859',
-            'color_val' => '0000FF',
-            'color_themeColor' => 'hyperlink',
-            'u' => 'single');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Prrafodelista',
-            'name' => 'List Paragraph',
-            'basedOn' => 'Normal',
-            'uiPriority' => '34',
-            'qFormat' => 1, 'rsid' => '007D6ADC',
-            'ind_left' => 720, 'contextualSpacing' => 1);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'table',
-            'styleId' => 'Tablaconcuadrcula',
-            'name' => 'Table Grid',
-            'basedOn' => 'Tablanormal',
-            'uiPriority' => '59',
-            'rsid' => '007D6ADC',
-            'spacing_after' => '0',
-            'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'tblInd_w' => '0', 'tblInd_type' => 'dxa',
-            'top_w' => '0', 'top_type' => 'dxa',
-            'left_w' => '108',
-            'left_type' => 'dxa',
-            'bottom_w' => '0', 'bottom_type' => 'dxa',
-            'right_w' => '108',
-            'tblborder_top_val' => 'single',
-            'tblborder_top_sz' => 4,
-            'tblborder_top_space' => '0',
-            'tblborder_top_color' => '000000',
-            'tblborder_top_themeColor' => 'text1',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 4, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => '000000',
-            'tblborder_left_themeColor' => 'text1',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 4, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => '000000',
-            'tblborder_bottom_themeColor' => 'text1',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 4, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => '000000',
-            'tblborder_right_themeColor' => 'text1',
-            'tblborder_insideH_val' => 'single',
-            'tblborder_insideH_sz' => 4, 'tblborder_insideH_space' => '0',
-            'tblborder_insideH_color' => '000000',
-            'tblborder_insideH_themeColor' => 'text1',
-            'tblborder_insideV_val' => 'single',
-            'tblborder_insideV_sz' => 4, 'tblborder_insideV_space' => '0',
-            'tblborder_insideV_color' => '000000',
-            'tblborder_insideV_themeColor' => 'text1');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Textodeglobo',
-            'name' => 'Balloon Text',
-            'basedOn' => 'Normal',
-            'link' => 'TextodegloboCar',
-            'uiPriority' => '99',
-            'semiHidden' => 1,
-            'unhideWhenUsed' => 1, 'rsid' => '007D6ADC',
-            'spacing_after' => '0', 'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'sz' => 16, 'szCs' => 16, 'rFonts_ascii' => 'Tahoma',
-            'rFonts_hAnsi' => 'Tahoma',
-            'rFonts_cs' => 'Tahoma');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'TextodegloboCar',
-            'name' => 'Texto de globo Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Textodeglobo',
-            'uiPriority' => '99',
-            'semiHidden' => 1, 'rsid' => '007D6ADC',
-            'sz' => 16, 'szCs' => 16, 'rFonts_ascii' => 'Tahoma',
-            'rFonts_hAnsi' => 'Tahoma',
-            'rFonts_cs' => 'Tahoma');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Encabezado',
-            'name' => 'header',
-            'basedOn' => 'Normal',
-            'link' => 'EncabezadoCar',
-            'uiPriority' => '99',
-            'unhideWhenUsed' => 1,
-            'rsid' => '007D6ADC',
-            'spacing_after' => '0', 'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'tab_center' => 4252, 'tab_right' => 8504);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'EncabezadoCar',
-            'name' => 'Encabezado Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Encabezado',
-            'uiPriority' => '99',
-            'rsid' => '007D6ADC');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Piedepgina',
-            'name' => 'footer',
-            'basedOn' => 'Normal',
-            'link' => 'PiedepginaCar',
-            'uiPriority' => '99',
-            'unhideWhenUsed' => 1,
-            'rsid' => '007D6ADC',
-            'spacing_after' => '0', 'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'tab_center' => 4252, 'tab_right' => 8504);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'PiedepginaCar',
-            'name' => 'Pie de pagina Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Piedepgina',
-            'uiPriority' => '99',
-            'rsid' => '007D6ADC');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'TDC1',
-            'name' => 'toc 1',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'autoRedefine' => 1, 'uiPriority' => '39',
-            'unhideWhenUsed' => 1,
-            'rsid' => '00EF1859',
-            'spacing_after' => '100');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'numbering',
-            'customStyle' => '1', 'styleId' => 'Sinlista',
-            'name' => 'No List',
-            'uiPriority' => '99',
-            'semiHidden' => 1, 'unhideWhenUsed' => 1);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'TDC2',
-            'name' => 'toc 2',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'autoRedefine' => 1, 'uiPriority' => '39',
-            'semiHidden' => 1,
-            'unhideWhenUsed' => 1, 'rsid' => '005F706C',
-            'spacing_after' => '100',
-            'ind_left' => 220, 'b' => 1, 'sz' => 24);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'TDC3',
-            'name' => 'toc 3',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'autoRedefine' => 1, 'uiPriority' => '39',
-            'unhideWhenUsed' => 1, 'rsid' => '00EF1859',
-            'spacing_after' => '100',
-            'ind_left' => 440);
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'table',
-            'styleId' => 'Cuadrculamedia3-nfasis1',
-            'name' => 'Medium Grid 3 Accent 1',
-            'basedOn' => 'Tablanormal',
-            'uiPriority' => '69',
-            'rsid' => '00387AE9',
-            'spacing_after' => '0', 'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'tblInd_w' => '0', 'tblInd_type' => 'dxa',
-            'top_w' => '0', 'top_type' => 'dxa',
-            'left_w' => '108',
-            'left_type' => 'dxa',
-            'bottom_w' => '0', 'bottom_type' => 'dxa',
-            'right_w' => '108',
-            'right_type' => 'dxa',
-            'tbl_style_row' => 1, 'tbl_style_col' => 1,
-            'tblborder_top_val' => 'single',
-            'tblborder_top_sz' => 8, 'tblborder_top_space' => '0',
-            'tblborder_top_color' => 'FFFFFF',
-            'tblborder_top_themeColor' => 'background1',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => 'FFFFFF',
-            'tblborder_left_themeColor' => 'background1',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 8, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => 'FFFFFF',
-            'tblborder_bottom_themeColor' => 'background1',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 8, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => 'FFFFFF',
-            'tblborder_right_themeColor' => 'background1',
-            'tblborder_insideH_val' => 'single',
-            'tblborder_insideH_sz' => 6, 'tblborder_insideH_space' => '0',
-            'tblborder_insideH_color' => 'FFFFFF',
-            'tblborder_insideH_themeColor' => 'background1',
-            'tblborder_insideV_val' => 'single',
-            'tblborder_insideV_sz' => 6, 'tblborder_insideV_space' => '0',
-            'tblborder_insideV_color' => 'FFFFFF',
-            'tblborder_insideV_themeColor' => 'background1',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => 'D3DFEE',
-            'shd_themeFill' => 'accent1',
-            'shd_themeFillTint' => '3F');
-
-        $styleTableA = array('type' => 'firstRow',
-            'b' => 1, 'b' => 1, 'bCs' => 1, 'i' => '0', 'iCs' => '0',
-            'color_val' => 'FFFFFF',
-            'color_themeColor' => 'background1',
-            'tblPr' => 1,
-            'tblborder_top_val' => 'single',
-            'tblborder_top_sz' => 8, 'tblborder_top_space' => '0',
-            'tblborder_top_color' => 'FFFFFF',
-            'tblborder_top_themeColor' => 'background1',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => 'FFFFFF',
-            'tblborder_left_themeColor' => 'background1',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 24, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => 'FFFFFF',
-            'tblborder_bottom_themeColor' => 'background1',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 8, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => 'FFFFFF',
-            'tblborder_right_themeColor' => 'background1',
-            'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'single',
-            'tblborder_insideV_sz' => 8, 'tblborder_insideV_space' => '0',
-            'tblborder_insideV_color' => 'FFFFFF',
-            'tblborder_insideV_themeColor' => 'background1',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => '4F81BD',
-            'shd_themeFill' => 'accent1');
-
-        $styleTableB = array('type' => 'lastRow',
-            'b' => 1, 'bCs' => 1, 'i' => '0', 'iCs' => '0',
-            'color_val' => 'FFFFFF',
-            'color_themeColor' => 'background1',
-            'tblPr' => 1,
-            'tblborder_top_val' => 'single',
-            'tblborder_top_sz' => 24, 'tblborder_top_space' => '0',
-            'tblborder_top_color' => 'FFFFFF',
-            'tblborder_top_themeColor' => 'background1',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => 'FFFFFF',
-            'tblborder_left_themeColor' => 'background1',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 8, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => 'FFFFFF',
-            'tblborder_bottom_themeColor' => 'background1',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 8, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => 'FFFFFF',
-            'tblborder_right_themeColor' => 'background1',
-            'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'single',
-            'tblborder_insideV_sz' => 8, 'tblborder_insideV_space' => '0',
-            'tblborder_insideV_color' => 'FFFFFF',
-            'tblborder_insideV_themeColor' => 'background1',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => '4F81BD',
-            'shd_themeFill' => 'accent1');
-
-        $styleTableC = array('type' => 'firstCol',
-            'b' => 1, 'bCs' => 1, 'i' => '0', 'iCs' => '0',
-            'color_val' => 'FFFFFF',
-            'color_themeColor' => 'background1',
-            'tblPr' => 1,
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => 'FFFFFF',
-            'tblborder_left_themeColor' => 'background1',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 24, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => 'FFFFFF',
-            'tblborder_right_themeColor' => 'background1',
-            'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'nil',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => '4F81BD',
-            'shd_themeFill' => 'accent1');
-
-        $styleTableD = array('type' => 'lastCol',
-            'b' => 1, 'bCs' => 1, 'i' => '0', 'iCs' => '0',
-            'color_val' => 'FFFFFF',
-            'color_themeColor' => 'background1',
-            'tblPr' => 1,
-            'tblborder_top_val' => 'nil',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 24, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => 'FFFFFF',
-            'tblborder_left_themeColor' => 'background1',
-            'tblborder_bottom_val' => 'nil',
-            'tblborder_right_val' => 'nil',
-            'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'nil',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => '4F81BD',
-            'shd_themeFill' => 'accent1');
-
-        $styleTableE = array('type' => 'band1Vert',
-            'tblPr' => 1,
-            'tblborder_top_val' => 'single',
-            'tblborder_top_sz' => 8, 'tblborder_top_space' => '0',
-            'tblborder_top_color' => 'FFFFFF',
-            'tblborder_top_themeColor' => 'background1',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => 'FFFFFF',
-            'tblborder_left_themeColor' => 'background1',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 8, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => 'FFFFFF',
-            'tblborder_bottom_themeColor' => 'background1',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 8, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => 'FFFFFF',
-            'tblborder_right_themeColor' => 'background1',
-            'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'nil',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => 'A7BFDE',
-            'shd_themeFill' => 'accent1',
-            'shd_themeFillTint' => '7F');
-
-        $styleTableF = array('type' => 'band1Horz',
-            'tblPr' => 1,
-            'tblborder_top_val' => 'single',
-            'tblborder_top_sz' => 8, 'tblborder_top_space' => '0',
-            'tblborder_top_color' => 'FFFFFF',
-            'tblborder_top_themeColor' => 'background1',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => 'FFFFFF',
-            'tblborder_left_themeColor' => 'background1',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 8, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => 'FFFFFF',
-            'tblborder_bottom_themeColor' => 'background1',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 8, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => 'FFFFFF',
-            'tblborder_right_themeColor' => 'background1',
-            'tblborder_insideH_val' => 'single',
-            'tblborder_insideH_sz' => 8, 'tblborder_insideH_space' => '0',
-            'tblborder_insideH_color' => 'FFFFFF',
-            'tblborder_insideH_themeColor' => 'background1',
-            'tblborder_insideV_val' => 'single',
-            'tblborder_insideV_sz' => 8, 'tblborder_insideV_space' => '0',
-            'tblborder_insideV_color' => 'FFFFFF',
-            'tblborder_insideV_themeColor' => 'background1',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => 'A7BFDE',
-            'shd_themeFill' => 'accent1',
-            'shd_themeFillTint' => '7F');
-
-        $this->addStyle(
-            array($parameters,
-                $styleTableA, $styleTableB,
-                $styleTableC, $styleTableD,
-                $styleTableE, $styleTableF)
-        );
-        $parameters = array('type' => 'character',
-            'styleId' => 'nfasis',
-            'name' => 'Emphasis',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'uiPriority' => '20',
-            'qFormat' => 1, 'rsid' => '005235DC',
-            'i' => 1, 'iCs' => 1);
-        $this->addStyle(array($parameters));
-
-        $parameters = array('type' => 'table',
-            'styleId' => 'Sombreadomedio1',
-            'name' => 'Medium Shading 1',
-            'basedOn' => 'Tablanormal',
-            'uiPriority' => '63',
-            'rsid' => '00E559CE',
-            'spacing_after' => '0', 'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'tblInd_w' => '0', 'tblInd_type' => 'dxa',
-            'top_w' => '0', 'top_type' => 'dxa',
-            'left_w' => '108',
-            'left_type' => 'dxa',
-            'bottom_w' => '0', 'bottom_type' => 'dxa',
-            'right_w' => '108',
-            'right_type' => 'dxa',
-            'tbl_style_row' => 1, 'tbl_style_col' => 1,
-            'tblborder_top_val' => 'single',
-            'tblborder_top_sz' => 8, 'tblborder_top_space' => '0',
-            'tblborder_top_color' => '404040',
-            'tblborder_top_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => '404040',
-            'tblborder_left_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 8, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => '404040',
-            'tblborder_bottom_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 8, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => '404040',
-            'tblborder_right_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_insideH_val' => 'single',
-            'tblborder_insideH_sz' => 8, 'tblborder_insideH_space' => '0',
-            'tblborder_insideH_color' => '404040',
-            'tblborder_insideH_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF');
-
-        $styleTableA = array('type' => 'firstRow',
-            'spacing_before' => '0', 'spacing_after' => '0',
-            'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'b' => 1, 'b' => 1, 'bCs' => 1, 'color_val' => 'FFFFFF',
-            'color_themeColor' => 'background1',
-            'tblPr' => 1,
-            'tblborder_top_val' => 'single',
-            'tblborder_top_sz' => 8, 'tblborder_top_space' => '0',
-            'tblborder_top_color' => '404040',
-            'tblborder_top_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => '404040',
-            'tblborder_left_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 8, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => '404040',
-            'tblborder_bottom_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 8, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => '404040',
-            'tblborder_right_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'nil',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => '000000',
-            'shd_themeFill' => 'text1');
-
-        $styleTableB = array('type' => 'firstRow',
-            'spacing_before' => '0', 'spacing_after' => '0',
-            'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'b' => 1, 'b' => 1, 'bCs' => 1, 'tblPr' => 1,
-            'tblborder_top_val' => 'double',
-            'tblborder_top_sz' => 6, 'tblborder_top_space' => '0',
-            'tblborder_top_color' => '404040',
-            'tblborder_top_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_left_val' => 'single',
-            'tblborder_left_sz' => 8, 'tblborder_left_space' => '0',
-            'tblborder_left_color' => '404040',
-            'tblborder_left_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_bottom_val' => 'single',
-            'tblborder_bottom_sz' => 8, 'tblborder_bottom_space' => '0',
-            'tblborder_bottom_color' => '404040',
-            'tblborder_bottom_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_right_val' => 'single',
-            'tblborder_right_sz' => 8, 'tblborder_right_space' => '0',
-            'tblborder_right_color' => '404040',
-            'tblborder_right_themeColor' => 'text1',
-            'tblborder_insideV_themeTint' => 'BF',
-            'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'nil');
-
-        $styleTableC = array('type' => 'firstCol',
-            'b' => 1, 'bCs' => 1);
-        $styleTableD = array('type' => 'lastCol',
-            'b' => 1, 'bCs' => 1);
-        $styleTableE = array('type' => 'band1Vert',
-            'tblPr' => 1, 'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => 'C0C0C0',
-            'shd_themeFill' => 'text1',
-            'shd_themeFillTint' => '3F');
-        $styleTableF = array('type' => 'band1Horz',
-            'tblPr' => 1, 'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'nil',
-            'shd_val' => 'clear',
-            'shd_color' => 'auto',
-            'shd_fill' => 'C0C0C0',
-            'shd_themeFill' => 'text1',
-            'shd_themeFillTint' => '3F');
-        $styleTableG = array('type' => 'band1Horz',
-            'tblPr' => 1, 'tblborder_insideH_val' => 'nil',
-            'tblborder_insideV_val' => 'nil');
-
-        $this->addStyle(
-            array($parameters,
-                $styleTableA, $styleTableB,
-                $styleTableC, $styleTableD,
-                $styleTableE, $styleTableF,
-                $styleTableG)
-        );
-
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Ttulo4',
-            'name' => 'heading 4',
-            'basedOn' => 'Normal',
-            'next' => 'Normal',
-            'link' => 'Ttulo4Car',
-            'uiPriority' => '9',
-            'unhideWhenUsed' => 1, 'qFormat' => 1, 'rsid' => '00C967D7',
-            'keepNext' => 1, 'keepLines' => 1, 'spacing_after' => '0',
-            'spacing_before' => '200',
-            'outlineLvl' => 3, 'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1, 'i' => 1, 'iCs' => 1,
-            'color_val' => '244061',
-            'color_themeColor' => 'accent1',
-            'color_themeShade' => '80');
-        $this->addStyle(array($parameters));
-
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'Ttulo4Car',
-            'name' => 'Titulo 4 Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Ttulo4',
-            'uiPriority' => '9', 'rsid' => '00C967D7',
-            'rFonts_asciiTheme' => 'majorHAnsi',
-            'rFonts_eastAsiaTheme' => 'majorEastAsia',
-            'rFonts_hAnsiTheme' => 'majorHAnsi',
-            'rFonts_cstheme' => 'majorBidi',
-            'b' => 1, 'bCs' => 1, 'i' => 1, 'iCs' => 1,
-            'color_val' => '244061',
-            'color_themeColor' => 'accent1',
-            'color_themeShade' => '80',
-            'sz' => '24');
-        $this->addStyle(array($parameters));
-        $parameters = array('type' => 'paragraph',
-            'styleId' => 'Textonotaalfinal',
-            'name' => 'endnote text',
-            'basedOn' => 'Normal',
-            'link' => 'TextonotaalfinalCar',
-            'semiHidden' => 1,
-            'uiPriority' => '99',
-            'unhideWhenUsed' => 1, 'rsid' => '00684540',
-            'spacing_after' => '0', 'spacing_line' => '240',
-            'spacing_lineRule' => 'auto',
-            'sz' => '20',
-            'szCs' => '20');
-        $this->addStyle(array($parameters));
-
-        $parameters = array('type' => 'character',
-            'customStyle' => '1', 'styleId' => 'TextonotaalfinalCar',
-            'name' => 'Texto nota al final Car',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'link' => 'Textonotaalfinal',
-            'semiHidden' => 1, 'uiPriority' => '99',
-            'rsid' => '00684540',
-            'sz' => '20',
-            'szCs' => '20');
-        $this->addStyle(array($parameters));
-
-        $parameters = array('type' => 'character',
-            'styleId' => 'Refdenotaalfinal',
-            'name' => 'endnote reference',
-            'basedOn' => 'Fuentedeprrafopredeter',
-            'semiHidden' => 1,
-            'uiPriority' => '99',
-            'unhideWhenUsed' => 1, 'rsid' => '00684540',
-            'vertAlign' => 'superscript');
-        $this->addStyle(array($parameters));
-    }
-
-    /**
-     * Add table style
-     *
-     * @access public
-     * @param array $param
-     */
-    public function addStyleTabla($param)
-    {
-        $objStyle = CreateStyleTable::getInstance();
-        $objStyle->addStyleTable($param);
-        $this->_xml = str_replace(
-            '__GENERATESTYLE__',
-            (string) $objStyle,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:style
-     *
-     * @param string $type
-     * @param string $styleId
-     * @param string $default
-     * @param string $customStyle
-     */
-    protected function generateSTYLE($type, $styleId, $default = '',
-                                     $customStyle = '')
-    {
-        $this->_xml .= '<' . CreateElement::NAMESPACEWORD .
-            ':style ' . CreateElement::NAMESPACEWORD .
-            ':type="' . $type . '"';
-        if ($default != '')
-            $this->_xml .= ' ' . CreateElement::NAMESPACEWORD .
-                ':default="' . $default . '"';
-        $this->_xml .= ' ' . CreateElement::NAMESPACEWORD .
-            ':styleId="' . $styleId . '"';
-        if ($customStyle != '')
-            $this->_xml .= ' ' . CreateElement::NAMESPACEWORD .
-                ':customStyle="' . $customStyle . '"';
-        $this->_xml .= '>__GENERATESTYLE__</' .
-            CreateElement::NAMESPACEWORD . ':style>';
-    }
-
-    /**
-     * Generate w:name
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateNAME($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':name ' . CreateElement::NAMESPACEWORD . ':val="' . $val .
-            '"></' . CreateElement::NAMESPACEWORD . ':name>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:basedon
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateBASEDON($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':basedOn ' . CreateElement::NAMESPACEWORD . ':val="' . $val .
-            '"></' . CreateElement::NAMESPACEWORD .
-            ':basedOn>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:next
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateNEXT($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':next ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':next>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:link
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateLINK($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':link ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':link>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:uipriority
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateUIPRIORITY($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':uiPriority ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':uiPriority>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:unhidewhenused
-     *
-     * @access protected
-     */
-    protected function generateUNHIDEWHENUSED()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':unhideWhenUsed></' . CreateElement::NAMESPACEWORD .
-            ':unhideWhenUsed>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:autoredefine
-     *
-     * @access protected
-     */
-    protected function generateAUTOREDEFINE()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':autoRedefine></' . CreateElement::NAMESPACEWORD .
-            ':autoRedefine>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:qformat
-     *
-     * @access protected
-     */
-    protected function generateQFORMAT()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':qFormat></' . CreateElement::NAMESPACEWORD .
-            ':qFormat>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:rsid
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateRSID($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':rsid ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':rsid>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:semihidden
-     *
-     * @access protected
-     */
-    protected function generateSEMIHIDDEN()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':semiHidden></' . CreateElement::NAMESPACEWORD .
-            ':semiHidden>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:ppr
-     *
-     * @access protected
-     */
-    protected function generatePPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':pPr>__GENERATEPPR__</' . CreateElement::NAMESPACEWORD .
-            ':pPr>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:keepnext
-     *
-     * @access protected
-     */
-    protected function generateKEEPNEXT()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':keepNext></' . CreateElement::NAMESPACEWORD .
-            ':keepNext>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tabs
-     *
-     * @access protected
-     */
-    protected function generateTABS()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tabs>__GENERATETABS__</' . CreateElement::NAMESPACEWORD .
-            ':tabs>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tabcenter
-     *
-     * @access protected
-     * @param string $pos
-     */
-    protected function generateTABCENTER($pos)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tab ' . CreateElement::NAMESPACEWORD .
-            ':val="center" ' . CreateElement::NAMESPACEWORD .
-            ':pos="' . $pos . '"></' . CreateElement::NAMESPACEWORD .
-            ':tab>__GENERATETABS__';
-        $this->_xml = str_replace('__GENERATETABS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tabright
-     *
-     * @access protected
-     * @param string $pos
-     */
-    protected function generateTABRIGHT($pos)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tab ' . CreateElement::NAMESPACEWORD .
-            ':val="right" ' . CreateElement::NAMESPACEWORD .
-            ':pos="' . $pos . '"></' . CreateElement::NAMESPACEWORD .
-            ':tab>__GENERATETABS__';
-        $this->_xml = str_replace('__GENERATETABS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:numpr
-     *
-     * @access protected
-     */
-    protected function generateNUMPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':numPr>__GENERATENUMPR__</' . CreateElement::NAMESPACEWORD .
-            ':numPr>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:ilvl
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateILVL($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':ilvl ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':ilvl>__GENERATENUMPR__';
-        $this->_xml = str_replace('__GENERATENUMPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:keeplines
-     *
-     * @access protected
-     */
-    protected function generateKEEPLINES()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':keepLines></' . CreateElement::NAMESPACEWORD .
-            ':keepLines>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:pbdr
-     *
-     * @access protected
-     */
-    protected function generatePBDR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':pBdr>__GENERATEPBDR__</' . CreateElement::NAMESPACEWORD .
-            ':pBdr>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:pbdr
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @param string $themeColor
-     */
-    protected function generatePBDR_BOTTOM($val, $sz, $space, $color,
-                                           $themeColor)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':pBdr ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '" ' . CreateElement::NAMESPACEWORD .
-            ':sz="' . $sz . '" ' . CreateElement::NAMESPACEWORD .
-            ':space="' . $space . '" ' . CreateElement::NAMESPACEWORD .
-            ':color="' . $color . '" ' . CreateElement::NAMESPACEWORD .
-            ':themeColor="' . $themeColor .
-            '"></' . CreateElement::NAMESPACEWORD . ':pBdr>__GENERATEPBDR__';
-        $this->_xml = str_replace('__GENERATEPBDR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:spacing
-     *
-     * @param string $before
-     * @param string $after
-     * @param string $line
-     * @param string $lineRule
-     */
-    protected function generateSPACING($before, $after, $line, $lineRule)
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':spacing';
-        if ($before != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':before="' . $before . '"';
-        }
-        if ($after != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':after="' . $after . '"';
-        }
-        if ($line != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':line="' . $line . '"';
-        }
-        if ($lineRule != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':lineRule="' . $lineRule . '"';
-        }
-
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':spacing>__GENERATEPPR__';
-
-        $this->_xml = str_replace('__GENERATEPPR__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate w:spacing
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateRPR_SPACING($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':spacing ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':spacing>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:kern
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateKERN($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':kern ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':kern>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:contextualspacing
-     *
-     * @access protected
-     */
-    protected function generateCONTEXTUALSPACING()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':contextualSpacing></' . CreateElement::NAMESPACEWORD .
-            ':contextualSpacing>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:outlinelvl
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateOUTLINELVL($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':outlineLvl ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':outlineLvl>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:ind
-     *
-     * @access protected
-     * @param string $left
-     */
-    protected function generateIND($left)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':ind ' . CreateElement::NAMESPACEWORD .
-            ':left="' . $left . '"></' . CreateElement::NAMESPACEWORD .
-            ':ind>__GENERATEPPR__';
-        $this->_xml = str_replace('__GENERATEPPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tcpr
-     *
-     * @access protected
-     */
-    protected function generateTCPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tcPr>__GENERATETCPR__</' . CreateElement::NAMESPACEWORD .
-            ':tcPr>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:shd
-     *
-     * @access protected
-     * @param string $val
-     * @param string $color
-     * @param string $fill
-     * @param string $themeFill
-     * @param string $themeFillTint
-     */
-    protected function generateSHD($val, $color='', $fill='', $themeFill='',
-                                   $themeFillTint='')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD .
-            ':shd ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"';
-        if ($color != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':color="' . $color . '"';
-        }
-        if ($fill != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':fill="' . $fill . '"';
-        }
-        if ($themeFill != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeFill="' . $themeFill . '"';
-        }
-        if ($themeFillTint != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeFillTint="' . $themeFillTint . '"';
-        }
-
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':shd>__GENERATETCPR__';
-        $this->_xml = str_replace('__GENERATETCPR__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblpr
-     *
-     * @access protected
-     */
-    protected function generateTBLPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblPr>__GENERATETBLPR__</' . CreateElement::NAMESPACEWORD .
-            ':tblPr>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblind
-     *
-     * @param string $w
-     * @param string $type
-     */
-    protected function generateTBLIND($w, $type)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblInd ' . CreateElement::NAMESPACEWORD . ':w="' . $w .
-            '" ' . CreateElement::NAMESPACEWORD . ':type="' . $type .
-            '"></' . CreateElement::NAMESPACEWORD .
-            ':tblInd>__GENERATETBLPR__';
-        $this->_xml = str_replace('__GENERATETBLPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblstylerowbandsize
-     *
-     * @param string $val
-     */
-    protected function generateTBLSTYLEROWBANDSIZE($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblStyleRowBandSize ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':tblStyleRowBandSize>__GENERATETBLPR__';
-        $this->_xml = str_replace('__GENERATETBLPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblstylecolbandsize
-     *
-     * @param string $val
-     */
-    protected function generateTBLSTYLECOLBANDSIZE($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblStyleColBandSize ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':tblStyleColBandSize>__GENERATETBLPR__';
-        $this->_xml = str_replace('__GENERATETBLPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblborders
-     */
-    protected function generateTBLBORDERS()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblBorders>__GENERATETBLBORDERS__</' .
-            CreateElement::NAMESPACEWORD .
-            ':tblBorders>__GENERATETBLPR__';
-        $this->_xml = str_replace('__GENERATETBLPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:top
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @param string $themeColor
-     * @param string $themeTint
-     */
-    protected function generateTBLBORDERS_TOP($val, $sz = '', $space = '',
-                                              $color = '', $themeColor = '',
-                                              $themeTint ='')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD .
-            ':top ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"';
-        if ($sz != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':sz="' . $sz . '"';
-        }
-        if ($space != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':space="' . $space . '"';
-        }
-        if ($color != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':color="' . $color . '"';
-        }
-        if ($themeColor != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeColor="' . $themeColor . '"';
-        }
-        if ($themeTint != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeTint="' . $themeTint . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':top>__GENERATETBLBORDERS__';
-        $this->_xml = str_replace(
-            '__GENERATETBLBORDERS__',
-            $xmlAux,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:left
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @param string $themeColor
-     * @param string $themeTint
-     */
-    protected function generateTBLBORDERS_LEFT($val, $sz = '', $space = '',
-                                               $color = '', $themeColor = '',
-                                               $themeTint = '')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':left ' .
-            CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"';
-        if ($sz != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':sz="' . $sz . '"';
-        }
-        if ($space != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':space="' . $space . '"';
-        }
-        if ($color != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':color="' . $color . '"';
-        }
-        if ($themeColor != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeColor="' . $themeColor . '"';
-        }
-        if ($themeTint != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeTint="' . $themeTint . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':left>__GENERATETBLBORDERS__';
-        $this->_xml = str_replace(
-            '__GENERATETBLBORDERS__',
-            $xmlAux,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:bottom
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @param string $themeColor
-     * @param string $themeTint
-     */
-    protected function generateTBLBORDERS_BOTTOM($val, $sz = '', $space = '',
-                                                 $color = '', $themeColor = '',
-                                                 $themeTint = '')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD .
-            ':bottom ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"';
-        if ($sz != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':sz="' . $sz . '"';
-        }
-        if ($space != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':space="' . $space . '"';
-        }
-        if ($color != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':color="' . $color . '"';
-        }
-        if ($themeColor != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeColor="' . $themeColor . '"';
-        }
-        if ($themeTint != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeTint="' . $themeTint . '"';
-        }
-
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':bottom>__GENERATETBLBORDERS__';
-
-        $this->_xml = str_replace(
-            '__GENERATETBLBORDERS__',
-            $xmlAux,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:right
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @param string $themeColor
-     * @param string $themeTint
-     */
-    protected function generateTBLBORDERS_RIGHT($val, $sz='', $space='',
-                                                $color='', $themeColor='',
-                                                $themeTint='')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD .
-            ':right ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"';
-        if ($sz != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':sz="' . $sz . '"';
-        }
-        if ($space != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':space="' . $space . '"';
-        }
-        if ($color != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':color="' . $color . '"';
-        }
-        if ($themeColor != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeColor="' . $themeColor . '"';
-        }
-        if ($themeTint != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeTint="' . $themeTint . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':right>__GENERATETBLBORDERS__';
-        $this->_xml = str_replace(
-            '__GENERATETBLBORDERS__', $xmlAux, $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:insideh
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @param string $themeColor
-     * @param string $themeTint
-     */
-    protected function generateTBLBORDERS_INSIDEH($val, $sz='', $space='',
-                                                  $color='', $themeColor='',
-                                                  $themeTint='')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD .
-            ':insideH ' . CreateElement::NAMESPACEWORD . ':val="' . $val . '"';
-        if ($sz != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':sz="' . $sz . '"';
-        }
-        if ($space != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':space="' . $space . '"';
-        }
-        if ($color != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':color="' . $color . '"';
-        }
-        if ($themeColor != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeColor="' . $themeColor . '"';
-        }
-        if ($themeTint != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeTint="' . $themeTint . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':insideH>__GENERATETBLBORDERS__';
-        $this->_xml = str_replace(
-            '__GENERATETBLBORDERS__',
-            $xmlAux,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:insidev
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @param string $themeColor
-     * @param string $themeTint
-     */
-    protected function generateTBLBORDERS_INSIDEV($val, $sz='', $space='',
-                                                  $color='', $themeColor='',
-                                                  $themeTint='')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD .
-            ':insideV ' . CreateElement::NAMESPACEWORD . ':val="' . $val . '"';
-        if ($sz != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':sz="' . $sz . '"';
-        }
-        if ($space != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':space="' . $space . '"';
-        }
-        if ($color != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':color="' . $color . '"';
-        }
-        if ($themeColor != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeColor="' . $themeColor . '"';
-        }
-        if ($themeTint != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeTint="' . $themeTint . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':insideV>__GENERATETBLBORDERS__';
-
-        $this->_xml = str_replace(
-            '__GENERATETBLBORDERS__',
-            $xmlAux,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:tblcellmar
-     */
-    protected function generateTBLCELLMAR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblCellMar>__GENERATETBLCELLMAR__</' .
-            CreateElement::NAMESPACEWORD .
-            ':tblCellMar>__GENERATETBLPR__';
-        $this->_xml = str_replace('__GENERATETBLPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:top
-     *
-     * @access protected
-     * @param string $w
-     * @param string $type
-     */
-    protected function generateTOP($w, $type)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':top ' . CreateElement::NAMESPACEWORD . ':w="' . $w .
-            '" ' . CreateElement::NAMESPACEWORD . ':type="' . $type .
-            '"></' . CreateElement::NAMESPACEWORD .
-            ':top>__GENERATETBLCELLMAR__';
-        $this->_xml = str_replace('__GENERATETBLCELLMAR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:left
-     *
-     * @access protected
-     * @param string $w
-     * @param string $type
-     */
-    protected function generateLEFT($w, $type)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':left ' . CreateElement::NAMESPACEWORD .
-            ':w="' . $w . '" ' . CreateElement::NAMESPACEWORD .
-            ':type="' . $type . '"></' . CreateElement::NAMESPACEWORD .
-            ':left>__GENERATETBLCELLMAR__';
-        $this->_xml = str_replace('__GENERATETBLCELLMAR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:bottom
-     *
-     * @access protected
-     * @param string $w
-     * @param string $type
-     */
-    protected function generateBOTTOM($w, $type)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':bottom ' . CreateElement::NAMESPACEWORD .
-            ':w="' . $w . '" ' . CreateElement::NAMESPACEWORD .
-            ':type="' . $type . '"></' . CreateElement::NAMESPACEWORD .
-            ':bottom>__GENERATETBLCELLMAR__';
-        $this->_xml = str_replace('__GENERATETBLCELLMAR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:right
-     *
-     * @access protected
-     * @param string $w
-     * @param string $type
-     */
-    protected function generateRIGHT($w, $type)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':right ' . CreateElement::NAMESPACEWORD .
-            ':w="' . $w . '" ' . CreateElement::NAMESPACEWORD .
-            ':type="' . $type . '"></' . CreateElement::NAMESPACEWORD .
-            ':right>__GENERATETBLCELLMAR__';
-        $this->_xml = str_replace('__GENERATETBLCELLMAR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:rpr
-     */
-    protected function generateRPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':rPr>__GENERATERPR__</' . CreateElement::NAMESPACEWORD .
-            ':rPr>__GENERATESTYLE__';
-        $this->_xml = str_replace('__GENERATESTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:rfonts
-     *
-     * @access protected
-     * @param string $asciiTheme
-     * @param string $eastAsiaTheme
-     * @param string $hAnsiTheme
-     * @param string $cstheme
-     */
-    protected function generateRFONTS($asciiTheme, $eastAsiaTheme, $hAnsiTheme,
-                                      $cstheme)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':rFonts ' . CreateElement::NAMESPACEWORD .
-            ':asciiTheme="' . $asciiTheme . '" ' .
-            CreateElement::NAMESPACEWORD .
-            ':eastAsiaTheme="' . $eastAsiaTheme .
-            '" ' . CreateElement::NAMESPACEWORD .
-            ':hAnsiTheme="' . $hAnsiTheme .
-            '" ' . CreateElement::NAMESPACEWORD .
-            ':cstheme="' . $cstheme .
-            '"></' . CreateElement::NAMESPACEWORD .
-            ':rFonts>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:rfonts
-     *
-     * @access protected
-     * @param string $ascii
-     * @param string $hAnsi
-     * @param string $cs
-     */
-    protected function generateRFONTS2($ascii, $hAnsi, $cs)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':rFonts ' . CreateElement::NAMESPACEWORD .
-            ':ascii="' . $ascii . '" ' . CreateElement::NAMESPACEWORD .
-            ':hAnsi="' . $hAnsi . '" ' . CreateElement::NAMESPACEWORD .
-            ':cs="' . $cs . '"></' . CreateElement::NAMESPACEWORD .
-            ':rFonts>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:b
-     *
-     * @access protected
-     */
-    protected function generateB()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':b></' . CreateElement::NAMESPACEWORD .
-            ':b>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:bcs
-     *
-     * @access protected
-     */
-    protected function generateBCS()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':bCs></' . CreateElement::NAMESPACEWORD .
-            ':bCs>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:i
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateI($val='')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':i';
-        if ($val != 1 || $val != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':val="' . $val . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':i>__GENERATERPR__';
-
-        $this->_xml = str_replace('__GENERATERPR__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate w:ics
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateICS($val = '')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':iCs';
-        if ($val != 1 || $val != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':val="' . $val . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':iCs>__GENERATERPR__';
-
-        $this->_xml = str_replace('__GENERATERPR__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate w:u
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateU($val = '')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':u';
-        if ($val != '' && $val != 1) {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':val="' . $val . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD . ':u>__GENERATERPR__';
-
-        $this->_xml = str_replace('__GENERATERPR__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate w:color
-     *
-     * @access protected
-     * @param string $val
-     * @param string $themeColor
-     * @param string $themeShade
-     */
-    protected function generateCOLOR($val, $themeColor='', $themeShade = '')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD .
-            ':color ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"';
-        if ($themeColor != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeColor="' . $themeColor . '"';
-        }
-        if ($themeShade != '') {
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeShade="' . $themeShade . '"';
-        }
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':color>__GENERATERPR__';
-
-        $this->_xml = str_replace('__GENERATERPR__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate w:sz
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSZ($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':sz ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':sz>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:szcs
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSZCS($val)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':szCs ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':szCs>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:vertAlign
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateVERTALIGN($val = 'superscript')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':vertAlign ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':vertAlign>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $xml, $this->_xml);
-    }
-
-}

+ 0 - 540
main/inc/lib/phpdocx/classes/CreateStyleTable.inc

@@ -1,540 +0,0 @@
-<?php
-
-/**
- * Create style table
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create style table
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateStyleTable extends CreateStyle
-{
-
-    /**
-     * @access protected
-     * @var string
-     */
-    protected $_xml;
-    /**
-     * @access private
-     * @var CreateStyleTable
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @access public
-     * @return CreateStyleTable
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateStyleTable();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Add table style
-     *
-     * @access public
-     * @param array $args[0]
-     */
-    public function addStyleTable()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        if (!empty($args[0]['type'])) {
-            $this->generateTBLSTYLEPR($args[0]['type']);
-        }
-        if (!empty($args[0]['name'])) {
-            $this->generateNAME($args[0]['name']);
-        }
-        if (!empty($args[0]['basedOn'])) {
-            $this->generateBASEDON($args[0]['basedOn']);
-        }
-        if (!empty($args[0]['next'])) {
-            $this->generateNEXT($args[0]['next']);
-        }
-        if (!empty($args[0]['link'])) {
-            $this->generateLINK($args[0]['link']);
-        }
-        if ($args[0]['autoRedefine'] == 1) {
-            $this->generateAUTOREDEFINE();
-        }
-        if (!empty($args[0]['uiPriority'])) {
-            $this->generateUIPRIORITY($args[0]['uiPriority']);
-        }
-        if ($args[0]['semiHidden'] == 1) {
-            $this->generateSEMIHIDDEN();
-        }
-        if ($args[0]['unhideWhenUsed'] == 1) {
-            $this->generateUNHIDEWHENUSED();
-        }
-        if ($args[0]['qFormat'] == 1) {
-            $this->generateQFORMAT();
-        }
-        if (!empty($args[0]['rsid'])) {
-            $this->generateRSID($args[0]['rsid']);
-        }
-        if ($args[0]['keepNext'] == 1 ||
-            !empty($args[0]['keepLines']) ||
-            (isset($args[0]['spacing_before']) ||
-            isset($args[0]['spacing_after']) ||
-            isset($args[0]['spacing_line']) ||
-            isset($args[0]['spacing_lineRule'])) ||
-            !empty($args[0]['outlineLvl']) ||
-            $args[0]['contextualSpacing'] == 1 ||
-            isset($args[0]['ilvl']) ||
-            isset($args[0]['ind_left'])
-        ) {
-            $this->generatePPR();
-            if ($args[0]['keepNext'] == 1) {
-                $this->generateKEEPNEXT();
-            }
-            if (!empty($args[0]['keepLines'])) {
-                $this->generateKEEPLINES($args[0]['keepLines']);
-            }
-            if (isset($args[0]['pBdr_bottom_val']) &&
-                isset($args[0]['pBdr_bottom_sz']) &&
-                isset($args[0]['pBdr_bottom_space']) &&
-                isset($args[0]['pBdr_bottom_color']) &&
-                isset($args[0]['pBdr_bottom_themeColor'])
-            ) {
-                $this->generatePBDR();
-                $this->generatePBDR_BOTTOM(
-                    $args[0]['pBdr_bottom_val'],
-                    $args[0]['pBdr_bottom_sz'],
-                    $args[0]['pBdr_bottom_space'],
-                    $args[0]['pBdr_bottom_color'],
-                    $args[0]['pBdr_bottom_themeColor']
-                );
-            }
-            if (!empty($args[0]['tab_center']) || $args[0]['tab_right']) {
-                $this->generateTABS();
-                if (!empty($args[0]['tab_center'])) {
-                    $this->generateTABCENTER($args[0]['tab_center']);
-                }
-                if (!empty($args[0]['tab_right'])) {
-                    $this->generateTABRIGHT($args[0]['tab_right']);
-                }
-            }
-            if (isset($args[0]['spacing_before']) ||
-                isset($args[0]['spacing_after']) ||
-                isset($args[0]['spacing_line']) ||
-                isset($args[0]['spacing_lineRule'])
-            ) {
-                $this->generateSPACING(
-                    $args[0]['spacing_before'],
-                    $args[0]['spacing_after'],
-                    $args[0]['spacing_line'],
-                    $args[0]['spacing_lineRule']
-                );
-            }
-            if (isset($args[0]['ind_left'])) {
-                $this->generateIND($args[0]['ind_left']);
-            }
-            if ($args[0]['contextualSpacing'] == 1) {
-                $this->generateCONTEXTUALSPACING();
-            }
-            if (isset($args[0]['outlineLvl'])) {
-                $this->generateOUTLINELVL($args[0]['outlineLvl']);
-            }
-            if (isset($args[0]['ilvl'])) {
-                $this->generateNUMPR();
-                $this->generateILVL($args[0]['ilvl']);
-            }
-        }
-        if ((!empty($args[0]['rFonts_asciiTheme']) &&
-            !empty($args[0]['rFonts_eastAsiaTheme']) &&
-            !empty($args[0]['rFonts_hAnsiTheme']) &&
-            !empty($args[0]['rFonts_cstheme'])) ||
-            $args[0]['b'] == 1 ||
-            $args[0]['bCs'] == 1 ||
-            $args[0]['i'] == 1 ||
-            $args[0]['iCs'] == 1 ||
-            $args[0]['u'] == 1 ||
-            !empty($args[0]['color_val']) ||
-            !empty($args[0]['sz']) ||
-            !empty($args[0]['szCs']) ||
-            !empty($args[0]['kern']) ||
-            !empty($args[0]['rPr_spacing']) ||
-            !empty($args[0]['u'])
-        ) {
-
-            $this->generateRPR();
-            if (!empty($args[0]['rFonts_asciiTheme']) &&
-                !empty($args[0]['rFonts_eastAsiaTheme']) &&
-                !empty($args[0]['rFonts_hAnsiTheme']) &&
-                !empty($args[0]['rFonts_cstheme'])
-            ) {
-                $this->generateRFONTS(
-                    $args[0]['rFonts_asciiTheme'],
-                    $args[0]['rFonts_eastAsiaTheme'],
-                    $args[0]['rFonts_hAnsiTheme'],
-                    $args[0]['rFonts_cstheme']
-                );
-            }
-            if (!empty($args[0]['rFonts_ascii']) &&
-                !empty($args[0]['rFonts_hAnsi']) &&
-                !empty($args[0]['rFonts_cs'])
-            ) {
-                $this->generateRFONTS2(
-                    $args[0]['rFonts_ascii'],
-                    $args[0]['rFonts_hAnsi'],
-                    $args[0]['rFonts_cs']
-                );
-            }
-            if ($args[0]['b'] == 1) {
-                $this->generateB();
-            }
-            if ($args[0]['bCs'] == 1) {
-                $this->generateBCS();
-            }
-            if (isset($args[0]['i'])) {
-                $this->generateI($args[0]['i']);
-            }
-            if (isset($args[0]['iCs'])) {
-                $this->generateICS($args[0]['iCs']);
-            }
-            if ($args[0]['u'] == 1) {
-                $this->generateU();
-            }
-            if (!empty($args[0]['color_val'])) {
-                $this->generateCOLOR(
-                    $args[0]['color_val'],
-                    $args[0]['color_themeColor'],
-                    $args[0]['color_themeShade']
-                );
-            }
-            if (!empty($args[0]['u'])) {
-                $this->generateU($args[0]['u']);
-            }
-            if (!empty($args[0]['rPr_spacing'])) {
-                $this->generateRPR_SPACING($args[0]['rPr_spacing']);
-            }
-            if (!empty($args[0]['kern'])) {
-                $this->generateKERN($args[0]['kern']);
-            }
-            if (!empty($args[0]['sz'])) {
-                $this->generateSZ($args[0]['sz']);
-            }
-            if (!empty($args[0]['szCs'])) {
-                $this->generateSZCS($args[0]['szCs']);
-            }
-        }
-        if (isset($args[0]['tblPr'])) {
-            $this->generateTBLPR();
-        }
-        if ((isset($args[0]['top_w']) &&
-            isset($args[0]['top_type'])) ||
-            (isset($args[0]['left_w']) &&
-            isset($args[0]['left_type'])) ||
-            (isset($args[0]['bottom_w']) &&
-            isset($args[0]['bottom_type'])) ||
-            (isset($args[0]['right_w']) &&
-            isset($args[0]['right_type'])) ||
-            (isset($args[0]['tblInd_w']) &&
-            isset($args[0]['tblInd_type'])) &&
-            isset($args[0]['tblborder_top_val']) ||
-            isset($args[0]['tblborder_left_val']) ||
-            isset($args[0]['tblborder_bottom_val']) ||
-            isset($args[0]['tblborder_right_val']) ||
-            isset($args[0]['tblborder_insideH_val']) ||
-            isset($args[0]['tblborder_insideV_val']) ||
-            (isset($args[0]['shd_val']) &&
-            isset($args[0]['shd_color']) &&
-            isset($args[0]['shd_fill']) &&
-            isset($args[0]['shd_themeFill']))
-        ) {
-            $this->generateTCPR();
-            if (isset($args[0]['tbl_style_row'])) {
-                $this->generateTBLSTYLEROWBANDSIZE($args[0]['tbl_style_row']);
-            }
-            if (isset($args[0]['tbl_style_col'])) {
-                $this->generateTBLSTYLECOLBANDSIZE($args[0]['tbl_style_col']);
-            }
-
-            if (isset($args[0]['tblInd_w']) &&
-                isset($args[0]['tblInd_type'])
-            ) {
-
-                $this->generateTBLIND(
-                    $args[0]['tblInd_w'],
-                    $args[0]['tblInd_type']
-                );
-            }
-
-            if (isset($args[0]['tblborder_top_val']) ||
-                isset($args[0]['tblborder_left_val']) ||
-                isset($args[0]['tblborder_bottom_val']) ||
-                isset($args[0]['tblborder_right_val']) ||
-                isset($args[0]['tblborder_insideH_val']) ||
-                isset($args[0]['tblborder_insideV_val'])
-            ) {
-                $this->generateTCBORDERS();
-                if (isset($args[0]['tblborder_top_val'])) {
-                    $this->generateTBLBORDERS_TOP(
-                        $args[0]['tblborder_top_val'],
-                        $args[0]['tblborder_top_sz'],
-                        $args[0]['tblborder_top_space'],
-                        $args[0]['tblborder_top_color'],
-                        $args[0]['tblborder_top_themeColor'],
-                        $args[0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0]['tblborder_left_val'])) {
-                    $this->generateTBLBORDERS_LEFT(
-                        $args[0]['tblborder_left_val'],
-                        $args[0]['tblborder_left_sz'],
-                        $args[0]['tblborder_left_space'],
-                        $args[0]['tblborder_left_color'],
-                        $args[0]['tblborder_left_themeColor'],
-                        $args[0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0]['tblborder_bottom_val'])) {
-                    $this->generateTBLBORDERS_BOTTOM(
-                        $args[0]['tblborder_bottom_val'],
-                        $args[0]['tblborder_bottom_sz'],
-                        $args[0]['tblborder_bottom_space'],
-                        $args[0]['tblborder_bottom_color'],
-                        $args[0]['tblborder_bottom_themeColor'],
-                        $args[0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0]['tblborder_right_val'])) {
-                    $this->generateTBLBORDERS_RIGHT(
-                        $args[0]['tblborder_right_val'],
-                        $args[0]['tblborder_right_sz'],
-                        $args[0]['tblborder_right_space'],
-                        $args[0]['tblborder_right_color'],
-                        $args[0]['tblborder_right_themeColor'],
-                        $args[0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0]['tblborder_insideH_val'])) {
-                    $this->generateTBLBORDERS_INSIDEH(
-                        $args[0]['tblborder_insideH_val'],
-                        $args[0]['tblborder_insideH_sz'],
-                        $args[0]['tblborder_insideH_space'],
-                        $args[0]['tblborder_insideH_color'],
-                        $args[0]['tblborder_insideH_themeColor'],
-                        $args[0]['tblborder_insideV_themeTint']
-                    );
-                }
-                if (isset($args[0]['tblborder_insideV_val'])) {
-                    $this->generateTBLBORDERS_INSIDEV(
-                        $args[0]['tblborder_insideV_val'],
-                        $args[0]['tblborder_insideV_sz'],
-                        $args[0]['tblborder_insideV_space'],
-                        $args[0]['tblborder_insideV_color'],
-                        $args[0]['tblborder_insideV_themeColor'],
-                        $args[0]['tblborder_insideV_themeTint']
-                    );
-                }
-            }
-            if (isset($args[0]['shd_val']) &&
-                isset($args[0]['shd_color']) &&
-                isset($args[0]['shd_fill']) &&
-                isset($args[0]['shd_themeFill'])
-            ) {
-                $this->generateSHD(
-                    $args[0]['shd_val'],
-                    $args[0]['shd_color'],
-                    $args[0]['shd_fill'],
-                    $args[0]['shd_themeFill'],
-                    $args[0]['shd_themeFillTint']
-                );
-            }
-            if ((isset($args[0]['top_w']) &&
-                isset($args[0]['top_type'])) ||
-                (isset($args[0]['left_w']) &&
-                isset($args[0]['left_type'])) ||
-                (isset($args[0]['bottom_w']) &&
-                isset($args[0]['bottom_type'])) ||
-                (isset($args[0]['right_w']) &&
-                isset($args[0]['right_type']))
-            ) {
-                $this->generateTBLCELLMAR();
-
-                if (isset($args[0]['top_w']) &&
-                    isset($args[0]['top_type'])) {
-                    $this->generateTOP(
-                        $args[0]['top_w'],
-                        $args[0]['top_type']
-                    );
-                }
-                if (isset($args[0]['left_w']) &&
-                    isset($args[0]['left_type'])) {
-                    $this->generateLEFT(
-                        $args[0]['left_w'],
-                        $args[0]['left_type']
-                    );
-                }
-                if (isset($args[0]['bottom_w']) &&
-                    isset($args[0]['bottom_type'])) {
-                    $this->generateBOTTOM(
-                        $args[0]['bottom_w'],
-                        $args[0]['bottom_type']
-                    );
-                }
-                if (isset($args[0]['right_w']) &&
-                    isset($args[0]['right_type'])) {
-                    $this->generateRIGHT(
-                        $args[0]['right_w'],
-                        $args[0]['right_type']
-                    );
-                }
-            }
-        }
-        $this->cleanTemplate();
-        $this->_xml .= '__GENERATESTYLE__';
-    }
-
-    /**
-     * Generate w:tblStylePr
-     *
-     * @access protected
-     * @param string $type
-     */
-    protected function generateTBLSTYLEPR($type)
-    {
-        $this->_xml .= '<' . CreateElement::NAMESPACEWORD .
-            ':tblStylePr ' . CreateElement::NAMESPACEWORD .
-            ':type="' . $type . '">__GENERATESTYLE__</' .
-            CreateElement::NAMESPACEWORD . ':tblStylePr>';
-    }
-
-    /**
-     * Generate w:tblPr
-     *
-     * @access protected
-     */
-    protected function generateTBLPR()
-    {
-        $this->_xml = str_replace(
-            '__GENERATESTYLE__', '<' .
-            CreateElement::NAMESPACEWORD .
-            ':tblPr></' . CreateElement::NAMESPACEWORD .
-            ':tblPr>__GENERATESTYLE__',
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:tcPr
-     *
-     * @access protected
-     */
-    protected function generateTCPR()
-    {
-        $this->_xml = str_replace(
-            '__GENERATESTYLE__', '<' .
-            CreateElement::NAMESPACEWORD .
-            ':tcPr>__GENERATETBLPR__</' . CreateElement::NAMESPACEWORD .
-            ':tcPr>__GENERATESTYLE__',
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:tcBorders
-     *
-     * @access protected
-     */
-    protected function generateTCBORDERS()
-    {
-        $this->_xml = str_replace(
-            '__GENERATETBLPR__', '<' .
-            CreateElement::NAMESPACEWORD .
-            ':tcBorders>__GENERATETBLBORDERS__</' .
-            CreateElement::NAMESPACEWORD . ':tcBorders>__GENERATETBLPR__',
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:shd
-     *
-     * @access protected
-     * @param string $val
-     * @param string $color
-     * @param string $fill
-     * @param string $themeFill
-     * @param string $themeFillTint
-     */
-    protected function generateSHD($val, $color = '', $fill = '',
-                                   $themeFill = '', $themeFillTint = '')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':shd ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"';
-        if ($color != '')
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':color="' . $color . '"';
-        if ($fill != '')
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':fill="' . $fill . '"';
-        if ($themeFill != '')
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeFill="' . $themeFill . '"';
-        if ($themeFillTint != '')
-            $xmlAux .= ' ' . CreateElement::NAMESPACEWORD .
-                ':themeFillTint="' . $themeFillTint . '"';
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD .
-            ':shd>__GENERATETBLPR__';
-        $this->_xml = str_replace('__GENERATETBLPR__', $xmlAux, $this->_xml);
-    }
-
-}

+ 0 - 577
main/inc/lib/phpdocx/classes/CreateTable.inc

@@ -1,577 +0,0 @@
-<?php
-
-/**
- * Create tables
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create tables
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateTable extends CreateElement
-{
-
-    /**
-     * @access private
-     * @var CreateTable
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-        
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-        $this->cleanTemplate();
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @access public
-     * @return CreateTable
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateTable();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create table
-     *
-     * @access public
-     * @param array args[0]
-     */
-    public function createTable()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-
-        if (is_array($args[0])) {
-            $this->generateTBL();
-            $this->generateTBLPR();
-            $this->generateTBLSTYLE();
-            $this->generateTBLW();
-            if (!empty($args[1]['border'])) {
-                $this->generateTBLBORDERS();
-                $this->generateTBLBOTTOM();
-                $this->generateTBLLEFT();
-                $this->generateTBLTOP();
-                $this->generateTBLRIGHT();
-                $this->generateTBLINSIDEH();
-                $this->generateTBLINSIDEV();
-            }
-
-            $this->generateTBLLOOK();
-            $this->generateTBLOVERLAP();
-            $intLine = 0;
-            foreach ($args[0] as $datDepth) {
-                $this->generateTR();
-                $intLine++;
-                foreach ($datDepth as $cont) {
-                    $this->generateTC();
-                    $this->generateP();
-                    $this->generateR();
-                    if ($args[1]['font'] != '') {
-                        $this->generateRPR();
-                        $this->generateRFONTS($args[1]['font']);
-                    }
-                    $this->generateT($cont);
-                }
-                $this->cleanTemplateR();
-            }
-        }
-    }
-
-    /**
-     * Add list
-     *
-     * @param string $list
-     * @access protected
-     */
-    protected function addList($list)
-    {
-        $this->_xml = str_replace('__GENERATEP__', $list, $this->_xml);
-    }
-
-    /**
-     * Generate w:gridcols
-     *
-     * @param string $w
-     * @access protected
-     */
-    protected function generateGRIDCOLS($w)
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':tblGrid ' .
-            CreateElement::NAMESPACEWORD . ':w="' . $w . '"></' .
-            CreateElement::NAMESPACEWORD . ':tblGrid>__GENERATEGRIDCOLS__';
-        $this->_xml = str_replace('__GENERATEGRIDCOLS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:hmerge
-     *
-     * @access protected
-     * @deprecated
-     * @param string $val
-     */
-    protected function generateHMERGE($val = '')
-    {
-
-    }
-
-    /**
-     * Generate w:jc
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateJC($val = '')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':jc ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':jc>';
-        $this->_xml = str_replace('__GENERATEJC__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:p
-     *
-     * @access protected
-     */
-    protected function generateP()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':p >__GENERATEP__</' .
-            CreateElement::NAMESPACEWORD . ':p>';
-        $this->_xml = str_replace('__GENERATETC__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:shd
-     *
-     * @param string $val
-     * @param string $color
-     * @param string $fill
-     * @param string $bgcolor
-     * @param string $themeFill
-     * @access protected
-     */
-    protected function generateSHD($val = 'horz-cross', $color = 'ff0000',
-                                   $fill = '', $bgcolor = '', $themeFill = '')
-    {
-        $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':shd w:val="' .
-            $val . '"';
-        if ($color != '') $xmlAux .= ' w:color="' . $color . '"';
-        if ($fill != '') $xmlAux .= ' w:fill="' . $fill . '"';
-        if ($bgcolor != '') $xmlAux .= ' wx:bgcolor="' . $bgcolor . '"';
-        if ($themeFill != '') $xmlAux .= ' w:themeFill="' . $themeFill . '"';
-        $xmlAux .= '></' . CreateElement::NAMESPACEWORD . ':shd>';
-        $this->_xml = str_replace('__GENERATETCPR__', $xmlAux, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblborders
-     *
-     * @access protected
-     */
-    protected function generateTBLBORDERS()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblBorders>__GENERATETBLBORDER__</' .
-            CreateElement::NAMESPACEWORD . ':tblBorders>';
-        $this->_xml = str_replace('__GENERATETBLBORDERS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblbottom
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @access protected
-     */
-    protected function generateTBLBOTTOM($val="single", $sz="4", $space='0',
-                                         $color='auto')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':bottom ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '" ' . CreateElement::NAMESPACEWORD .
-            ':sz="' . $sz . '" ' . CreateElement::NAMESPACEWORD .
-            ':space="' . $space . '" ' . CreateElement::NAMESPACEWORD .
-            ':color="' . $color . '"></' . CreateElement::NAMESPACEWORD .
-            ':bottom>__GENERATETBLBORDER__';
-        $this->_xml = str_replace('__GENERATETBLBORDER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tbl
-     *
-     * @access protected
-     */
-    protected function generateTBL()
-    {
-        $this->_xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tbl>__GENERATETBL__</' . CreateElement::NAMESPACEWORD .
-            ':tbl>';
-    }
-
-    /**
-     * Generate w:tblstyle
-     *
-     * @param string $strVal
-     * @access protected
-     */
-    protected function generateTBLSTYLE($strVal = 'Tablaconcuadrcula')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblStyle ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $strVal . '"></' . CreateElement::NAMESPACEWORD .
-            ':tblStyle>';
-        $this->_xml = str_replace('__GENERATETBLSTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblcellspacing
-     *
-     * @param string $w
-     * @param string $type
-     * @access protected
-     */
-    protected function generateTBLCELLSPACING($w = '', $type = '')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblCellSpacing ' . CreateElement::NAMESPACEWORD .
-            ':w="' . $w . '" ' . CreateElement::NAMESPACEWORD .
-            ':type="' . $type . '"></' . CreateElement::NAMESPACEWORD .
-            ':tblCellSpacing>';
-        $this->_xml = str_replace(
-            '__GENERATETBLCELLSPACING__', $xml, $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:tblgrid
-     *
-     * @access protected
-     */
-    protected function generateTBLGRID()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblGrid>__GENERATEGRIDCOLS__</' .
-            CreateElement::NAMESPACEWORD .
-            ':tblGrid>__GENERATETBL__';
-        $this->_xml = str_replace('__GENERATETBL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblinsideh
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @access protected
-     */
-    protected function generateTBLINSIDEH($val = "single", $sz = "4",
-                                          $space = '0', $color = 'auto')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':insideH ' . CreateElement::NAMESPACEWORD .
-            ':val="' . $val . '" ' . CreateElement::NAMESPACEWORD .
-            ':sz="' . $sz . '" ' . CreateElement::NAMESPACEWORD .
-            ':space="' . $space . '" ' . CreateElement::NAMESPACEWORD .
-            ':color="' . $color . '"></' . CreateElement::NAMESPACEWORD .
-            ':insideH>__GENERATETBLBORDER__';
-        $this->_xml = str_replace('__GENERATETBLBORDER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblinsidev
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @access protected
-     */
-    protected function generateTBLINSIDEV($val = "single", $sz= "4", $space='0',
-                                          $color= 'auto')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':insideV ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '" ' .
-            CreateElement::NAMESPACEWORD . ':sz="' . $sz . '" ' .
-            CreateElement::NAMESPACEWORD . ':space="' . $space . '" ' .
-            CreateElement::NAMESPACEWORD . ':color="' . $color . '"></' .
-            CreateElement::NAMESPACEWORD . ':insideV>__GENERATETBLBORDER__';
-        $this->_xml = str_replace('__GENERATETBLBORDER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblleft
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @access protected
-     */
-    protected function generateTBLLEFT($val = "single", $sz = "4", $space = '0',
-                                       $color = 'auto')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':left ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '" ' .
-            CreateElement::NAMESPACEWORD . ':sz="' . $sz . '" ' .
-            CreateElement::NAMESPACEWORD . ':space="' . $space . '" ' .
-            CreateElement::NAMESPACEWORD . ':color="' . $color . '"></' .
-            CreateElement::NAMESPACEWORD . ':left>__GENERATETBLBORDER__';
-        $this->_xml = str_replace('__GENERATETBLBORDER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tbllook
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateTBLLOOK($val = '000001E0')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':tblLook ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':tblLook>';
-        $this->_xml = str_replace('__GENERATETBLLOOK__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tbloverlap
-     *
-     * @param string $val
-     * @access protected
-     */
-    protected function generateTBLOVERLAP($val = 'never')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':tblOverlap ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':tblOverlap>';
-        $this->_xml = str_replace('__GENERATETBLOVERLAP__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblpr
-     *
-     * @access protected
-     */
-    protected function generateTBLPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tblPr>__GENERATETBLSTYLE____GENERA' .
-            'TEJC____GENERATETBLW____GENERATETBLL' .
-            'OOK____GENERATETBLOVERLAP____GENERATETBLCELL' .
-            'SPACING____GENERATETBLBORDERS____GENERATESHD__</' .
-            CreateElement::NAMESPACEWORD . ':tblPr>__GENERATETBL__';
-        $this->_xml = str_replace('__GENERATETBL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblright
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @access protected
-     */
-    protected function generateTBLRIGHT($val = 'single', $sz = '4',
-                                        $space = '0', $color = 'auto')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':right ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '" ' .
-            CreateElement::NAMESPACEWORD . ':sz="' . $sz . '" ' .
-            CreateElement::NAMESPACEWORD . ':space="' . $space . '" ' .
-            CreateElement::NAMESPACEWORD . ':color="' . $color . '"></' .
-            CreateElement::NAMESPACEWORD . ':right>__GENERATETBLBORDER__';
-        $this->_xml = str_replace('__GENERATETBLBORDER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tbltop
-     *
-     * @param string $val
-     * @param string $sz
-     * @param string $space
-     * @param string $color
-     * @access protected
-     */
-    protected function generateTBLTOP($val = 'single', $sz = '4', $space = '0',
-                                      $color = 'auto')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':top ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '" ' .
-            CreateElement::NAMESPACEWORD . ':sz="' . $sz . '" ' .
-            CreateElement::NAMESPACEWORD . ':space="' . $space . '" ' .
-            CreateElement::NAMESPACEWORD . ':color="' . $color . '"></' .
-            CreateElement::NAMESPACEWORD . ':top>__GENERATETBLBORDER__';
-        $this->_xml = str_replace('__GENERATETBLBORDER__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tblw
-     *
-     * @param string $type
-     * @param string $w
-     * @access protected
-     */
-    protected function generateTBLW($type = 'auto', $w = '0')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':tblW ' .
-            CreateElement::NAMESPACEWORD . ':w="' . $w . '" ' .
-            CreateElement::NAMESPACEWORD . ':type="' . $type . '"></' .
-            CreateElement::NAMESPACEWORD . ':tblW>';
-        $this->_xml = str_replace('__GENERATETBLW__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tc
-     *
-     * @access protected
-     */
-    protected function generateTC()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':tc >__GENERATETC__</' .
-            CreateElement::NAMESPACEWORD . ':tc>__GENERATETR__';
-        $this->_xml = str_replace('__GENERATETR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tcpr
-     *
-     * @access protected
-     */
-    protected function generateTCPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tcPr>__GENERATETCPR__</' . CreateElement::NAMESPACEWORD .
-            ':tcPr>__GENERATETC__';
-        $this->_xml = str_replace('__GENERATETC__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tcw
-     *
-     * @param string $w
-     * @param string $type
-     * @access protected
-     */
-    protected function generateTCW($w = '', $type = 'dxa')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD . ':tcW ' .
-            CreateElement::NAMESPACEWORD . ':w="' . $w . '" ' .
-            CreateElement::NAMESPACEWORD . ':type="' . $type . '"></' .
-            CreateElement::NAMESPACEWORD . ':tcW>__GENERATETCPR__';
-        $this->_xml = str_replace('__GENERATETCPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:tr
-     *
-     * @access protected
-     */
-    protected function generateTR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':tr >__GENERATETRPR____GENERATETR__</' .
-            CreateElement::NAMESPACEWORD . ':tr>__GENERATETBL__';
-        $this->_xml = str_replace('__GENERATETBL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:trpr
-     *
-     * @access protected
-     */
-    protected function generateTRPR()
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-            ':trPr>__GENERATETRPR__</' . CreateElement::NAMESPACEWORD .
-            ':trPr>';
-        $this->_xml = str_replace('__GENERATETRPR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate w:vmerge
-     *
-     * @param <type> $val
-     * @deprecated
-     * @access protected
-     */
-    protected function generateVMERGE($val = '')
-    {
-
-    }
-
-    /**
-     * Clean template r token
-     *
-     * @access private
-     */
-    private function cleanTemplateR()
-    {
-        $this->_xml = preg_replace('/__GENERATETR__/', '', $this->_xml);
-    }
-    
-    /**
-     * Clean template trpr token
-     *
-     * @access private
-     */
-    private function cleanTemplateTRPR()
-    {
-        $this->_xml = preg_replace('/__GENERATETRPR__/', '', $this->_xml);
-    }
-
-}

+ 0 - 129
main/inc/lib/phpdocx/classes/CreateTableContents.inc

@@ -1,129 +0,0 @@
-<?php
-
-/**
- * Create table of contents
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create table of contents
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateTableContents extends CreateElement
-{
-    /**
-     *
-     * @var string
-     * @access protected
-     */
-    protected $_xml;
-
-    /**
-     *
-     * @var CreateTableContents
-     * @access protected
-     * @static
-     */
-    private static $_instance = NULL;
-    
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     * Magic method, returns current XML
-     *
-     * @access public
-     * @return string Return current XML
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @return CreateTableContents
-     * @access public
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateTableContents();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create table of contents
-     *
-     * @param string $font
-     * @access public
-     */
-    public function createTableContents($font)
-    {
-        $this->generateP();
-        $this->generateFLDSIMPLE();
-        $this->generateR();
-        $this->generateRPR();
-        $this->generateRFONTS($font);
-        $this->generateB();
-        $this->generateBCS();
-        $this->generateNOPROOF();
-        $this->generateT('Press F9 to update table of contents.');
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Generate w:fldsimple
-     *
-     * @param string $instr. Optional, 'TOC \o &quot;1-4&quot; \h \z \u'
-     *                       as default
-     * @access protected
-     */
-    protected function generateFLDSIMPLE($instr = 'TOC \o &quot;1-4&quot;
-                                                \h \z \u')
-    {
-        $xml = '<' . CreateElement::NAMESPACEWORD .
-               ':fldSimple ' . CreateElement::NAMESPACEWORD .
-               ':instr="' . $instr .
-               '">__GENERATEP__</' . CreateElement::NAMESPACEWORD .
-               ':fldSimple>';
-
-        $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml);
-    }
-}

+ 0 - 404
main/inc/lib/phpdocx/classes/CreateText.inc

@@ -1,404 +0,0 @@
-<?php
-
-/**
- * Create text
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create text
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateText extends CreateElement
-{
-    const IDTITLE = 229998237;
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private static $_instance = NULL;
-    /**
-     *
-     * @access private
-     * @var int
-     */
-    private static $_idTitle = 0;
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     * Magic method, returns current XML
-     *
-     * @access public
-     * @return string Return current XML
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     * Singleton, return instance of class
-     *
-     * @access public
-     * @return CreateText
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateText();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create text
-     *
-     * @access public
-     * @param mixed $args[0]
-     * @param array $args[1]
-     */
-    public function createText()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-
-        $this->generateP();
-        if (!is_array($args[0])) {
-            if (
-                !empty($args[1]['jc']) ||
-                !empty($args[1]['pageBreakBefore']) ||
-                !empty($args[1]['widowControl']) ||
-                !empty($args[1]['wordWrap'])
-            ) {
-                $this->generatePPR();
-                if (!empty($args[1]['jc']))
-                    $this->generateJC($args[1]['jc']);
-                if (!empty($args[1]['pageBreakBefore']))
-                    $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']);
-                if (!empty($args[1]['widowControl']))
-                    $this->generateWIDOWCONTROL($args[1]['widowControl']);
-                if (!empty($args[1]['wordWrap']))
-                    $this->generateWORDWRAP($args[1]['wordWrap']);
-            }
-            $this->generateR();
-            if (
-                $args[1]['b'] != '' ||
-                $args[1]['i'] != '' ||
-                $args[1]['u'] != '' ||
-                $args[1]['sz'] != '' ||
-                $args[1]['color'] != '' ||
-                $args[1]['font'] != '' ||
-                $args[1]['tabs'] != ''
-            ) {
-                $this->generateRPR();
-                if (isset($args[1]['font']) && $args[1]['font'] != '') {
-                    $this->generateRFONTS($args[1]['font']);
-                }
-                if (isset($args[1]['b']) && $args[1]['b'] != '') {
-                    $this->generateB($args[1]['b']);
-                }
-                if (isset($args[1]['i']) && $args[1]['i'] != '') {
-                    $this->generateI($args[1]['i']);
-                }
-                if (isset($args[1]['u']) && $args[1]['u'] != '') {
-                    $this->generateU($args[1]['u']);
-                }
-                if (isset($args[1]['sz']) && $args[1]['sz'] != '') {
-                    $this->generateSZ($args[1]['sz']);
-                }
-                if (isset($args[1]['color']) && $args[1]['color'] != '') {
-                    $this->generateCOLOR($args[1]['color']);
-                }
-            }
-            $this->generateT($args[0], $args[1]['spaces']);
-        }
-    }
-
-    /**
-     * Create title
-     *
-     * @access protected
-     * @param string $arrArgs[0]
-     * @param array $arrArgs[1]
-     */
-    public function createTitle()
-    {
-        $this->_xml = '';
-        $args = func_get_args();
-        if (!empty($args[1]['val']) && !empty($args[0])) {
-            $this->generateP();
-            $this->generatePPR();
-            if ($args[1]['type'] == 'subtitle')
-                $this->generatePSTYLE('Subttulo' . $args[1]['val']);
-            else
-                $this->generatePSTYLE('Ttulo' . $args[1]['val']);
-            if (!empty($args[1]['pageBreakBefore']))
-                $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']);
-            if (!empty($args[1]['widowControl']))
-                $this->generateWIDOWCONTROL($args[1]['widowControl']);
-            if (!empty($args[1]['wordWrap']))
-                $this->generateWORDWRAP($args[1]['wordWrap']);
-            self::$_idTitle++;
-            $this->generateBOOKMARKSTART(
-                self::$_idTitle, '_Toc' . (self::$_idTitle + self::IDTITLE)
-            );
-            $this->generateR();
-            if (
-                $args[1]['b'] != '' ||
-                $args[1]['i'] != '' ||
-                $args[1]['u'] != '' ||
-                $args[1]['sz'] != '' ||
-                $args[1]['color'] != '' ||
-                $args[1]['font'] != ''
-            ) {
-                $this->generateRPR();
-                if ($args[1]['font'] != '') {
-                    $this->generateRFONTS($args[1]['font']);
-                }
-                if ($args[1]['b'] != '') {
-                    $this->generateB($args[1]['b']);
-                }
-                if ($args[1]['i'] != '') {
-                    $this->generateI($args[1]['i']);
-                }
-                if ($args[1]['u'] != '') {
-                    $this->generateU($args[1]['u']);
-                }
-                if ($args[1]['sz'] != '') {
-                    $this->generateSZ($args[1]['sz']);
-                }
-                if ($args[1]['color'] != '') {
-                    $this->generateCOLOR($args[1]['color']);
-                }
-            }
-            $this->generateT($args[0]);
-            $this->generateBOOKMARKEND(self::$_idTitle);
-            $this->cleanTemplate();
-        }
-    }
-
-    /**
-     * Generate w:b
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateB($strVal = 'single')
-    {
-        $element = '<' . CreateElement::NAMESPACEWORD . ':b ' .
-                CreateElement::NAMESPACEWORD . ':val="' . $strVal . '"></' .
-                CreateElement::NAMESPACEWORD . ':b>__GENERATERPR__';
-        $this->_xml = str_replace('__GENERATERPR__', $element, $this->_xml);
-    }
-
-    /**
-     * Generate w:color
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateCOLOR($val = '000000')
-    {
-        $this->_xml = str_replace(
-            '__GENERATERPR__', '<' . CreateElement::NAMESPACEWORD . ':color ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':color>__GENERATERPR__', $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:jc
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateJC($val = '')
-    {
-        $this->_xml = str_replace(
-            '__GENERATEPPR__', '<' . CreateElement::NAMESPACEWORD . ':jc ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':jc>__GENERATESZ__', $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:i
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateI($val = 'single')
-    {
-        $this->_xml = str_replace(
-            '__GENERATERPR__', '<' . CreateElement::NAMESPACEWORD . ':i ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':i>__GENERATERPR__', $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:sz
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSZ($val = '11')
-    {
-        $val *= 2;
-        $this->_xml = str_replace(
-            '__GENERATERPR__', '<' . CreateElement::NAMESPACEWORD . ':sz ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':sz>__GENERATERPR__', $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:u
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateU($val = 'single')
-    {
-        $this->_xml = str_replace(
-            '__GENERATERPR__', '<' . CreateElement::NAMESPACEWORD . ':u ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':u>__GENERATERPR__', $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:pstyle
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generatePSTYLE($val = 'Ttulo')
-    {
-        $this->_xml = str_replace(
-            '__GENERATEPPR__', '<' . CreateElement::NAMESPACEWORD . ':pStyle ' .
-            CreateElement::NAMESPACEWORD . ':val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':pStyle>__GENERATEPPR__',
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:pagebreakbefore
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generatePAGEBREAKBEFORE($val = 'on')
-    {
-        $this->_xml = str_replace(
-            '__GENERATEPPR__', '<' . CreateElement::NAMESPACEWORD .
-            ':pageBreakBefore val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':pageBreakBefore>__GENERATEPPR__',
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:widowcontrol
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateWIDOWCONTROL($val = 'on')
-    {
-        $this->_xml = str_replace(
-            '__GENERATEPPR__', '<' . CreateElement::NAMESPACEWORD .
-            ':widowControl val="' . $val . '"></' .
-            CreateElement::NAMESPACEWORD . ':widowControl>__GENERATEPPR__',
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:wordwrap
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateWORDWRAP($val = 'on')
-    {
-        $this->_xml = str_replace(
-            '__GENERATEPPR__', '<' . CreateElement::NAMESPACEWORD .
-            ':wordWrap val="' . $val . '"></' . CreateElement::NAMESPACEWORD .
-            ':wordWrap>__GENERATEPPR__', $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:bookmarkstart
-     *
-     * @access protected
-     * @param int $id
-     * @param string $name
-     */
-    protected function generateBOOKMARKSTART($id, $name)
-    {
-        $this->_xml = str_replace(
-            '__GENERATER__', '<' . CreateElement::NAMESPACEWORD .
-            ':bookmarkStart ' . CreateElement::NAMESPACEWORD . ':id="' . $id .
-            '" ' . CreateElement::NAMESPACEWORD . ':name="' . $name . '"></' .
-            CreateElement::NAMESPACEWORD .
-            ':bookmarkStart>__GENERATER____GENERATEBOOKMARKEND__', $this->_xml
-        );
-    }
-
-    /**
-     * Generate w:bookmarkend
-     *
-     * @access protected
-     * @param int $id
-     */
-    protected function generateBOOKMARKEND($id)
-    {
-        $this->_xml = str_replace(
-            '__GENERATEBOOKMARKEND__', '<' . CreateElement::NAMESPACEWORD .
-            ':bookmarkEnd ' . CreateElement::NAMESPACEWORD . ':id="' . $id .
-            '"></' . CreateElement::NAMESPACEWORD . ':bookmarkEnd>', $this->_xml
-        );
-    }
-
-}

+ 0 - 1270
main/inc/lib/phpdocx/classes/CreateTheme1.inc

@@ -1,1270 +0,0 @@
-<?php
-
-/**
- *
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- *
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateTheme1 extends CreateElement
-{
-    const NAMESPACEWORD = 'a';
-
-    /**
-     * @access private
-     * @var CreateFooter
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     *
-     * @access protected
-     * @var string
-     */
-    protected $_xml;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     *
-     * @access public
-     * @return CreateTheme1
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateTheme1();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create theme
-     *
-     * @access public
-     * @param string $font
-     */
-    public function createTheme($font)
-    {
-
-        $this->_xml = '';
-        $this->generateTHEMEELEMENTS();
-        $this->generateCLRSCHEME('Office');
-        $this->generateDK1();
-        $this->generateSYSCLR("windowText", "000000");
-        $this->generateLT1();
-        $this->generateSYSCLR("window", "FFFFFF");
-        $this->generateDK2();
-        $this->generateSRGBCLR('1F497D');
-        $this->generateLT2();
-        $this->generateSRGBCLR('EEECE1');
-        $this->generateACCENT1();
-        $this->generateSRGBCLR('4F81BD');
-        $this->generateACCENT2();
-        $this->generateSRGBCLR('C0504D');
-        $this->generateACCENT3();
-        $this->generateSRGBCLR('9BBB59');
-        $this->generateACCENT4();
-        $this->generateSRGBCLR('8064A2');
-        $this->generateACCENT5();
-        $this->generateSRGBCLR('4BACC6');
-        $this->generateACCENT6();
-        $this->generateSRGBCLR('F79646');
-        $this->generateHLINK();
-        $this->generateSRGBCLR('0000FF');
-        $this->generateFOLHLINK();
-        $this->generateSRGBCLR('800080');
-        if ($font != '') {
-            $this->generateFONTSCHEMA('Office');
-            $this->generateMAYORFONT();
-            $this->generateLATIN($font);
-            $this->generateEA('');
-            $this->generateCS('');
-            $this->generateMINORFONT();
-            $this->generateLATIN($font);
-            $this->generateEA('');
-            $this->generateCS('');
-        } else {
-            $this->generateFONTSCHEMA('Office');
-            $this->generateMAYORFONT();
-            $this->generateLATIN('Cambria');
-            $this->generateEA('');
-            $this->generateCS('');
-            $this->generateFONT('Jpan', 'MS 明朝');
-            $this->generateFONT2('Hang', '맑은 고딕');
-            $this->generateFONT2('Hans', '宋体');
-            $this->generateFONT2('Hant', '新細明體');
-            $this->generateFONT2('Arab', 'Times New Roman');
-            $this->generateFONT2('Hebr', 'Times New Roman');
-            $this->generateFONT2('Thai', 'Angsana New');
-            $this->generateFONT2('Ethi', 'Nyala');
-            $this->generateFONT2('Beng', 'Vrinda');
-            $this->generateFONT2('Gujr', 'Shruti');
-            $this->generateFONT2('Khmr', 'MoolBoran');
-            $this->generateFONT2('Knda', 'Tunga');
-            $this->generateFONT2('Guru', 'Raavi');
-            $this->generateFONT2('Cans', 'Euphemia');
-            $this->generateFONT2('Cher', 'Plantagenet Cherokee');
-            $this->generateFONT2('Yiii', 'Microsoft Yi Baiti');
-            $this->generateFONT2('Tibt', 'Microsoft Himalaya');
-            $this->generateFONT2('Thaa', 'MV Boli');
-            $this->generateFONT2('Deva', 'Mangal');
-            $this->generateFONT2('Telu', 'Gautami');
-            $this->generateFONT2('Taml', 'Latha');
-            $this->generateFONT2('Syrc', 'Estrangelo Edessa');
-            $this->generateFONT2('Orya', 'Kalinga');
-            $this->generateFONT2('Mlym', 'Kartika');
-            $this->generateFONT2('Laoo', 'DokChampa');
-            $this->generateFONT2('Sinh', 'Iskoola Pota');
-            $this->generateFONT2('Mong', 'Mongolian Baiti');
-            $this->generateFONT2('Viet', 'Times New Roman');
-            $this->generateFONT3('Uigh', 'Microsoft Uighur');
-            $this->generateMINORFONT();
-            $this->generateLATIN('Calibri');
-            $this->generateEA('');
-            $this->generateCS('');
-            $this->generateFONT('Jpan', 'MS 明朝');
-            $this->generateFONT2('Hang', '맑은 고딕');
-            $this->generateFONT2('Hans', '宋体');
-            $this->generateFONT2('Hant', '新細明體');
-            $this->generateFONT2('Arab', 'Arial');
-            $this->generateFONT2('Hebr', 'Arial');
-            $this->generateFONT2('Thai', 'Cordia New');
-            $this->generateFONT2('Ethi', 'Nyala');
-            $this->generateFONT2('Beng', 'Vrinda');
-            $this->generateFONT2('Gujr', 'Shruti');
-            $this->generateFONT2('Khmr', 'DaunPenh');
-            $this->generateFONT2('Knda', 'Tunga');
-            $this->generateFONT2('Guru', 'Raavi');
-            $this->generateFONT2('Cans', 'Euphemia');
-            $this->generateFONT2('Cher', 'Plantagenet Cherokee');
-            $this->generateFONT2('Yiii', 'Microsoft Yi Baiti');
-            $this->generateFONT2('Tibt', 'Microsoft Himalaya');
-            $this->generateFONT2('Thaa', 'MV Boli');
-            $this->generateFONT2('Deva', 'Mangal');
-            $this->generateFONT2('Telu', 'Gautami');
-            $this->generateFONT2('Taml', 'Latha');
-            $this->generateFONT2('Syrc', 'Estrangelo Edessa');
-            $this->generateFONT2('Orya', 'Kalinga');
-            $this->generateFONT2('Mlym', 'Kartika');
-            $this->generateFONT2('Laoo', 'DokChampa');
-            $this->generateFONT2('Sinh', 'Iskoola Pota');
-            $this->generateFONT2('Mong', 'Mongolian Baiti');
-            $this->generateFONT2('Viet', 'Arial');
-            $this->generateFONT3('Uigh', 'Microsoft Uighur');
-        }
-        $this->generateFMTSCHEME('Office');
-        $this->generateFILLSTYLELST();
-        $this->generateSOLIDFILL();
-        $this->generateSCHEMECLR('phClr');
-        $this->generateGRADFILL(1);
-        $this->generateGSLST();
-        $this->generateGS(0);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateTINT('50000');
-        $this->generateSATMOD('300000');
-        $this->generateGS(35000);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateTINT(37000);
-        $this->generateSATMOD(300000);
-        $this->generateGS2(100000);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateTINT(15000);
-        $this->generateSATMOD(350000);
-        $this->generateLIN(16200000, 1);
-
-        $this->generateGRADFILL2(1);
-        $this->generateGSLST();
-        $this->generateGS(0);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateSHADE('51000');
-        $this->generateSATMOD('130000');
-        $this->generateGS(80000);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateSHADE(93000);
-        $this->generateSATMOD(130000);
-        $this->generateGS2(100000);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateSHADE(94000);
-        $this->generateSATMOD(135000);
-        $this->generateLIN(16200000, 0);
-
-        $this->generateLNSTYLELST();
-        $this->generateLN(9525, "flat", "sng", "ctr");
-        $this->generateSOLIDFILL();
-        $this->generateSCHEMECLR3('phClr');
-        $this->generateSHADE('95000');
-        $this->generateSATMOD('105000');
-        $this->generatePRSTDASH('solid');
-        $this->generateLN(25400, "flat", "sng", "ctr");
-        $this->generateSOLIDFILL();
-        $this->generateSCHEMECLR('phClr');
-        $this->generatePRSTDASH('solid');
-        $this->generateLN2(38100, 'flat', 'sng', 'ctr');
-        $this->generateSOLIDFILL();
-        $this->generateSCHEMECLR('phClr');
-        $this->generatePRSTDASH('solid');
-
-        $this->generateEFFECTSTYLELST();
-        $this->generateEFFECTSTYLE();
-        $this->generateEFFECTLST();
-        $this->generateOUTERSHDW(40000, 20000, 5400000, 0);
-        $this->generateSRGBCLR2('000000');
-        $this->generateALPHA(38000);
-        $this->generateEFFECTSTYLE();
-        $this->generateEFFECTLST();
-        $this->generateOUTERSHDW(40000, 23000, 5400000, 0);
-        $this->generateSRGBCLR2('000000');
-        $this->generateALPHA(35000);
-        $this->generateEFFECTSTYLE2();
-        $this->generateEFFECTLST2();
-        $this->generateOUTERSHDW(40000, 23000, 5400000, 0);
-        $this->generateSRGBCLR2('000000');
-        $this->generateALPHA(35000);
-
-        $this->generateSCENE3D();
-        $this->generateCAMERA('orthographicFront');
-        $this->generateROT(0, 0, 0);
-        $this->generateLIGHTRIG('threePt', 't');
-        $this->generateROT(0, 0, 1200000);
-        $this->generateSP3D();
-        $this->generateBEVELT(63500, 25400);
-        $this->generateBGFILLSTYLELST();
-        $this->generateSOLIDFILL();
-        $this->generateSCHEMECLR('phClr');
-        $this->generateGRADFILL(1);
-        $this->generateGSLST();
-        $this->generateGS(0);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateTINT('40000');
-        $this->generateSATMOD('350000');
-        $this->generateGS(40000);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateTINT2(45000);
-        $this->generateSHADE(99000);
-        $this->generateSATMOD(350000);
-        $this->generateGS2(100000);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateSHADE(20000);
-        $this->generateSATMOD(255000);
-        $this->generatePATH('circle');
-        $this->generateFILLTORECT(50000, '-80000', 50000, 180000);
-
-        $this->generateGRADFILL2(1);
-        $this->generateGSLST();
-        $this->generateGS(0);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateTINT('80000');
-        $this->generateSATMOD('300000');
-        $this->generateGS2(100000);
-        $this->generateSCHEMECLR2('phClr');
-        $this->generateSHADE(30000);
-        $this->generateSATMOD(200000);
-        $this->generatePATH('circle');
-        $this->generateFILLTORECT(50000, 50000, 50000, 50000);
-        $this->generateOBJECTDEFAULTS();
-        $this->generateEXTRACLRSCHEMELST();
-        $this->cleanTemplate();
-    }
-
-    /**
-     * Generate a:themeelements
-     *
-     * @access protected
-     */
-    protected function generateTHEMEELEMENTS()
-    {
-        $this->_xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':themeElements>__GENERATETHEMEELEMENTS1____' .
-            'GENERATETHEMEELEMENTS2____GENERATETHEMEELEMENTS3__</' .
-            CreateTheme1::NAMESPACEWORD .
-            ':themeElements>__GENERATETHEMEELEMENTS4__';
-    }
-
-    /**
-     * Generate a:clrscheme
-     *
-     * @access protected
-     * @param string $name
-     */
-    protected function generateCLRSCHEME($name = 'Office')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':clrScheme name="' . $name .
-            '">__GENERATECLRSCHEME__</' . CreateTheme1::NAMESPACEWORD .
-            ':clrScheme>';
-
-        $this->_xml = str_replace(
-            '__GENERATETHEMEELEMENTS1__',
-            $xml,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:dk1
-     *
-     * @access protected
-     */
-    protected function generateDK1()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':dk1>__GENERATESYSCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':dk1>__GENERATEDK1__';
-
-        $this->_xml = str_replace('__GENERATECLRSCHEME__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:sysclr
-     * 
-     * @access protected
-     * @param string $val
-     * @param string $lastClr
-     */
-    protected function generateSYSCLR($val = 'windowText', $lastClr = '000000')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':sysClr val="' . $val . '" lastClr="' . $lastClr .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':sysClr>';
-        $this->_xml = str_replace('__GENERATESYSCLR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:lt1
-     *
-     * @access protected
-     */
-    protected function generateLT1()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':lt1>__GENERATESYSCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':lt1>__GENERATELT1__';
-        $this->_xml = str_replace('__GENERATEDK1__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:dk2
-     *
-     * @access protected
-     */
-    protected function generateDK2()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':dk2>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':dk2>__GENERATEDK2__';
-        $this->_xml = str_replace('__GENERATELT1__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:srgbclr
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSRGBCLR($val = 'windowText')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':srgbClr val="' . $val .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':srgbClr>';
-        $this->_xml = str_replace('__GENERATESRGBCLR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:lt2
-     *
-     * @access protected
-     */
-    protected function generateLT2()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':lt2>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':lt2>__GENERATELT2__';
-        $this->_xml = str_replace('__GENERATEDK2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:accent1
-     *
-     * @access protected
-     */
-    protected function generateACCENT1()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':accent1>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':accent1>__GENERATEACCENT1__';
-        $this->_xml = str_replace('__GENERATELT2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:accent2
-     *
-     * @access protected
-     */
-    protected function generateACCENT2()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':accent2>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':accent2>__GENERATEACCENT2__';
-        $this->_xml = str_replace('__GENERATEACCENT1__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:accent3
-     *
-     * @access protected
-     */
-    protected function generateACCENT3()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':accent3>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':accent3>__GENERATEACCENT3__';
-        $this->_xml = str_replace('__GENERATEACCENT2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:accent4
-     *
-     * @access protected
-     */
-    protected function generateACCENT4()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':accent4>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':accent4>__GENERATEACCENT4__';
-        $this->_xml = str_replace('__GENERATEACCENT3__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:accent5
-     *
-     * @access protected
-     */
-    protected function generateACCENT5()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':accent5>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':accent5>__GENERATEACCENT5__';
-        $this->_xml = str_replace('__GENERATEACCENT4__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:accent6
-     *
-     * @access protected
-     */
-    protected function generateACCENT6()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':accent6>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':accent6>__GENERATEACCENT6__';
-        $this->_xml = str_replace('__GENERATEACCENT5__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:hlink
-     *
-     * @access protected
-     */
-    protected function generateHLINK()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':hlink>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':hlink>__GENERATEHLINK__';
-        $this->_xml = str_replace('__GENERATEACCENT6__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:folhlink
-     *
-     * @access protected
-     */
-    protected function generateFOLHLINK()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':folHlink>__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':folHlink>';
-        $this->_xml = str_replace('__GENERATEHLINK__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:fontschema
-     *
-     * @access protected
-     * @param string $name
-     */
-    protected function generateFONTSCHEMA($name = 'Office')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':fontScheme name="' . $name .
-            '">__GENERATEFONTSCHEMA1____GENERATEFONTSCHEMA2__</' .
-            CreateTheme1::NAMESPACEWORD . ':fontScheme>';
-
-        $this->_xml = str_replace(
-            '__GENERATETHEMEELEMENTS2__', $xml, $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:mayorfont
-     *
-     * @access protected
-     */
-    protected function generateMAYORFONT()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':majorFont>__GENERATEMAYORFONT__</' .
-            CreateTheme1::NAMESPACEWORD .
-            ':majorFont>';
-
-        $this->_xml = str_replace('__GENERATEFONTSCHEMA1__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:latin
-     *
-     * @access protected
-     * @param string $typeface
-     */
-    protected function generateLATIN($typeface = 'cambia')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':latin typeface="' . $typeface .
-            '"></' . CreateTheme1::NAMESPACEWORD .
-            ':latin>__GENERATELATIN__';
-
-        $this->_xml = str_replace('__GENERATEMAYORFONT__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:ea
-     *
-     * @access protected
-     * @param string $typeface
-     */
-    protected function generateEA($typeface = '')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':ea typeface="' . $typeface .
-            '"></' . CreateTheme1::NAMESPACEWORD .
-            ':ea>__GENERATEEA__';
-        $this->_xml = str_replace('__GENERATELATIN__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:cs
-     *
-     * @access protected
-     * @param string $typeface
-     */
-    protected function generateCS($typeface = '')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':cs typeface="' . $typeface .
-            '"></' . CreateTheme1::NAMESPACEWORD .
-            ':cs>__GENERATECS__';
-
-        $this->_xml = str_replace('__GENERATEEA__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:font
-     *
-     * @access protected
-     * @param string $script
-     * @param string $typeface
-     */
-    protected function generateFONT($script = '', $typeface = '')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':font script="' . $script .
-            '" typeface="' . $typeface .
-            '"></' . CreateTheme1::NAMESPACEWORD .
-            ':font>__GENERATEFONT__';
-        $this->_xml = str_replace('__GENERATECS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:font
-     *
-     * @access protected
-     * @param string script
-     * @param string $typeface
-     */
-    protected function generateFONT2($script = '', $typeface = '')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':font script="' . $script .
-            '" typeface="' . $typeface .
-            '"></' . CreateTheme1::NAMESPACEWORD .
-            ':font>__GENERATEFONT__';
-
-        $this->_xml = str_replace('__GENERATEFONT__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:font
-     *
-     * @access protected
-     * @param string $script
-     * @param string $typeface
-     */
-    protected function generateFONT3($script = '', $typeface = '')
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':font script="' . $script .
-            '" typeface="' . $typeface .
-            '"></' . CreateTheme1::NAMESPACEWORD .
-            ':font>';
-        $this->_xml = str_replace('__GENERATEFONT__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:minorfont
-     *
-     * @access protected
-     */
-    protected function generateMINORFONT()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':minorFont>__GENERATEMAYORFONT__</' .
-            CreateTheme1::NAMESPACEWORD . ':minorFont>';
-        $this->_xml = str_replace('__GENERATEFONTSCHEMA2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:fmtscheme
-     *
-     * @access protected
-     * @param string $name
-     */
-    protected function generateFMTSCHEME($name)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':fmtScheme name="' . $name .
-            '">__GENERATEFMTSCHEME__</' . CreateTheme1::NAMESPACEWORD .
-            ':fmtScheme>';
-        $this->_xml = str_replace(
-            '__GENERATETHEMEELEMENTS3__', $xml, $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:fillstylelst
-     *
-     * @access protected
-     */
-    protected function generateFILLSTYLELST()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':fillStyleLst>__GENERATEFILLSTYLELST__</' .
-            CreateTheme1::NAMESPACEWORD .
-            ':fillStyleLst>__GENERATEFILLSTYLELST2__';
-        $this->_xml = str_replace('__GENERATEFMTSCHEME__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:solidfill
-     *
-     * @access protected
-     */
-    protected function generateSOLIDFILL()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':solidFill>__GENERATESOLIDFILL__</' .
-            CreateTheme1::NAMESPACEWORD .
-            ':solidFill>__GENERATESOLIDFILL2__';
-
-        $this->_xml = str_replace(
-            '__GENERATEFILLSTYLELST__', $xml, $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:schemeclr
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSCHEMECLR($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':schemeClr val="' . $val .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':schemeClr>';
-
-        $this->_xml = str_replace('__GENERATESOLIDFILL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:gradfill
-     *
-     * @access protected
-     * @param string $rotWithShape
-     */
-    protected function generateGRADFILL($rotWithShape)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':gradFill rotWithShape="' .
-            $rotWithShape . '">__GENERATEGRADFILL__</' .
-            CreateTheme1::NAMESPACEWORD .
-            ':gradFill>__GENERATESOLIDFILL2__';
-
-        $this->_xml = str_replace('__GENERATESOLIDFILL2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:gradfill
-     *
-     * @access protected
-     * @param string $rotWithShape
-     */
-    protected function generateGRADFILL2($rotWithShape)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':gradFill rotWithShape="' .
-            $rotWithShape . '">__GENERATEGRADFILL__</' .
-            CreateTheme1::NAMESPACEWORD . ':gradFill>';
-        $this->_xml = str_replace('__GENERATESOLIDFILL2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:gslst
-     *
-     * @access protected
-     */
-    protected function generateGSLST()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':gsLst>__GENERATEGSLST__</'.
-            CreateTheme1::NAMESPACEWORD . ':gsLst>__GENERATEGSLST2__';
-        $this->_xml = str_replace('__GENERATEGRADFILL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:gs
-     *
-     * @access protected
-     * @param string $pos
-     */
-    protected function generateGS($pos)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':gs pos="' . $pos .
-            '">__GENERATEPOS__</' . CreateTheme1::NAMESPACEWORD .
-            ':gs>__GENERATEGSLST__';
-        $this->_xml = str_replace('__GENERATEGSLST__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:gs
-     *
-     * @access protected
-     * @param string $pos
-     */
-    protected function generateGS2($pos)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':gs pos="' .
-            $pos . '">__GENERATEPOS__</' . CreateTheme1::NAMESPACEWORD . ':gs>';
-        $this->_xml = str_replace('__GENERATEGSLST__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:schemeclr
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSCHEMECLR2($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':schemeClr val="' . $val .
-            '">__GENERATESCHEMECLR2__</' . CreateTheme1::NAMESPACEWORD .
-            ':schemeClr>';
-        $this->_xml = str_replace('__GENERATEPOS__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:tint
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateTINT($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':tint val="' . $val .
-            '"></' . CreateTheme1::NAMESPACEWORD .
-            ':tint>__GENERATETINT__';
-        $this->_xml = str_replace('__GENERATESCHEMECLR2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:shade
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSHADE($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':shade val="' . $val .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':shade>__GENERATETINT__';
-        $this->_xml = str_replace('__GENERATESCHEMECLR2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:satmod
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSATMOD($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':satMod val="' . $val .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':satMod>';
-        $this->_xml = str_replace('__GENERATETINT__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:lin
-     *
-     * @access protected
-     * @param string $val
-     * @param string $scaled
-     */
-    protected function generateLIN($ang, $scaled)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':lin ang="' . $ang .
-            '" scaled="' . $scaled .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':lin>';
-        $this->_xml = str_replace('__GENERATEGSLST2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:lnstylelst
-     *
-     * @access protected
-     */
-    protected function generateLNSTYLELST()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':lnStyleLst>__GENERATELNSTYLELST__</' .
-            CreateTheme1::NAMESPACEWORD . ':lnStyleLst>__GENERATELNSTYLELST2__';
-        $this->_xml = str_replace(
-            '__GENERATEFILLSTYLELST2__', $xml, $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:ln
-     *
-     * @access protected
-     * @param string $w
-     * @param string $cap
-     * @param string $cmpd
-     * @param string $algn
-     */
-    protected function generateLN($w, $cap, $cmpd, $algn)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':ln w="' . $w .
-            '" cap="' . $cap . '" cmpd="' . $cmpd . '" algn="' . $algn .
-            '">__GENERATEFILLSTYLELST__</' . CreateTheme1::NAMESPACEWORD .
-            ':ln>__GENERATELNSTYLELST__';
-        $this->_xml = str_replace('__GENERATELNSTYLELST__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:ln
-     *
-     * @access protected
-     * @param string $w
-     * @param string $cap
-     * @param string $cmpd
-     * @param string $algn
-     */
-    protected function generateLN2($w, $cap, $cmpd, $algn)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':ln w="' . $w .
-            '" cap="' . $cap . '" cmpd="' . $cmpd . '" algn="' . $algn .
-            '">__GENERATEFILLSTYLELST__</' . CreateTheme1::NAMESPACEWORD
-            . ':ln>';
-        $this->_xml = str_replace('__GENERATELNSTYLELST__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:schemeclr3
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSCHEMECLR3($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':schemeClr val="' .
-            $val . '">__GENERATESCHEMECLR2__</' . CreateTheme1::NAMESPACEWORD
-            . ':schemeClr>';
-        $this->_xml = str_replace('__GENERATESOLIDFILL__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:prstdash
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generatePRSTDASH($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':prstDash val="' . $val . '"></' .
-            CreateTheme1::NAMESPACEWORD . ':prstDash>';
-        $this->_xml = str_replace('__GENERATESOLIDFILL2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:effectstylest
-     *
-     * @access protected
-     */
-    protected function generateEFFECTSTYLELST()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':effectStyleLst>__GENERATEEFFECTSTYLELST__</' .
-            CreateTheme1::NAMESPACEWORD .
-            ':effectStyleLst>__GENERATEEFFECTSTYLELST2__';
-        $this->_xml = str_replace('__GENERATELNSTYLELST2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:effectstyle
-     *
-     * @access protected
-     */
-    protected function generateEFFECTSTYLE()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':effectStyle>__GENERATEEFFECTSTYLE__</' .
-            CreateTheme1::NAMESPACEWORD .
-            ':effectStyle>__GENERATEEFFECTSTYLELST__';
-        $this->_xml = str_replace(
-            '__GENERATEEFFECTSTYLELST__',
-            $xml,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:effectstyle2
-     *
-     * @access protected
-     */
-    protected function generateEFFECTSTYLE2()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':effectStyle>__GENERATEEFFECTSTYLE__</' .
-            CreateTheme1::NAMESPACEWORD . ':effectStyle>';
-        $this->_xml = str_replace(
-            '__GENERATEEFFECTSTYLELST__', $xml, $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:effectlst
-     *
-     * @access protected
-     */
-    protected function generateEFFECTLST()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':effectLst>__GENERATEEFFECTLST__</' .
-            CreateTheme1::NAMESPACEWORD . ':effectLst>';
-        $this->_xml = str_replace('__GENERATEEFFECTSTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:outershdw
-     *
-     * @access protected
-     * @param string $blurRad
-     * @param string $dist
-     * @param string $dir
-     * @param string $rotWithShape
-     */
-    protected function generateOUTERSHDW($blurRad, $dist, $dir, $rotWithShape)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':outerShdw blurRad="' . $blurRad . '" dist="' .
-            $dist . '" dir="' . $dir . '" rotWithShape="' .
-            $rotWithShape . '">__GENERATEOUTERSHDW__</' .
-            CreateTheme1::NAMESPACEWORD . ':outerShdw>';
-        $this->_xml = str_replace('__GENERATEEFFECTLST__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:srgbclr2
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateSRGBCLR2($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':srgbClr val="' .
-            $val . '">__GENERATESRGBCLR__</' . CreateTheme1::NAMESPACEWORD .
-            ':srgbClr>';
-        $this->_xml = str_replace('__GENERATEOUTERSHDW__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:alpha
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateALPHA($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':alpha val="' . $val .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':alpha>';
-        $this->_xml = str_replace('__GENERATESRGBCLR__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:effectlst2
-     *
-     * @access protected
-     */
-    protected function generateEFFECTLST2()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':effectLst>__GENERATEEFFECTLST__</' . CreateTheme1::NAMESPACEWORD .
-            ':effectLst>__GENERATEEFFECTLST2__';
-        $this->_xml = str_replace('__GENERATEEFFECTSTYLE__', $xml, $this->_xml);
-    }
-
-    /**
-     *
-     * @access protected
-     */
-    protected function generateSCENE3D()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':scene3d>__GENERATESCENE3D__</' . CreateTheme1::NAMESPACEWORD .
-            ':scene3d>__GENERATESCENE3D2__';
-        $this->_xml = str_replace('__GENERATEEFFECTLST2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:camera
-     *
-     * @access protected
-     * @param string $prst
-     */
-    protected function generateCAMERA($prst)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':camera prst="' . $prst .
-            '">__GENERATECAMERA__</' . CreateTheme1::NAMESPACEWORD .
-            ':camera>__GENERATECAMERA2__';
-        $this->_xml = str_replace('__GENERATESCENE3D__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:rot
-     *
-     * @access protected
-     * @param string $lat
-     * @param string $lon
-     * @param string @rev
-     */
-    protected function generateROT($lat, $lon, $rev)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':rot lat="' . $lat .
-            '" lon="' . $lon . '" rev="' . $rev .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':rot>';
-        $this->_xml = str_replace('__GENERATECAMERA__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:lightrig
-     *
-     * @access protected
-     * @param string $rig
-     * @param string $dir
-     */
-    protected function generateLIGHTRIG($rig, $dir)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':lightRig rig="' . $rig . '" dir="' . $dir .
-            '">__GENERATECAMERA__</' . CreateTheme1::NAMESPACEWORD .
-            ':lightRig>';
-        $this->_xml = str_replace('__GENERATECAMERA2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:sp3d
-     *
-     * @access protected
-     */
-    protected function generateSP3D()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':sp3d>__GENERATESP3D__</' . CreateTheme1::NAMESPACEWORD .
-            ':sp3d>';
-        $this->_xml = str_replace('__GENERATESCENE3D2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:bevelt
-     *
-     * @access protected
-     * @param string $w
-     * @param string $h
-     */
-    protected function generateBEVELT($w, $h)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':bevelT w="' . $w . '" h="' . $h .
-            '"></' . CreateTheme1::NAMESPACEWORD . ':bevelT>';
-        $this->_xml = str_replace('__GENERATESP3D__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:bgfillstylelst
-     *
-     * @access protected
-     */
-    protected function generateBGFILLSTYLELST()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':bgFillStyleLst>__GENERATEFILLSTYLELST__</' .
-            CreateTheme1::NAMESPACEWORD . ':bgFillStyleLst>';
-
-        $this->_xml = str_replace(
-            '__GENERATEEFFECTSTYLELST2__',
-            $xml,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:tint2
-     *
-     * @access protected
-     * @param string $val
-     */
-    protected function generateTINT2($val)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD . ':tint val="' . $val .
-            '"></' . CreateTheme1::NAMESPACEWORD .
-            ':tint>__GENERATESCHEMECLR2__';
-        $this->_xml = str_replace('__GENERATESCHEMECLR2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:path
-     *
-     * @access protected
-     * @param string @path
-     */
-    protected function generatePATH($path)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':path path="' . $path .
-            '">__GENERATEPATH__</' . CreateTheme1::NAMESPACEWORD .
-            ':path>';
-        $this->_xml = str_replace('__GENERATEGSLST2__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:filltorect
-     *
-     * @access protected
-     * @param string $l
-     * @param string $t
-     * @param string $r
-     * @param string $b
-     */
-    protected function generateFILLTORECT($l, $t, $r, $b)
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':fillToRect l="' . $l . '" t="' . $t . '" r="' . $r .
-            '" b="' . $b . '"></' . CreateTheme1::NAMESPACEWORD .
-            ':fillToRect>';
-        $this->_xml = str_replace('__GENERATEPATH__', $xml, $this->_xml);
-    }
-
-    /**
-     * Generate a:objectdefaults
-     *
-     * @access protected
-     */
-    protected function generateOBJECTDEFAULTS()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':objectDefaults></' . CreateTheme1::NAMESPACEWORD .
-            ':objectDefaults>__GENERATETHEMEELEMENTS4__';
-
-        $this->_xml = str_replace(
-            '__GENERATETHEMEELEMENTS4__',
-            $xml,
-            $this->_xml
-        );
-    }
-
-    /**
-     * Generate a:extraclrschemelst
-     *
-     * @access protected
-     */
-    protected function generateEXTRACLRSCHEMELST()
-    {
-        $xml = '<' . CreateTheme1::NAMESPACEWORD .
-            ':extraClrSchemeLst></' . CreateTheme1::NAMESPACEWORD .
-            ':extraClrSchemeLst>';
-
-        $this->_xml = str_replace(
-            '__GENERATETHEMEELEMENTS4__',
-            $xml,
-            $this->_xml
-        );
-    }
-
-}

+ 0 - 105
main/inc/lib/phpdocx/classes/CreateWebSettings.inc

@@ -1,105 +0,0 @@
-<?php
-
-/**
- * Create default websettings XML
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-include_once dirname(__FILE__) . '/CreateElement.inc';
-
-/**
- * Create default websettings XML
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateWebSettings extends CreateElement
-{
-
-    /**
-     *
-     * @access protected
-     */
-    protected $_xml;
-    /**
-     *
-     * @access private
-     * @static
-     */
-    private static $_instance = NULL;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-
-    }
-
-    /**
-     * Magic method, returns current XML
-     *
-     * @access public
-     * @return string Return current XML
-     */
-    public function __toString()
-    {
-        return $this->_xml;
-    }
-
-    /**
-     * Singleton, return instance of class
-     *
-     * @access public
-     * @return CreateWebSettings
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateWebSettings();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Main tags of websettings XML
-     *
-     * @access public
-     */
-    public function generateWebSettings()
-    {
-        $this->_xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'
-                . '<' . CreateElement::NAMESPACEWORD . ':webSettings '
-                . 'xmlns:r="http://schemas.openxmlformats.org/officeDocument/'
-                . '2006/relationships" xmlns:w="http://schemas.openxmlformats.'
-                . 'org/wordprocessingml/2006/main"><'
-                . CreateElement::NAMESPACEWORD . ':optimizeForBrowser /></'
-                . CreateElement::NAMESPACEWORD . ':webSettings>';
-    }
-
-}

+ 0 - 247
main/inc/lib/phpdocx/classes/CreateXlsx.inc

@@ -1,247 +0,0 @@
-<?php
-
-/**
- * Create XLSX
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-
-/**
- * Create XLSX
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class CreateXlsx
-{
-
-    /**
-     * @access private
-     * @var CreateFooter
-     * @static
-     */
-    private static $_instance = NULL;
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_zipXlsx;
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_xmlXlTablesContent;
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_xmlXlSharedStringsContent;
-    /**
-     *
-     * @access private
-     * @var <type>
-     */
-    private $_xmlXlSheetContent;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-        
-    }
-
-    /**
-     *
-     * @access public
-     * @return string
-     */
-    public function __toString()
-    {
-        return $this->_zipXlsx;
-    }
-
-    /**
-     *
-     * @access public
-     * @return CreateXlsx
-     * @static
-     */
-    public static function getInstance()
-    {
-        if (self::$_instance == NULL) {
-            self::$_instance = new CreateXlsx();
-        }
-        return self::$_instance;
-    }
-
-    /**
-     * Create XLSX
-     * 
-     * @access public
-     * @return bool
-     */
-    public function createXlsx()
-    {
-        $args = func_get_args();
-        $this->_zipXlsx = new ZipArchive();
-        $this->_zipXlsx->open($args[0], ZipArchive::OVERWRITE);
-        $this->_xmlXlTablesContent = '';
-        $this->_xmlXlSharedStringsContent = '';
-        $this->_xmlXlSheetContent = '';
-        try {
-            $dirname = substr(__FILE__, 0, strpos(__FILE__, '/classes')) .
-                '/excel/';
-
-            $this->_zipXlsx->addFile(
-                $dirname . '[Content_Types].xml',
-                '[Content_Types].xml'
-            );
-            $this->_zipXlsx->addFile(
-                $dirname . 'docProps/core.xml',
-                'docProps/core.xml'
-            );
-            $this->_zipXlsx->addFile(
-                $dirname . 'docProps/app.xml',
-                'docProps/app.xml'
-            );
-            $this->_zipXlsx->addFile(
-                $dirname . '_rels/.rels',
-                '_rels/.rels'
-            );
-            $this->_zipXlsx->addFile(
-                $dirname . 'xl/_rels/workbook.xml.rels',
-                'xl/_rels/workbook.xml.rels'
-            );
-            $this->_zipXlsx->addFile(
-                $dirname . 'xl/theme/theme1.xml',
-                'xl/theme/theme1.xml'
-            );
-            $this->_zipXlsx->addFile(
-                $dirname . 'xl/worksheets/_rels/sheet1.xml.rels',
-                'xl/worksheets/_rels/sheet1.xml.rels'
-            );
-            $this->_zipXlsx->addFile(
-                $dirname . 'xl/styles.xml',
-                'xl/styles.xml'
-            );
-            $this->_zipXlsx->addFile(
-                $dirname . 'xl/workbook.xml',
-                'xl/workbook.xml'
-            );
-            $this->addTable($args[1], $args[2]);
-            $this->_zipXlsx->addFromString(
-                'xl/tables/table1.xml',
-                $this->_xmlXlTablesContent
-            );
-
-            $this->addSharedStrings($args[1], $args[2]);
-            $this->_zipXlsx->addFromString(
-                'xl/sharedStrings.xml',
-                $this->_xmlXlSharedStringsContent
-            );
-
-            $this->addSheet($args[1], $args[2]);
-            $this->_zipXlsx->addFromString(
-                'xl/worksheets/sheet1.xml',
-                $this->_xmlXlSheetContent
-            );
-            $this->_zipXlsx->close();
-
-            return true;
-        } catch (Exception $e) {
-            echo 'There was an error related to XLSX file: ',
-            $e->getMessage(),
-            "\n";
-            return false;
-        }
-    }
-
-    /**
-     * Add table
-     *
-     * @access protected
-     * @param array $args[0]
-     * @param array $args[1]
-     */
-    protected function addTable()
-    {
-        $args = func_get_args();
-        $excelTable = CreateExcelTable::getInstance();
-        $excelTable->createExcelTable($args[0], $args[1]);
-        $this->_xmlXlTablesContent .= (string) $excelTable;
-    }
-
-    /**
-     * Add shared strings
-     *
-     * @access protected
-     * * @param array $args[0]
-     * @param array $args[1]
-     */
-    protected function addSharedStrings()
-    {
-        $args = func_get_args();
-        $excelSS = CreateExcelSharedStrings::getInstance();
-        $excelSS->createExcelSharedStrings($args[0], $args[1]);
-        $this->_xmlXlSharedStringsContent .= (string) $excelSS;
-    }
-
-    /**
-     * Add sheet
-     *
-     * @access protected
-     * * @param array $args[0]
-     * @param array $args[1]
-     */
-    protected function addSheet()
-    {
-        $args = func_get_args();
-        $excelSheet = CreateExcelSheet::getInstance();
-        $excelSheet->createExcelSheet($args[0], $args[1]);
-        $this->_xmlXlSheetContent .= (string) $excelSheet;
-    }
-
-    /**
-     *
-     * @access private
-     * @deprecated
-     */
-    private function cleanTemplate()
-    {
-        $this->_xmlWordDocumentTemplate = preg_replace(
-            '/__[A-Z]+__/',
-            '',
-            $this->_xmlWordDocumentTemplate
-        );
-    }
-
-}

+ 0 - 312
main/inc/lib/phpdocx/classes/TransformDoc.inc

@@ -1,312 +0,0 @@
-<?php
-
-/**
- * Transform DOCX to PDF or XHTML
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    LGPL
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      File available since Release 1.0
- */
-
-error_reporting(E_ALL & ~E_NOTICE);
-
-require_once dirname(__FILE__) . '/AutoLoader.inc';
-AutoLoader::loadPDF();
-
-/**
- * Transform DOCX to PDF or XHTML
- *
- * @category   Phpdocx
- * @package    elements
- * @copyright  Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
- *             (http://www.2mdc.com)
- * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
- * @version    1.0
- * @link       http://www.phpdocx.com
- * @since      Class available since Release 1.0
- */
-class TransformDoc
-{
-    const SCHEMA_IMAGEDOCUMENT =
-    'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image';
-    const SCHEMA_OFFICEDOCUMENT =
-    'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument';
-
-    /**
-     *
-     * @access private
-     * @var string
-     */
-    private $_xhtml;
-
-    /**
-     * Construct
-     *
-     * @access public
-     */
-    public function __construct()
-    {
-        
-    }
-
-    /**
-     * Destruct
-     *
-     * @access public
-     */
-    public function __destruct()
-    {
-        
-    }
-
-    /**
-     * Getter. File
-     *
-     * @access public
-     */
-    public function getstrFile()
-    {
-        return $this->strFile;
-    }
-
-    /**
-     * Getter. XHTML
-     *
-     * @access public
-     */
-    public function getStrXHTML()
-    {
-        return $this->_xhtml;
-    }
-
-    /**
-     * Getter. Output file
-     *
-     * @access public
-     */
-    public function getStrOutputFile()
-    {
-        return $this->strOutputFile;
-    }
-
-    /**
-     * Setter. File
-     *
-     * @access public
-     */
-    public function setstrFile($file)
-    {
-        $this->strFile = $file;
-    }
-
-    /**
-     * Setter. XHTML
-     *
-     * @access public
-     */
-    public function setStrXHTML($strXHTML)
-    {
-        $this->_xhtml = $strXHTML;
-    }
-
-    /**
-     *
-     * @param string $outputFile
-     */
-    public function setStrOutputFile($outputFile)
-    {
-        $this->strOutputFile = $outputFile;
-    }
-
-    /**
-     * Return zip path
-     *
-     * @access public
-     * @return string
-     */
-    public function absoluteZipPath($path)
-    {
-        $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path);
-        $parts = array_filter(
-            explode(DIRECTORY_SEPARATOR, $path), 'strlen'
-        );
-        $arrAbsolutes = array();
-        foreach ($parts as $datParts) {
-            if ('.' == $datParts)
-                continue;
-            if ('..' == $datParts) {
-                array_pop($arrAbsolutes);
-            } else {
-                $arrAbsolutes[] = $datParts;
-            }
-        }
-        return implode('/', $arrAbsolutes);
-    }
-
-    /**
-     * Clean HTML
-     *
-     * @access public
-     */
-    public function cleanXHTML()
-    {
-        $sectionOne = explode('<head>', $this->_xhtml);
-        $sectionTwo = explode('</head>', $this->_xhtml);
-        $sectionTwo = str_replace(
-            'src="?image="', 'src="imagen_not_found.jpg"', $sectionTwo
-        );
-        if (!isset($sectionTwo[1])) {
-            $sectionTwo[1] = $this->_xhtml;
-        }
-        $this->_xhtml = $sectionOne[0] .
-            '<head><meta http-equiv="Content-Type" ' .
-            'content="text/html; charset=utf-8" /></head>' . $sectionTwo[1];
-    }
-
-    /**
-     * Return file name
-     *
-     * @access public
-     */
-    public function getFileName()
-    {
-        try {
-            $partsFile = explode('/', $this->strFile);
-            $divideFile = explode('.', array_pop($partsFile));
-            $fileName = array_shift($divideFile);
-        }
-        catch (Exception $e) {
-            $fileName = 'file';
-        }
-        return $fileName;
-    }
-
-    /**
-     * Convert DOCX to XHTML
-     *
-     * @access public
-     */
-    public function generateXHTML()
-    {
-        $package = new ZipArchive();
-        if (!$package->open($this->strFile)) {
-            echo 'Unable to find the DOCX file';
-            exit();
-        }
-        $relations = simplexml_load_string(
-            $package->getFromName('_rels/.rels')
-        );
-
-        foreach ($relations->Relationship as $rel) {
-            if ($rel["Type"] == TransformDoc::SCHEMA_OFFICEDOCUMENT) {
-                $xml = $package->getFromName(
-                    $this->absoluteZipPath(
-                        dirname($rel['Target']) . '/' .
-                        basename($rel['Target'])
-                    )
-                );
-
-                $xmlDOM = new DOMDocument();
-                $xml = str_replace('</w:wordDocument>', '', $xml);
-                $xml = preg_replace(
-                    '/(<w:wordDocument)+(.)*(><w:body>)/', '<w:body>', $xml
-                );
-                @$xmlDOM->loadXML($xml);
-                $xsl = new DOMDocument();
-                $xsl->load(dirname(__FILE__) . '/../xsl/docx2html.xsl');
-
-                $xsltProc = new XSLTProcessor();
-                
-                $xsltProc->importStylesheet($xsl);
-                $this->_xhtml = $xsltProc->transformToXML($xmlDOM);
-            }
-        }
-
-        $pattern = "'src\s*=\s*([\"\'])?(?(1) (.*?)\\1 | ([^\s\>]+))'isx";
-        preg_match_all($pattern, $this->_xhtml, $domImgs);
-
-        $idImgs = array();
-        foreach ($domImgs[0] as $dats) {
-            $datsFiltered = explode('"', $dats);
-            if (preg_match('/^\?image=rId/', $datsFiltered[1])) {
-                $datFiltered = explode('?image=', $dats);
-                $idImgs[] = substr($datFiltered[1], 0, -1);
-            }
-        }
-        $relationsImgs = simplexml_load_string(
-            $package->getFromName('word/_rels/document.xml.rels')
-        );
-        $pathImgs = array();
-        foreach ($relationsImgs->relationship as $relImg) {
-            if ($relImg["Type"] == cTransformDoc::SCHEMA_IMAGEDOCUMENT) {
-                $pathImgs[(string) $relImg["Id"]] =
-                    (string) $relImg["Target"];
-                $pathZip[] = 'word/' . (string) $relImg["Target"];
-            }
-        }
-
-        foreach ($idImgs as $datsIdImgs) {
-            $this->_xhtml = str_replace(
-                "src=\"?image=$datsIdImgs\"",
-                "src=\"files/files_" .
-                "$this->strFile/media/word/$pathImgs[$datsIdImgs]\"",
-                $this->_xhtml
-            );
-        }
-
-        if (!empty($pathZip)) {
-            $package->extractTo(
-                "files/files_$this->strFile/media", $pathZip
-            );
-            $package->close();
-        }
-    }
-
-    /**
-     * Convert DOCX to PDF, using dompdf. DOCX->XHTML->PDF
-     *
-     * @access public
-     */
-    public function generatePDF()
-    {
-        $this->generateXHTML();
-        $this->cleanXHTML();
-        try {
-            $domPDF = new DOMPDF();
-            $domPDF->load_html($this->_xhtml);
-            $domPDF->render();
-            $fileName = $this->getFileName() . '.pdf';
-            $domPDF->stream($fileName);
-        }
-        catch (Exception $err) {
-            echo 'Unable to generate PDF file. ';
-            echo $err;
-        }
-    }
-
-    /**
-     * Validate HTML using tidy
-     *
-     * @access public
-     */
-    public function validatorXHTML()
-    {
-        ob_start();
-        echo $this->_xhtml;
-        $html = ob_get_clean();
-        $config = array(
-            'indent' => true,
-            'output-xhtml' => true,
-            'wrap' => 200);
-        $tidy = new tidy();
-        $tidy->parseString($html, $config, 'utf8');
-        $tidy->cleanRepair();
-        $this->_xhtml = $tidy;
-    }
-
-}

+ 0 - 5
main/inc/lib/phpdocx/classes/conf/log4php.properties

@@ -1,5 +0,0 @@
-log4php.rootLogger = WARN, phpdocx_error
-
-log4php.appender.phpdocx_error = LoggerAppenderConsole
-log4php.appender.phpdocx_error.layout = LoggerLayoutPattern
-log4php.appender.phpdocx_error.layout.ConversionPattern = %d %p - %m%n

+ 0 - 626
main/inc/lib/phpdocx/lib/log4php/Logger.php

@@ -1,626 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * 
- *		http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * @package log4php
- */
-
-/**
- * LOG4PHP_DIR points to the log4php root directory.
- *
- * If not defined it will be set automatically when the first package classfile 
- * is included
- * 
- * @var string 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__));
-
-spl_autoload_register(array('Logger', 'autoload'));
-
-/**
- * This is the central class in the log4j package. Most logging operations, 
- * except configuration, are done through this class. 
- *
- * In log4j this class replaces the Category class. There is no need to 
- * port deprecated classes; log4php Logger class doesn't extend Category.
- *
- * @category   log4php
- * @package log4php
- * @license	   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
- * @version	   SVN: $Id: Logger.php 824193 2009-10-11 22:51:24Z chammers $
- * @link	   http://logging.apache.org/log4php
- */
- /*
-  * TODO:
-  * Localization: setResourceBundle($bundle) : not supported
-  * Localization: getResourceBundle: not supported
-  * Localization: getResourceBundleString($key): not supported
-  * Localization: l7dlog($priority, $key, $params, $t) : not supported
-  */
-class Logger {
-	private static $_classes = array(
-		'LoggerException' => '/LoggerException.php',
-		'LoggerHierarchy' => '/LoggerHierarchy.php',
-		'LoggerLayout' => '/LoggerLayout.php',
-		'LoggerLevel' => '/LoggerLevel.php',
-		'LoggerMDC' => '/LoggerMDC.php',
-		'LoggerNDC' => '/LoggerNDC.php',
-		'LoggerReflectionUtils' => '/LoggerReflectionUtils.php',
-		'LoggerConfigurator' => '/LoggerConfigurator.php',
-		'LoggerConfiguratorBasic' => '/configurators/LoggerConfiguratorBasic.php',
-		'LoggerConfiguratorIni' => '/configurators/LoggerConfiguratorIni.php',
-		'LoggerConfiguratorPhp' => '/configurators/LoggerConfiguratorPhp.php',
-		'LoggerConfiguratorXml' => '/configurators/LoggerConfiguratorXml.php',
-		'LoggerRoot' => '/LoggerRoot.php',
-		'LoggerAppender' => '/LoggerAppender.php',
-		'LoggerAppenderPool' => '/LoggerAppenderPool.php',
-		'LoggerAppenderAdodb' => '/appenders/LoggerAppenderAdodb.php',
-		'LoggerAppenderPDO' => '/appenders/LoggerAppenderPDO.php',
-		'LoggerAppenderConsole' => '/appenders/LoggerAppenderConsole.php',
-		'LoggerAppenderDailyFile' => '/appenders/LoggerAppenderDailyFile.php',
-		'LoggerAppenderEcho' => '/appenders/LoggerAppenderEcho.php',
-		'LoggerAppenderFile' => '/appenders/LoggerAppenderFile.php',
-		'LoggerAppenderMail' => '/appenders/LoggerAppenderMail.php',
-		'LoggerAppenderMailEvent' => '/appenders/LoggerAppenderMailEvent.php',
-		'LoggerAppenderNull' => '/appenders/LoggerAppenderNull.php',
-		'LoggerAppenderPhp' => '/appenders/LoggerAppenderPhp.php',
-		'LoggerAppenderRollingFile' => '/appenders/LoggerAppenderRollingFile.php',
-		'LoggerAppenderSocket' => '/appenders/LoggerAppenderSocket.php',
-		'LoggerAppenderSyslog' => '/appenders/LoggerAppenderSyslog.php',
-		'LoggerFormattingInfo' => '/helpers/LoggerFormattingInfo.php',
-		'LoggerOptionConverter' => '/helpers/LoggerOptionConverter.php',
-		'LoggerPatternConverter' => '/helpers/LoggerPatternConverter.php',
-		'LoggerBasicPatternConverter' => '/helpers/LoggerBasicPatternConverter.php',
-		'LoggerCategoryPatternConverter' => '/helpers/LoggerCategoryPatternConverter.php',
-		'LoggerClassNamePatternConverter' => '/helpers/LoggerClassNamePatternConverter.php',
-		'LoggerDatePatternConverter' => '/helpers/LoggerDatePatternConverter.php',
-		'LoggerLiteralPatternConverter' => '/helpers/LoggerLiteralPatternConverter.php',
-		'LoggerLocationPatternConverter' => '/helpers/LoggerLocationPatternConverter.php',
-		'LoggerMDCPatternConverter' => '/helpers/LoggerMDCPatternConverter.php',
-		'LoggerNamedPatternConverter' => '/helpers/LoggerNamedPatternConverter.php',
-		'LoggerBasicPatternConverter' => '/helpers/LoggerBasicPatternConverter.php',
-		'LoggerLiteralPatternConverter' => '/helpers/LoggerLiteralPatternConverter.php',
-		'LoggerDatePatternConverter' => '/helpers/LoggerDatePatternConverter.php',
-		'LoggerMDCPatternConverter' => '/helpers/LoggerMDCPatternConverter.php',
-		'LoggerLocationPatternConverter' => '/helpers/LoggerLocationPatternConverter.php',
-		'LoggerNamedPatternConverter' => '/helpers/LoggerNamedPatternConverter.php',
-		'LoggerClassNamePatternConverter' => '/helpers/LoggerClassNamePatternConverter.php',
-		'LoggerCategoryPatternConverter' => '/helpers/LoggerCategoryPatternConverter.php',
-		'LoggerPatternParser' => '/helpers/LoggerPatternParser.php',
-		'LoggerLayoutHtml' => '/layouts/LoggerLayoutHtml.php',
-		'LoggerLayoutSimple' => '/layouts/LoggerLayoutSimple.php',
-		'LoggerLayoutTTCC' => '/layouts/LoggerLayoutTTCC.php',
-		'LoggerLayoutPattern' => '/layouts/LoggerLayoutPattern.php',
-		'LoggerLayoutXml' => '/layouts/LoggerLayoutXml.php',
-		'LoggerRendererDefault' => '/renderers/LoggerRendererDefault.php',
-		'LoggerRendererObject' => '/renderers/LoggerRendererObject.php',
-		'LoggerRendererMap' => '/renderers/LoggerRendererMap.php',
-		'LoggerLocationInfo' => '/LoggerLocationInfo.php',
-		'LoggerLoggingEvent' => '/LoggerLoggingEvent.php',
-		'LoggerFilter' => '/LoggerFilter.php',
-		'LoggerFilterDenyAll' => '/filters/LoggerFilterDenyAll.php',
-		'LoggerFilterLevelMatch' => '/filters/LoggerFilterLevelMatch.php',
-		'LoggerFilterLevelRange' => '/filters/LoggerFilterLevelRange.php',
-		'LoggerFilterStringMatch' => '/filters/LoggerFilterStringMatch.php',
-	);
-
-	/**
-	 * Class autoloader
-	 * This method is provided to be invoked within an __autoload() magic method.
-	 * @param string class name
-	 */
-	public static function autoload($className) {
-		if(isset(self::$_classes[$className])) {
-			include LOG4PHP_DIR.self::$_classes[$className];
-		}
-	}
-
-	/**
-	 * Additivity is set to true by default, that is children inherit the 
-	 * appenders of their ancestors by default.
-	 * @var boolean
-	 */
-	private $additive = true;
-	
-	/** @var string fully qualified class name */
-	private $fqcn = 'Logger';
-
-	/** @var LoggerLevel The assigned level of this category. */
-	private $level = null;
-	
-	/** @var string name of this category. */
-	private $name = '';
-	
-	/** @var Logger The parent of this category. Null if this is the root logger*/
-	private $parent = null;
-	
-	/**
-	 * @var array collection of appenders
-	 * @see LoggerAppender
-	 */
-	private $aai = array();
-
-	/** the hierarchy used by log4php */
-	private static $hierarchy;
-	
-	/** the configurator class name */
-	private static $configurationClass = 'LoggerConfiguratorBasic';
-	
-	/** the path to the configuration file */
-	private static $configurationFile = null;
-	
-	/** inidicates if log4php has already been initialized */
-	private static $initialized = false;
-	
-	/**
-	 * Constructor.
-	 * @param  string  $name  Category name	  
-	 */
-	public function __construct($name) {
-		$this->name = $name;
-	}
-	
-	/**
-	 * Return the category name.
-	 * @return string
-	 */
-	public function getName() {
-		return $this->name;
-	} 
-
-	/**
-	 * Returns the parent of this category.
-	 * @return Logger
-	 */
-	public function getParent() {
-		return $this->parent;
-	}	  
-	
-	/**
-	 * Returns the hierarchy used by this Logger.
-	 * Caution: do not use this hierarchy unless you have called initialize().
-	 * To get Loggers, use the Logger::getLogger and Logger::getRootLogger methods
-	 * instead of operating on on the hierarchy directly.
-	 * 
-	 * @deprecated - will be moved to private
-	 * @return LoggerHierarchy
-	 */
-	public static function getHierarchy() {
-		if(!isset(self::$hierarchy)) {
-			self::$hierarchy = new LoggerHierarchy(new LoggerRoot());
-		}
-		return self::$hierarchy;
-	}
-	
-	/* Logging methods */
-	/**
-	 * Log a message object with the DEBUG level including the caller.
-	 *
-	 * @param mixed $message message
-	 * @param mixed $caller caller object or caller string id
-	 */
-	public function debug($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelDebug(), $caller);
-	} 
-
-
-	/**
-	 * Log a message object with the INFO Level.
-	 *
-	 * @param mixed $message message
-	 * @param mixed $caller caller object or caller string id
-	 */
-	public function info($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelInfo(), $caller);
-	}
-
-	/**
-	 * Log a message with the WARN level.
-	 *
-	 * @param mixed $message message
-	 * @param mixed $caller caller object or caller string id
-	 */
-	public function warn($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelWarn(), $caller);
-	}
-	
-	/**
-	 * Log a message object with the ERROR level including the caller.
-	 *
-	 * @param mixed $message message
-	 * @param mixed $caller caller object or caller string id
-	 */
-	public function error($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelError(), $caller);
-	}
-	
-	/**
-	 * Log a message object with the FATAL level including the caller.
-	 *
-	 * @param mixed $message message
-	 * @param mixed $caller caller object or caller string id
-	 */
-	public function fatal($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelFatal(), $caller);
-	}
-	
-	/**
-	 * This method creates a new logging event and logs the event without further checks.
-	 *
-	 * It should not be called directly. Use {@link info()}, {@link debug()}, {@link warn()},
-	 * {@link error()} and {@link fatal()} wrappers.
-	 *
-	 * @param string $fqcn Fully Qualified Class Name of the Logger
-	 * @param mixed $caller caller object or caller string id
-	 * @param LoggerLevel $level log level	   
-	 * @param mixed $message message
-	 * @see LoggerLoggingEvent			
-	 */
-	public function forcedLog($fqcn, $caller, $level, $message) {
-		$this->callAppenders(new LoggerLoggingEvent($fqcn, $this, $level, $message));
-	} 
-	
-	
-		/**
-	 * Check whether this category is enabled for the DEBUG Level.
-	 * @return boolean
-	 */
-	public function isDebugEnabled() {
-		return $this->isEnabledFor(LoggerLevel::getLevelDebug());
-	}		
-
-	/**
-	 * Check whether this category is enabled for a given Level passed as parameter.
-	 *
-	 * @param LoggerLevel level
-	 * @return boolean
-	 */
-	public function isEnabledFor($level) {
-		return (bool)($level->isGreaterOrEqual($this->getEffectiveLevel()));
-	} 
-
-	/**
-	 * Check whether this category is enabled for the info Level.
-	 * @return boolean
-	 * @see LoggerLevel
-	 */
-	public function isInfoEnabled() {
-		return $this->isEnabledFor(LoggerLevel::getLevelInfo());
-	} 
-
-	/**
-	 * This generic form is intended to be used by wrappers.
-	 *
-	 * @param LoggerLevel $priority a valid level
-	 * @param mixed $message message
-	 * @param mixed $caller caller object or caller string id
-	 */
-	public function log($priority, $message, $caller = null) {
-		if($this->isEnabledFor($priority)) {
-			$this->forcedLog($this->fqcn, $caller, $priority, $message);
-		}
-	}
-	
-	/**
-	 * If assertion parameter is false, then logs msg as an error statement.
-	 *
-	 * @param bool $assertion
-	 * @param string $msg message to log
-	 */
-	public function assertLog($assertion = true, $msg = '') {
-		if($assertion == false) {
-			$this->error($msg);
-		}
-	}
-	 
-	private function logLevel($message, $level, $caller = null) {
-		if($level->isGreaterOrEqual($this->getEffectiveLevel())) {
-			$this->forcedLog($this->fqcn, $caller, $level, $message);
-		}
-	} 
-	
-	/* Factory methods */ 
-	
-	/**
-	 * Get a Logger by name (Delegate to {@link Logger})
-	 * 
-	 * @param string $name logger name
-	 * @param LoggerFactory $factory a {@link LoggerFactory} instance or null
-	 * @return Logger
-	 * @static 
-	 */
-	public static function getLogger($name) {
-		if(!self::isInitialized()) {
-			self::initialize();
-		}
-		return self::getHierarchy()->getLogger($name);
-	}
-	
-	/**
-	 * get the Root Logger (Delegate to {@link Logger})
-	 * @return LoggerRoot
-	 * @static 
-	 */	   
-	public static function getRootLogger() {
-		if(!self::isInitialized()) {
-			self::initialize();
-		}
-		return self::getHierarchy()->getRootLogger();	  
-	}
-	
-	/* Configuration methods */
-	
-	/**
-	 * Add a new Appender to the list of appenders of this Category instance.
-	 *
-	 * @param LoggerAppender $newAppender
-	 */
-	public function addAppender($newAppender) {
-		$appenderName = $newAppender->getName();
-		$this->aai[$appenderName] = $newAppender;
-	}
-	
-	/**
-	 * Remove all previously added appenders from this Category instance.
-	 */
-	public function removeAllAppenders() {
-		$appenderNames = array_keys($this->aai);
-		$enumAppenders = count($appenderNames);
-		for($i = 0; $i < $enumAppenders; $i++) {
-			$this->removeAppender($appenderNames[$i]); 
-		}
-	} 
-			
-	/**
-	 * Remove the appender passed as parameter form the list of appenders.
-	 *
-	 * @param mixed $appender can be an appender name or a {@link LoggerAppender} object
-	 */
-	public function removeAppender($appender) {
-		if($appender instanceof LoggerAppender) {
-			$appender->close();
-			unset($this->aai[$appender->getName()]);
-		} else if (is_string($appender) and isset($this->aai[$appender])) {
-			$this->aai[$appender]->close();
-			unset($this->aai[$appender]);
-		}
-	} 
-			
-	/**
-	 * Call the appenders in the hierarchy starting at this.
-	 *
-	 * @param LoggerLoggingEvent $event 
-	 */
-	public function callAppenders($event) {
-		if(count($this->aai) > 0) {
-			foreach(array_keys($this->aai) as $appenderName) {
-				$this->aai[$appenderName]->doAppend($event);
-			}
-		}
-		if($this->parent != null and $this->getAdditivity()) {
-			$this->parent->callAppenders($event);
-		}
-	}
-	
-	/**
-	 * Get the appenders contained in this category as an array.
-	 * @return array collection of appenders
-	 */
-	public function getAllAppenders() {
-		return array_values($this->aai);
-	}
-	
-	/**
-	 * Look for the appender named as name.
-	 * @return LoggerAppender
-	 */
-	public function getAppender($name) {
-		return $this->aai[$name];
-	}
-	
-	/**
-	 * Get the additivity flag for this Category instance.
-	 * @return boolean
-	 */
-	public function getAdditivity() {
-		return $this->additive;
-	}
- 
-	/**
-	 * Starting from this category, search the category hierarchy for a non-null level and return it.
-	 * @see LoggerLevel
-	 * @return LoggerLevel or null
-	 */
-	public function getEffectiveLevel() {
-		for($c = $this; $c != null; $c = $c->parent) {
-			if($c->getLevel() !== null) {
-				return $c->getLevel();
-			}
-		}
-		return null;
-	}
-  
-	/**
-	 * Returns the assigned Level, if any, for this Category.
-	 * @return LoggerLevel or null 
-	 */
-	public function getLevel() {
-		return $this->level;
-	}
-	
-	/**
-	 * Set the level of this Category.
-	 *
-	 * @param LoggerLevel $level a level string or a level constant 
-	 */
-	public function setLevel($level) {
-		$this->level = $level;
-	}
-	
-	/**
-	 * Clears all logger definitions
-	 * 
-	 * @static
-	 * @return boolean 
-	 */
-	public static function clear() {
-		return self::getHierarchy()->clear();	 
-	}
-	
-	/**
-	 * Destroy configurations for logger definitions
-	 * 
-	 * @static
-	 * @return boolean 
-	 */
-	public static function resetConfiguration() {
-		$result = self::getHierarchy()->resetConfiguration();
-		self::$initialized = false;
-		self::$configurationClass = 'LoggerConfiguratorBasic';
-		self::$configurationFile = null;
-		return $result;	 
-	}
-
-	/**
-	 * Safely close all appenders.
-	 * This is not longer necessary due the appenders shutdown via
-	 * destructors. 
-	 * @deprecated
-	 * @static
-	 */
-	public static function shutdown() {
-		return self::getHierarchy()->shutdown();	   
-	}
-	
-	/**
-	 * check if a given logger exists.
-	 * 
-	 * @param string $name logger name 
-	 * @static
-	 * @return boolean
-	 */
-	public static function exists($name) {
-		return self::getHierarchy()->exists($name);
-	}
-	
-	/**
-	 * Returns an array this whole Logger instances.
-	 * 
-	 * @static
-	 * @see Logger
-	 * @return array
-	 */
-	public static function getCurrentLoggers() {
-		return self::getHierarchy()->getCurrentLoggers();
-	}
-	
-	/**
-	 * Is the appender passed as parameter attached to this category?
-	 *
-	 * @param LoggerAppender $appender
-	 */
-	public function isAttached($appender) {
-		return isset($this->aai[$appender->getName()]);
-	} 
-		   
-	/**
-	 * Set the additivity flag for this Category instance.
-	 *
-	 * @param boolean $additive
-	 */
-	public function setAdditivity($additive) {
-		$this->additive = (bool)$additive;
-	}
-
-	/**
-	 * Sets the parent logger of this logger
-	 */
-	public function setParent(Logger $logger) {
-		$this->parent = $logger;
-	} 
-	
-	/**
-	 * Configures Log4PHP.
-	 * This method needs to be called before the first logging event
-	 * has occured. If this methode is never called, the standard configuration
-	 * takes place (@see LoggerConfiguratorBasic).
-	 * If only the configuration file is given, the configurator class will
-	 * be the XML Configurator or the INI Configurator, if no .xml ending
-	 * could be determined.
-	 * 
-	 * If a custom configurator should be used, the configuration file
-	 * is either null or the path to file the custom configurator uses.
-	 * Make sure the configurator is already or can be loaded by PHP when necessary.
-	 * 
-	 * @param String $configurationFile the configuration file
-	 * @param String $configurationClass the configurator class
-	 */
-	public static function configure($configurationFile = null, 
-									 $configurationClass = null ) {
-		if($configurationClass === null && $configurationFile === null) {
-			self::$configurationClass = 'LoggerConfiguratorBasic';
-			return;
-		}
-									 	
-		if($configurationClass !== null) {
-			self::$configurationFile = $configurationFile;
-			self::$configurationClass = $configurationClass;
-			return;
-		}
-		
-		if (strtolower(substr( $configurationFile, -4 )) == '.xml') {
-			self::$configurationFile = $configurationFile;
-			self::$configurationClass = 'LoggerConfiguratorXml';
-		} else {
-			self::$configurationFile = $configurationFile;
-			self::$configurationClass = 'LoggerConfiguratorIni';
-		}
-	}
-	
-	/**
-	 * Returns the current configurator
-	 * @return the configurator
-	 */
-	public static function getConfigurationClass() {
-		return self::$configurationClass;
-	}
-	
-	/**
-	 * Returns the current configuration file
-	 * @return the configuration file
-	 */
-	public static function getConfigurationFile() {
-		return self::$configurationFile;
-	}
-	
-	/**
-	 * Returns, true, if the log4php framework is already initialized
-	 */
-	private static function isInitialized() {
-		return self::$initialized;
-	}
-	
-	/**
-	 * Initializes the log4php framework.
-	 * @return boolean
-	 */
-	public static function initialize() {
-		self::$initialized = true;
-		$instance = LoggerReflectionUtils::createObject(self::$configurationClass);
-		$result = $instance->configure(self::getHierarchy(), self::$configurationFile);
-		return $result;
-	}
-}

+ 0 - 261
main/inc/lib/phpdocx/lib/log4php/LoggerAppender.php

@@ -1,261 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Abstract class that defines output logs strategies.
- *
- * @version $Revision: 822392 $
- * @package log4php
- */
-abstract class LoggerAppender {
-	
-	/**
-	 * @var boolean closed appender flag
-	 */
-	protected $closed = false;
-	
-	/**
-	 * The first filter in the filter chain
-	 * @var LoggerFilter
-	 */
-	protected $filter = null;
-			
-	/**
-	 * LoggerLayout for this appender. It can be null if appender has its own layout
-	 * @var LoggerLayout
-	 */
-	protected $layout = null; 
-		   
-	/**
-	 * @var string Appender name
-	 */
-	protected $name;
-		   
-	/**
-	 * @var LoggerLevel There is no level threshold filtering by default.
-	 */
-	protected $threshold = null;
-	
-	/**
-	 * @var boolean needs a layout formatting ?
-	 */
-	protected $requiresLayout = false;
-	
-	/**
-	 * Constructor
-	 *
-	 * @param string $name appender name
-	 */
-	public function __construct($name = '') {
-		$this->name = $name;
-	}
-
-	/**
-	 * Add a filter to the end of the filter list.
-	 *
-	 * @param LoggerFilter $newFilter add a new LoggerFilter
-	 */
-	public function addFilter($newFilter) {
-		if($this->filter === null) {
-			$this->filter = $newFilter;
-		} else {
-			$this->filter->addNext($newFilter);
-		}
-	}
-	
-	/**
-	 * Clear the list of filters by removing all the filters in it.
-	 * @abstract
-	 */
-	public function clearFilters() {
-		unset($this->filter);
-		$this->filter = null;
-	}
-
-	/**
-	 * Return the first filter in the filter chain for this Appender. 
-	 * The return value may be <i>null</i> if no is filter is set.
-	 * @return LoggerFilter
-	 */
-	public function getFilter() {
-		return $this->filter;
-	} 
-	
-	/** 
-	 * Return the first filter in the filter chain for this Appender. 
-	 * The return value may be <i>null</i> if no is filter is set.
-	 * @return LoggerFilter
-	 */
-	public function getFirstFilter() {
-		return $this->filter;
-	}
-	
-	
-	/**
-	 * This method performs threshold checks and invokes filters before
-	 * delegating actual logging to the subclasses specific <i>append()</i> method.
-	 * @see LoggerAppender::doAppend()
-	 * @param LoggerLoggingEvent $event
-	 */
-	public function doAppend(LoggerLoggingEvent $event) {
-		if($this->closed) {
-			return;
-		}
-		
-		if(!$this->isAsSevereAsThreshold($event->getLevel())) {
-			return;
-		}
-
-		$f = $this->getFirstFilter();
-		while($f !== null) {
-			switch ($f->decide($event)) {
-				case LoggerFilter::DENY: return;
-				case LoggerFilter::ACCEPT: return $this->append($event);
-				case LoggerFilter::NEUTRAL: $f = $f->getNext();
-			}
-		}
-		$this->append($event);	  
-	}	 
-
-	/**
-	 * Set the Layout for this appender.
-	 * @see LoggerAppender::setLayout()
-	 * @param LoggerLayout $layout
-	 */
-	public function setLayout($layout) {
-		if($this->requiresLayout()) {
-			$this->layout = $layout;
-		}
-	} 
-	
-	/**
-	 * Returns this appender layout.
-	 * @see LoggerAppender::getLayout()
-	 * @return LoggerLayout
-	 */
-	public function getLayout() {
-		return $this->layout;
-	}
-	
-	/**
-	 * Configurators call this method to determine if the appender
-	 * requires a layout. 
-	 *
-	 * <p>If this method returns <i>true</i>, meaning that layout is required, 
-	 * then the configurator will configure a layout using the configuration 
-	 * information at its disposal.	 If this method returns <i>false</i>, 
-	 * meaning that a layout is not required, then layout configuration will be
-	 * skipped even if there is available layout configuration
-	 * information at the disposal of the configurator.</p>
-	 *
-	 * <p>In the rather exceptional case, where the appender
-	 * implementation admits a layout but can also work without it, then
-	 * the appender should return <i>true</i>.</p>
-	 * 
-	 * @see LoggerAppender::requiresLayout()
-	 * @return boolean
-	 */
-	public function requiresLayout() {
-		return $this->requiresLayout;
-	}
-	
-	/**
-	 * Get the name of this appender.
-	 * @see LoggerAppender::getName()
-	 * @return string
-	 */
-	public function getName() {
-		return $this->name;
-	}
-	
-/**
-	 * Set the name of this appender.
-	 *
-	 * The name is used by other components to identify this appender.
-	 *
-	 * 
-	 * @param string $name
-	 */
-	public function setName($name) {
-		$this->name = $name;	
-	}
-	
-	/**
-	 * Returns this appenders threshold level. 
-	 * See the {@link setThreshold()} method for the meaning of this option.
-	 * @return LoggerLevel
-	 */
-	public function getThreshold() { 
-		return $this->threshold;
-	}
-	
-	/**
-	 * Set the threshold level of this appender.
-	 *
-	 * @param mixed $threshold can be a {@link LoggerLevel} object or a string.
-	 * @see LoggerOptionConverter::toLevel()
-	 */
-	public function setThreshold($threshold) {
-		if(is_string($threshold)) {
-		   $this->threshold = LoggerOptionConverter::toLevel($threshold, null);
-		} else if($threshold instanceof LoggerLevel) {
-		   $this->threshold = $threshold;
-		}
-	}
-	
-	/**
-	 * Check whether the message level is below the appender's threshold. 
-	 *
-	 *
-	 * If there is no threshold set, then the return value is always <i>true</i>.
-	 * @param LoggerLevel $level
-	 * @return boolean true if priority is greater or equal than threshold	
-	 */
-	public function isAsSevereAsThreshold($level) {
-		if($this->threshold === null) {
-			return true;
-		}
-		return $level->isGreaterOrEqual($this->getThreshold());
-	}
-
-	/**
-	 * Derived appenders should override this method if option structure
-	 * requires it.
-	 */
-	abstract public function activateOptions();	   
-	
-	/**
-	 * Subclasses of {@link LoggerAppender} should implement 
-	 * this method to perform actual logging.
-	 *
-	 * @param LoggerLoggingEvent $event
-	 * @see doAppend()
-	 * @abstract
-	 */
-	abstract protected function append(LoggerLoggingEvent $event); 
-
-	/**
-	 * Release any resources allocated.
-	 * Subclasses of {@link LoggerAppender} should implement 
-	 * this method to perform proper closing procedures.
-	 * @abstract
-	 */
-	abstract public function close();
-}

+ 0 - 55
main/inc/lib/phpdocx/lib/log4php/LoggerAppenderPool.php

@@ -1,55 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Pool implmentation for LoggerAppender instances
- *
- * @version $Revision: 795727 $
- * @package log4php
- */
-class LoggerAppenderPool {
-	/* Appender Pool */
-	public static $appenderPool =  null;
-	
-	/**
-	 * 
-	 *
-	 * @param string $name 
-	 * @param string $class 
-	 * @return LoggerAppender
-	 */
-	public static function getAppenderFromPool($name, $class = '') {
-		if(isset(self::$appenderPool[$name])) {
-			return self::$appenderPool[$name];
-		}
-		
-		if(empty($class)) {
-			return null;
-		}
-		
-		$appender = LoggerReflectionUtils::createObject($class);
-		$appender->setName($name);
-		if($appender !== null) { 
-			self::$appenderPool[$name] = $appender;
-			return self::$appenderPool[$name];
-		}
-		return null;		
-	}
-}

+ 0 - 53
main/inc/lib/phpdocx/lib/log4php/LoggerConfigurator.php

@@ -1,53 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Implemented by classes capable of configuring log4php using a URL.
- *	
- * @version $Revision: 822448 $
- * @package log4php
- */
-interface LoggerConfigurator {
-	
-	/**
-	 * Special level value signifying inherited behaviour. The current
-	 * value of this string constant is <b>inherited</b>. 
-	 * {@link CONFIGURATOR_NULL} is a synonym.  
-	 */
-	const CONFIGURATOR_INHERITED = 'inherited';
-	
-	/**
-	 * Special level signifying inherited behaviour, same as 
-	 * {@link CONFIGURATOR_INHERITED}. 
-	 * The current value of this string constant is <b>null</b>. 
-	 */
-	const CONFIGURATOR_NULL = 'null';
-		
-	/**
-	 * Interpret a resource pointed by a <var>url</var> and configure accordingly.
-	 *
-	 * The configuration is done relative to the <var>repository</var>
-	 * parameter.
-	 *
-	 * @param string $url The URL to parse
-	 */
-	public function configure(LoggerHierarchy $hierarchy, $url = null);
-	
-}

+ 0 - 28
main/inc/lib/phpdocx/lib/log4php/LoggerException.php

@@ -1,28 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * LoggerException class
- *
- * @version $Revision: 771547 $
- * @package log4php
- */
-class LoggerException extends Exception {
-}

+ 0 - 126
main/inc/lib/phpdocx/lib/log4php/LoggerFilter.php

@@ -1,126 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Users should extend this class to implement customized logging
- * event filtering. Note that {@link LoggerCategory} and {@link LoggerAppender}, 
- * the parent class of all standard
- * appenders, have built-in filtering rules. It is suggested that you
- * first use and understand the built-in rules before rushing to write
- * your own custom filters.
- * 
- * <p>This abstract class assumes and also imposes that filters be
- * organized in a linear chain. The {@link #decide
- * decide(LoggerLoggingEvent)} method of each filter is called sequentially,
- * in the order of their addition to the chain.
- * 
- * <p>The {@link decide()} method must return one
- * of the integer constants {@link LoggerFilter::DENY}, 
- * {@link LoggerFilter::NEUTRAL} or {@link LoggerFilter::ACCEPT}.
- * 
- * <p>If the value {@link LoggerFilter::DENY} is returned, then the log event is
- * dropped immediately without consulting with the remaining
- * filters. 
- * 
- * <p>If the value {@link LoggerFilter::NEUTRAL} is returned, then the next filter
- * in the chain is consulted. If there are no more filters in the
- * chain, then the log event is logged. Thus, in the presence of no
- * filters, the default behaviour is to log all logging events.
- * 
- * <p>If the value {@link LoggerFilter::ACCEPT} is returned, then the log
- * event is logged without consulting the remaining filters. 
- * 
- * <p>The philosophy of log4php filters is largely inspired from the
- * Linux ipchains. 
- * 
- * @version $Revision: 822448 $
- * @package log4php
- */
-abstract class LoggerFilter {
-
-	/**
-	 * The log event must be logged immediately without consulting with
-	 * the remaining filters, if any, in the chain.	 
-	 */
-	const ACCEPT = 1;
-	
-	/**
-	 * This filter is neutral with respect to the log event. The
-	 * remaining filters, if any, should be consulted for a final decision.
-	 */
-	const NEUTRAL = 0;
-	
-	/**
-	 * The log event must be dropped immediately without consulting
-	 * with the remaining filters, if any, in the chain.  
-	 */
-	const DENY = -1;
-
-	/**
-	 * @var LoggerFilter Points to the next {@link LoggerFilter} in the filter chain.
-	 */
-	protected $next;
-
-	/**
-	 * Usually filters options become active when set. We provide a
-	 * default do-nothing implementation for convenience.
-	*/
-	public function activateOptions() {
-	}
-
-	/**	  
-	 * Decide what to do.  
-	 * <p>If the decision is {@link LoggerFilter::DENY}, then the event will be
-	 * dropped. If the decision is {@link LoggerFilter::NEUTRAL}, then the next
-	 * filter, if any, will be invoked. If the decision is {@link LoggerFilter::ACCEPT} then
-	 * the event will be logged without consulting with other filters in
-	 * the chain.
-	 *
-	 * @param LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to decide upon.
-	 * @return integer {@link LoggerFilter::NEUTRAL} or {@link LoggerFilter::DENY}|{@link LoggerFilter::ACCEPT}
-	 */
-	public function decide(LoggerLoggingEvent $event) {
-		return self::NEUTRAL;
-	}
-
-	/**
-	 * Adds a new filter to the filter chain this filter is a part of.
-	 * If this filter has already and follow up filter, the param filter
-	 * is passed on until it is the last filter in chain.
-	 * 
-	 * @param $filter - the filter to add to this chain
-	 */
-	public function addNext($filter) {
-		if($this->next !== null) {
-		    $this->next->addNext($filter);
-		} else {
-		    $this->next = $filter;
-		}
-	}
-	
-	/**
-	 * Returns the next filter in this chain
-	 * @return the next filter
-	 */
-	public function getNext() {
-		return $this->next;
-	}
-
-}

+ 0 - 245
main/inc/lib/phpdocx/lib/log4php/LoggerHierarchy.php

@@ -1,245 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * This class is specialized in retrieving loggers by name and also maintaining 
- * the logger hierarchy. The logger hierarchy is dealing with the several Log-Levels
- * Logger can have. From log4j website:
- * 
- * "A logger is said to be an ancestor of another logger if its name followed 
- * by a dot is a prefix of the descendant logger name. A logger is said to be
- * a parent of a child logger if there are no ancestors between itself and the 
- * descendant logger."
- * 
- * Child Loggers do inherit their Log-Levels from their Ancestors. They can
- * increase their Log-Level compared to their Ancestors, but they cannot decrease it.
- * 
- * <p>The casual user does not have to deal with this class directly.</p>
- *
- * <p>The structure of the logger hierarchy is maintained by the
- * getLogger method. The hierarchy is such that children link
- * to their parent but parents do not have any pointers to their
- * children. Moreover, loggers can be instantiated in any order, in
- * particular descendant before ancestor.</p>
- *
- * <p>In case a descendant is created before a particular ancestor,
- * then it creates a provision node for the ancestor and adds itself
- * to the provision node. Other descendants of the same ancestor add
- * themselves to the previously created provision node.</p>
- *
- * @version $Revision: 822448 $
- * @package log4php
- */
- /*
-  * TODO:
-  * - addHierarchyEventListener($listener) not supported
-  * - emitNoAppenderWarning($cat) not supported
-  * - fireAddAppenderEvent not supported
-  */
-class LoggerHierarchy {
-	/** Default Factory  */
-	protected $defaultFactory;
-	
-	/** array hierarchy tree. saves here all loggers */
-	protected $ht = array();
-	
-	/** The root Logger */
-	protected $root = null;
-	
-	/** LoggerRendererMap */
-	protected $rendererMap;
-
-	/** LoggerLevel main level threshold */
-	protected $threshold;
-	
-	/**
-	 * Create a new logger hierarchy.
-	 * @param object $root the root logger
-	 */
-	public function __construct(LoggerRoot $root) {
-		$this->root = $root;
-		$this->setThreshold(LoggerLevel::getLevelAll());
-		$this->rendererMap = new LoggerRendererMap();
-	}
-	 
-	/**
-	 * This call will clear all logger definitions from the internal hashtable.
-	 */
-	public function clear() {
-		$this->ht = array();
-	}
-	  
-	/**
-	 * Check if the named logger exists in the hierarchy.
-	 * @param string $name
-	 * @return boolean
-	 */
-	public function exists($name) {
-		return isset($this->ht[$name]);
-	}
-
-	/**
-	 * Returns all the currently defined categories in this hierarchy as an array.
-	 * @return array
-	 */	 
-	public function getCurrentLoggers() {
-		return array_values($this->ht);
-	}
-	
-	/**
-	 * Return a new logger instance named as the first parameter using the default factory.
-	 * 
-	 * @param string $name logger name
-	 * @param LoggerFactory $factory a {@link LoggerFactory} instance or null	  
-	 * @return Logger
-	 */
-	public function getLogger($name) {
-		if(!isset($this->ht[$name])) {
-			$this->ht[$name] = new Logger($name);;
-			// TODO: isn't necessary, access via singleton?
-			// $this->ht[$name]->setHierarchy($this);
-			$nodes = explode('.', $name);
-			$firstNode = array_shift($nodes);
-			
-			// if name is not a first node but another first node is their
-			if($firstNode != $name and isset($this->ht[$firstNode])) {
-				$this->ht[$name]->setParent($this->ht[$firstNode]);
-			} else {
-				// if there is no father, set root logger as father
-				$this->ht[$name]->setParent($this->root);
-			} 
-		
-			// if there are more nodes than one
-			if(count($nodes) > 0) {
-				// find parent node
-				foreach($nodes as $node) {
-					$parentNode = "$firstNode.$node";
-					if(isset($this->ht[$parentNode]) and $parentNode != $name) {
-		
-						$this->ht[$name]->setParent($this->ht[$parentNode]);
-					}
-					$firstNode .= ".$node";
-				}
-			}
-		}		
-		
-		return $this->ht[$name];
-	} 
-	
-	/**
-	 * @return LoggerRendererMap Get the renderer map for this hierarchy.
-	 */
-	public function getRendererMap() {
-		return $this->rendererMap;
-	}
-	
-	/**
-	 * @return LoggerRoot Get the root of this hierarchy.
-	 */ 
-	public function getRootLogger() {
-		if(!isset($this->root) or $this->root == null) {
-			$this->root = new LoggerRoot();
-		}
-		return $this->root;
-	}
-	 
-	/**
-	 * @return LoggerLevel Returns the threshold Level.
-	 */
-	public function getThreshold() {
-		return $this->threshold;
-	} 
-
-	/**
-	 * This method will return true if this repository is disabled 
-	 * for level object passed as parameter and false otherwise.
-	 * @return boolean
-	 */
-	public function isDisabled(LoggerLevel $level) {
-		return ($this->threshold->toInt() > $level->toInt());
-	}
-	
-	/**
-	 * Reset all values contained in this hierarchy instance to their
-	 * default. 
-	 *
-	 * This removes all appenders from all categories, sets
-	 * the level of all non-root categories to <i>null</i>,
-	 * sets their additivity flag to <i>true</i> and sets the level
-	 * of the root logger to {@link LOGGER_LEVEL_DEBUG}.  Moreover,
-	 * message disabling is set its default "off" value.
-	 * 
-	 * <p>Existing categories are not removed. They are just reset.
-	 *
-	 * <p>This method should be used sparingly and with care as it will
-	 * block all logging until it is completed.</p>
-	 */
-	public function resetConfiguration() {
-		$root = $this->getRootLogger();
-		
-		$root->setLevel(LoggerLevel::getLevelDebug());
-		$this->setThreshold(LoggerLevel::getLevelAll());
-		$this->shutDown();
-		$loggers = $this->getCurrentLoggers();
-		$enumLoggers = count($loggers);
-		for($i = 0; $i < $enumLoggers; $i++) {
-			$loggers[$i]->setLevel(null);
-			$loggers[$i]->setAdditivity(true);
-			$loggers[$i]->removeAllAppenders();
-		}
-		$this->rendererMap->clear();
-	}
-	
-	/**
-	 * set a new threshold level
-	 *
-	 * @param LoggerLevel $l
-	 */
-	public function setThreshold(LoggerLevel $l) {
-		if($l !== null) {
-			$this->threshold = $l;
-		}
-	}
-	
-	/**
-	 * Shutting down a hierarchy will <i>safely</i> close and remove
-	 * all appenders in all categories including the root logger.
-	 * 
-	 * <p>Some appenders such as {@link LoggerSocketAppender}
-	 * need to be closed before the
-	 * application exists. Otherwise, pending logging events might be
-	 * lost.
-	 * 
-	 * <p>The shutdown method is careful to close nested
-	 * appenders before closing regular appenders. This is allows
-	 * configurations where a regular appender is attached to a logger
-	 * and again to a nested appender.
-	 */
-	public function shutdown() {
-		$this->root->removeAllAppenders();
-		$cats = $this->getCurrentLoggers();
-		$enumCats = count($cats);		  
-		if($enumCats > 0) {
-			for($i = 0; $i < $enumCats; $i++) {
-				$cats[$i]->removeAllAppenders();
-			}
-		}
-	}
-} 

+ 0 - 70
main/inc/lib/phpdocx/lib/log4php/LoggerLayout.php

@@ -1,70 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Extend this abstract class to create your own log layout format.
- *	
- * @version $Revision: 822415 $
- * @package log4php
- * @abstract
- */
-abstract class LoggerLayout {
-	/**
-	 * Activates options for this layout.
-	 * Override this method if you have options to be activated.
-	 */
-	public function activateOptions() {
-		return true;
-	}
-
-	/**
-	 * Override this method to create your own layout format.
-	 *
-	 * @param LoggerLoggingEvent
-	 * @return string
-	 */
-	public function format(LoggerLoggingEvent $event) {
-		return $event->getRenderedMessage();
-	} 
-	
-	/**
-	 * Returns the content type output by this layout.
-	 * @return string
-	 */
-	public function getContentType() {
-		return "text/plain";
-	} 
-			
-	/**
-	 * Returns the footer for the layout format.
-	 * @return string
-	 */
-	public function getFooter() {
-		return null;
-	} 
-
-	/**
-	 * Returns the header for the layout format.
-	 * @return string
-	 */
-	public function getHeader() {
-		return null;
-	}
-}

+ 0 - 256
main/inc/lib/phpdocx/lib/log4php/LoggerLevel.php

@@ -1,256 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Defines the minimum set of levels recognized by the system, that is
- * <i>OFF</i>, <i>FATAL</i>, <i>ERROR</i>,
- * <i>WARN</i>, <i>INFO</i>, <i>DEBUG</i> and
- * <i>ALL</i>.
- *
- * <p>The <i>LoggerLevel</i> class may be subclassed to define a larger
- * level set.</p>
- *
- * @version $Revision: 884719 $
- * @package log4php
- * @since 0.5
- */
-class LoggerLevel {
-	
-	const OFF = 2147483647;
-	const FATAL = 50000;
-	const ERROR = 40000;
-	const WARN = 30000;
-	const INFO = 20000;
-	const DEBUG = 10000;
-	const ALL = -2147483647;
-
-	/**
-	 * TODO: check if still necessary or to be refactored 
-	 * @var integer
-	 */
-	private $level;
-  
-  	/**
-   	 * Contains a list of instantiated levels 
-   	 */
-  	private static $levelMap;
-  	
-	/**
-	 * @var string
-	 */
-	private $levelStr;
-  
-	/**
-	 * @var integer
-	 */
-	private $syslogEquivalent;
-
-	/**
-	 * Constructor
-	 *
-	 * @param integer $level
-	 * @param string $levelStr
-	 * @param integer $syslogEquivalent
-	 */
-	private function __construct($level, $levelStr, $syslogEquivalent) {
-		$this->level = $level;
-		$this->levelStr = $levelStr;
-		$this->syslogEquivalent = $syslogEquivalent;
-	}
-
-	/**
-	 * Two priorities are equal if their level fields are equal.
-	 *
-	 * @param object $o
-	 * @return boolean 
-	 */
-	public function equals($o) {
-		if($o instanceof LoggerLevel) {
-			if($this->level == $o->level) {
-			    return true;
-			}
-		} else {
-			return false;
-		}
-	}
-	
-	/**
-	 * Returns an Off Level
-	 * @static
-	 * @return LoggerLevel
-	 */
-	public static function getLevelOff() {
-		if(!isset(self::$levelMap[LoggerLevel::OFF])) {
-			self::$levelMap[LoggerLevel::OFF] = new LoggerLevel(LoggerLevel::OFF, 'OFF', 0);
-		}
-		return self::$levelMap[LoggerLevel::OFF];
-	}
-
-	/**
-	 * Returns a Fatal Level
-	 * @static
-	 * @return LoggerLevel
-	 */
-	public static function getLevelFatal() {
-		if(!isset(self::$levelMap[LoggerLevel::FATAL])) {
-			self::$levelMap[LoggerLevel::FATAL] = new LoggerLevel(LoggerLevel::FATAL, 'FATAL', 0);
-		}
-		return self::$levelMap[LoggerLevel::FATAL];
-	}
-	
-	/**
-	 * Returns an Error Level
-	 * @static
-	 * @return LoggerLevel
-	 */
-	public static function getLevelError() {
-		if(!isset(self::$levelMap[LoggerLevel::ERROR])) {
-			self::$levelMap[LoggerLevel::ERROR] = new LoggerLevel(LoggerLevel::ERROR, 'ERROR', 3);
-		}
-		return self::$levelMap[LoggerLevel::ERROR];
-	}
-	
-	/**
-	 * Returns a Warn Level
-	 * @static
-	 * @return LoggerLevel
-	 */
-	public static function getLevelWarn() {
-		if(!isset(self::$levelMap[LoggerLevel::WARN])) {
-			self::$levelMap[LoggerLevel::WARN] = new LoggerLevel(LoggerLevel::WARN, 'WARN', 4);
-		}
-		return self::$levelMap[LoggerLevel::WARN];
-	}
-
-	/**
-	 * Returns an Info Level
-	 * @static
-	 * @return LoggerLevel
-	 */
-	public static function getLevelInfo() {
-		if(!isset(self::$levelMap[LoggerLevel::INFO])) {
-			self::$levelMap[LoggerLevel::INFO] = new LoggerLevel(LoggerLevel::INFO, 'INFO', 6);
-		}
-		return self::$levelMap[LoggerLevel::INFO];
-	}
-
-	/**
-	 * Returns a Debug Level
-	 * @static
-	 * @return LoggerLevel
-	 */
-	public static function getLevelDebug() {
-		if(!isset(self::$levelMap[LoggerLevel::DEBUG])) {
-			self::$levelMap[LoggerLevel::DEBUG] = new LoggerLevel(LoggerLevel::DEBUG, 'DEBUG', 7);
-		}
-		return self::$levelMap[LoggerLevel::DEBUG];
-	}
-
-	/**
-	 * Returns an All Level
-	 * @static
-	 * @return LoggerLevel
-	 */
-	public static function getLevelAll() {
-		if(!isset(self::$levelMap[LoggerLevel::ALL])) {
-			self::$levelMap[LoggerLevel::ALL] = new LoggerLevel(LoggerLevel::ALL, 'ALL', 7);
-		}
-		return self::$levelMap[LoggerLevel::ALL];
-	}
-	
-	/**
-	 * Return the syslog equivalent of this priority as an integer.
-	 * @final
-	 * @return integer
-	 */
-	public function getSyslogEquivalent() {
-		return $this->syslogEquivalent;
-	}
-
-	/**
-	 * Returns <i>true</i> if this level has a higher or equal
-	 * level than the level passed as argument, <i>false</i>
-	 * otherwise.  
-	 * 
-	 * <p>You should think twice before overriding the default
-	 * implementation of <i>isGreaterOrEqual</i> method.
-	 *
-	 * @param LoggerLevel $r
-	 * @return boolean
-	 */
-	public function isGreaterOrEqual($r) {
-		return $this->level >= $r->level;
-	}
-
-	/**
-	 * Returns the string representation of this priority.
-	 * @return string
-	 * @final
-	 */
-	public function toString() {
-		return $this->levelStr;
-	}
-
-	/**
-	 * Returns the integer representation of this level.
-	 * @return integer
-	 */
-	public function toInt() {
-		return $this->level;
-	}
-
-	/**
-	 * Convert the string passed as argument to a level. If the
-	 * conversion fails, then this method returns a DEBUG Level.
-	 *
-	 * @param mixed $arg
-	 * @param LoggerLevel $default
-	 * @static 
-	 */
-	public static function toLevel($arg, $defaultLevel = null) {
-		if($defaultLevel === null) {
-			return self::toLevel($arg, self::getLevelDebug());
-		} else {
-			if(is_int($arg)) {
-				switch($arg) {
-					case self::ALL:	return self::getLevelAll();
-					case self::DEBUG: return self::getLevelDebug();
-					case self::INFO: return self::getLevelInfo();
-					case self::WARN: return self::getLevelWarn();
-					case self::ERROR: return self::getLevelError();
-					case self::FATAL: return self::getLevelFatal();
-					case self::OFF:	return self::getLevelOff();
-					default: return $defaultLevel;
-				}
-			} else {
-				switch(strtoupper($arg)) {
-					case 'ALL':	return self::getLevelAll();
-					case 'DEBUG': return self::getLevelDebug();
-					case 'INFO': return self::getLevelInfo();
-					case 'WARN': return self::getLevelWarn();
-					case 'ERROR': return self::getLevelError();
-					case 'FATAL': return self::getLevelFatal();
-					case 'OFF':	return self::getLevelOff();
-					default: return $defaultLevel;
-				}
-			}
-		}
-	}
-}

+ 0 - 110
main/inc/lib/phpdocx/lib/log4php/LoggerLocationInfo.php

@@ -1,110 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * The internal representation of caller location information.
- *
- * @version $Revision: 822448 $
- * @package log4php
- * @since 0.3
- */
-class LoggerLocationInfo {
-	/**
-	 * When location information is not available the constant
-	 * <i>NA</i> is returned. Current value of this string
-	 * constant is <b>?</b>.  
-	 */
-	const LOCATION_INFO_NA = 'NA';
-	
-	/**
-	* @var string Caller's line number.
-	*/
-	protected $lineNumber = null;
-	
-	/**
-	* @var string Caller's file name.
-	*/
-	protected $fileName = null;
-	
-	/**
-	* @var string Caller's fully qualified class name.
-	*/
-	protected $className = null;
-	
-	/**
-	* @var string Caller's method name.
-	*/
-	protected $methodName = null;
-	
-	/**
-	* @var string 
-	*/
-	protected $fullInfo = null;
-
-	/**
-	 * Instantiate location information based on a {@link PHP_MANUAL#debug_backtrace}.
-	 *
-	 * @param array $trace
-	 * @param mixed $caller
-	 */
-	public function __construct($trace, $fqcn = null) {
-		$this->lineNumber = isset($trace['line']) ? $trace['line'] : null;
-		$this->fileName = isset($trace['file']) ? $trace['file'] : null;
-		$this->className = isset($trace['class']) ? $trace['class'] : null;
-		$this->methodName = isset($trace['function']) ? $trace['function'] : null;
-		$this->fullInfo = $this->getClassName() . '.' . $this->getMethodName() . 
-			'(' . $this->getFileName() . ':' . $this->getLineNumber() . ')';
-	}
-
-	public function getClassName() {
-		return ($this->className === null) ? self::LOCATION_INFO_NA : $this->className; 
-	}
-
-	/**
-	 *	Return the file name of the caller.
-	 *	<p>This information is not always available.
-	 */
-	public function getFileName() {
-		return ($this->fileName === null) ? self::LOCATION_INFO_NA : $this->fileName; 
-	}
-
-	/**
-	 *	Returns the line number of the caller.
-	 *	<p>This information is not always available.
-	 */
-	public function getLineNumber() {
-		return ($this->lineNumber === null) ? self::LOCATION_INFO_NA : $this->lineNumber; 
-	}
-
-	/**
-	 *	Returns the method name of the caller.
-	 */
-	public function getMethodName() {
-		return ($this->methodName === null) ? self::LOCATION_INFO_NA : $this->methodName; 
-	}
-
-	/**
-	 *	Returns the full information of the caller.
-	 */
-	public function getFullInfo() {
-		return ($this->fullInfo === null) ? self::LOCATION_INFO_NA : $this->fullInfo;
-	}
-
-}

+ 0 - 360
main/inc/lib/phpdocx/lib/log4php/LoggerLoggingEvent.php

@@ -1,360 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * The internal representation of logging event.
- *
- * @version $Revision: 832662 $
- * @package log4php
- */
-class LoggerLoggingEvent {
-
-	private static $startTime;
-
-	/** 
-	* @var string Fully Qualified Class Name of the calling category class.
-	*/
-	private $fqcn;
-	
-	/**
-	* @var Logger reference
-	*/
-	private $logger = null;
-	
-	/** 
-	* The category (logger) name.
-	* This field will be marked as private in future
-	* releases. Please do not access it directly. 
-	* Use the {@link getLoggerName()} method instead.
-	* @deprecated 
-	*/
-	private $categoryName;
-	
-	/** 
-	* Level of logging event.
-	* <p> This field should not be accessed directly. You shoud use the
-	* {@link getLevel()} method instead.
-	*
-	* @deprecated
-	* @var LoggerLevel
-	*/
-	protected $level;
-	
-	/** 
-	 * @var string The nested diagnostic context (NDC) of logging event. 
-	 */
-	private $ndc;
-	
-	/** 
-	 * Have we tried to do an NDC lookup? If we did, there is no need
-	 * to do it again.	Note that its value is always false when
-	 * serialized. Thus, a receiving SocketNode will never use it's own
-	 * (incorrect) NDC. See also writeObject method.
-	 * @var boolean
-	 */
-	private $ndcLookupRequired = true;
-	
-	/** 
-	 * Have we tried to do an MDC lookup? If we did, there is no need
-	 * to do it again.	Note that its value is always false when
-	 * serialized. See also the getMDC and getMDCCopy methods.
-	 * @var boolean	 
-	 */
-	private $mdcCopyLookupRequired = true;
-	
-	/** 
-	 * @var mixed The application supplied message of logging event. 
-	 */
-	private $message;
-	
-	/** 
-	 * The application supplied message rendered through the log4php
-	 * objet rendering mechanism. At present renderedMessage == message.
-	 * @var string
-	 */
-	private $renderedMessage = null;
-	
-	/** 
-	 * The name of thread in which this logging event was generated.
-	 * log4php saves here the process id via {@link PHP_MANUAL#getmypid getmypid()} 
-	 * @var mixed
-	 */
-	private $threadName = null;
-	
-	/** 
-	* The number of seconds elapsed from 1/1/1970 until logging event
-	* was created plus microseconds if available.
-	* @var float
-	*/
-	public $timeStamp;
-	
-	/** 
-	* @var LoggerLocationInfo Location information for the caller. 
-	*/
-	private $locationInfo = null;
-	
-	/**
-	* Instantiate a LoggingEvent from the supplied parameters.
-	*
-	* <p>Except {@link $timeStamp} all the other fields of
-	* LoggerLoggingEvent are filled when actually needed.
-	*
-	* @param string $fqcn name of the caller class.
-	* @param mixed $logger The {@link Logger} category of this event or the logger name.
-	* @param LoggerLevel $priority The level of this event.
-	* @param mixed $message The message of this event.
-	* @param integer $timeStamp the timestamp of this logging event.
-	*/
-	public function __construct($fqcn, $logger, $priority, $message, $timeStamp = null) {
-		$this->fqcn = $fqcn;
-		if($logger instanceof Logger) {
-			$this->logger = $logger;
-			$this->categoryName = $logger->getName();
-		} else {
-			$this->categoryName = strval($logger);
-		}
-		$this->level = $priority;
-		$this->message = $message;
-		if($timeStamp !== null && is_float($timeStamp)) {
-			$this->timeStamp = $timeStamp;
-		} else {
-			if(function_exists('microtime')) {
-				// get microtime as float
-				$this->timeStamp = microtime(true);
-			} else {
-				$this->timeStamp = floatval(time());
-			}
-		}
-	}
-
-	/**
-	 * Set the location information for this logging event. The collected
-	 * information is cached for future use.
-	 *
-	 * <p>This method uses {@link PHP_MANUAL#debug_backtrace debug_backtrace()} function (if exists)
-	 * to collect informations about caller.</p>
-	 * <p>It only recognize informations generated by {@link Logger} and its subclasses.</p>
-	 * @return LoggerLocationInfo
-	 */
-	public function getLocationInformation() {
-		if($this->locationInfo === null) {
-
-			$locationInfo = array();
-
-			if(function_exists('debug_backtrace')) {
-				$trace = debug_backtrace();
-				$prevHop = null;
-				// make a downsearch to identify the caller
-				$hop = array_pop($trace);
-				while($hop !== null) {
-					if(isset($hop['class'])) {
-						// we are sometimes in functions = no class available: avoid php warning here
-						$className = strtolower($hop['class']);
-						if(!empty($className) and ($className == 'logger' or $className == 'loggercategory' or 
-							strtolower(get_parent_class($className)) == 'logger' or
-							strtolower(get_parent_class($className)) == 'loggercategory')) {
-							$locationInfo['line'] = $hop['line'];
-							$locationInfo['file'] = $hop['file'];
-							break;
-						}
-					}
-					$prevHop = $hop;
-					$hop = array_pop($trace);
-				}
-				$locationInfo['class'] = isset($prevHop['class']) ? $prevHop['class'] : 'main';
-				if(isset($prevHop['function']) and
-					$prevHop['function'] !== 'include' and
-					$prevHop['function'] !== 'include_once' and
-					$prevHop['function'] !== 'require' and
-					$prevHop['function'] !== 'require_once') {
-	
-					$locationInfo['function'] = $prevHop['function'];
-				} else {
-					$locationInfo['function'] = 'main';
-				}
-			}
-					 
-			$this->locationInfo = new LoggerLocationInfo($locationInfo, $this->fqcn);
-		}
-		return $this->locationInfo;
-	}
-
-	/**
-	 * Return the level of this event. Use this form instead of directly
-	 * accessing the {@link $level} field.
-	 * @return LoggerLevel	
-	 */
-	public function getLevel() {
-		return $this->level;
-	}
-
-	/**
-	 * Return the name of the logger. Use this form instead of directly
-	 * accessing the {@link $categoryName} field.
-	 * @return string  
-	 */
-	public function getLoggerName() {
-		return $this->categoryName;
-	}
-
-	/**
-	 * Return the message for this logging event.
-	 *
-	 * <p>Before serialization, the returned object is the message
-	 * passed by the user to generate the logging event. After
-	 * serialization, the returned value equals the String form of the
-	 * message possibly after object rendering.
-	 * @return mixed
-	 */
-	public function getMessage() {
-		if($this->message !== null) {
-			return $this->message;
-		} else {
-			return $this->getRenderedMessage();
-		}
-	}
-
-	/**
-	 * This method returns the NDC for this event. It will return the
-	 * correct content even if the event was generated in a different
-	 * thread or even on a different machine. The {@link LoggerNDC::get()} method
-	 * should <b>never</b> be called directly.
-	 * @return string  
-	 */
-	public function getNDC() {
-		if($this->ndcLookupRequired) {
-			$this->ndcLookupRequired = false;
-			$this->ndc = implode(' ', LoggerNDC::get());
-		}
-		return $this->ndc;
-	}
-
-	/**
-	 * Returns the the context corresponding to the <code>key</code>
-	 * parameter.
-	 * @return string
-	 */
-	public function getMDC($key) {
-		return LoggerMDC::get($key);
-	}
-
-	/**
-	 * Render message.
-	 * @return string
-	 */
-	public function getRenderedMessage() {
-		if($this->renderedMessage === null and $this->message !== null) {
-			if(is_string($this->message)) {
-					$this->renderedMessage = $this->message;
-			} else {
-			    // $this->logger might be null or an instance of Logger or RootLogger
-			    // But in contrast to log4j, in log4php there is only have one LoggerHierarchy so there is
-			    // no need figure out which one is $this->logger part of.
-			    // TODO: Logger::getHierarchy() is marked @deprecated!
-				$repository = Logger::getHierarchy();
-				$rendererMap = $repository->getRendererMap();
-				$this->renderedMessage= $rendererMap->findAndRender($this->message);
-			}
-		}
-		return $this->renderedMessage;
-	}
-
-	/**
-	 * Returns the time when the application started, in seconds
-	 * elapsed since 01.01.1970 plus microseconds if available.
-	 *
-	 * @return float
-	 * @static
-	 */
-	public static function getStartTime() {
-		if(!isset(self::$startTime)) {
-			if (function_exists('microtime')) {
-				// microtime as float
-				self::$startTime = microtime(true);
-			} else {
-				self::$startTime = floatval(time());
-			}
-		}
-		return self::$startTime; 
-	}
-
-	/**
-	 * @return float
-	 */
-	public function getTimeStamp() {
-		return $this->timeStamp;
-	}
-	
-	/**
-	 * Calculates the time of this event.
-	 * @return the time after event starttime when this event has occured
-	 */
-	public function getTime() {
-        $eventTime = (float)$this->getTimeStamp();
-        $eventStartTime = (float)LoggerLoggingEvent::getStartTime();
-        return number_format(($eventTime - $eventStartTime) * 1000, 0, '', '');
-    }
-	
-	/**
-	 * @return mixed
-	 */
-	public function getThreadName() {
-		if ($this->threadName === null) {
-			$this->threadName = (string)getmypid();
-		}
-		return $this->threadName;
-	}
-
-	/**
-	 * @return mixed null
-	 */
-	public function getThrowableInformation() {
-		return null;
-	}
-	
-	/**
-	 * Serialize this object
-	 * @return string
-	 */
-	public function toString() {
-		serialize($this);
-	}
-	
-	/**
-	 * Avoid serialization of the {@link $logger} object
-	 */
-	public function __sleep() {
-		return array(
-			'fqcn',
-			'categoryName',
-			'level',
-			'ndc',
-			'ndcLookupRequired',
-			'message',
-			'renderedMessage',
-			'threadName',
-			'timeStamp',
-			'locationInfo',
-		);
-	}
-
-}
-
-LoggerLoggingEvent::getStartTime();

+ 0 - 116
main/inc/lib/phpdocx/lib/log4php/LoggerMDC.php

@@ -1,116 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * This is the global repository of user mappings
- */
-$GLOBALS['log4php.LoggerMDC.ht'] = array();
-
-/**
- * The LoggerMDC class provides <i>mapped diagnostic contexts</i>.
- * 
- * <p>A <i>Mapped Diagnostic Context</i>, or
- * MDC in short, is an instrument for distinguishing interleaved log
- * output from different sources. Log output is typically interleaved
- * when a server handles multiple clients near-simultaneously.
- * 
- * <p>This class is similar to the {@link LoggerNDC} class except that 
- * it is based on a map instead of a stack.
- * 
- * <p><b>The MDC is managed on a per thread basis</b>.
- * 
- * <p>Example:
- * 
- * {@example ../../examples/php/mdc.php 19}<br>
- *
- * With the properties file:
- * 
- * {@example ../../examples/resources/mdc.properties 18}<br>
- * 
- * Will result in the following (notice the username "knut" in the output):
- * 
- * <pre>
- * 2009-09-13 18:48:28 DEBUG root knut: Testing MDC in src/examples/php/mdc.php at 23
- * </pre>
- * 
- * @version $Revision: 883114 $
- * @since 0.3
- * @package log4php
- */
-class LoggerMDC {
-	/**
-	 * Put a context value as identified with the key parameter into the current thread's
-	 *	context map.
-	 *
-	 * <p>If the current thread does not have a context map it is
-	 *	created as a side effect.</p>
-	 *
-	 * <p>Note that you cannot put more than {@link self::HT_SIZE} keys.</p>
-	 *
-	 * @param string $key the key
-	 * @param string $value the value
-	 * @static
-	 */
-	public static function put($key, $value) {
-		$GLOBALS['log4php.LoggerMDC.ht'][$key] = $value;
-	}
-  
-	/**
-	 * Get the context identified by the key parameter.
-	 *
-	 * <p>You can use special key identifiers to map values in 
-	 * PHP $_SERVER and $_ENV vars. Just put a 'server.' or 'env.'
-	 * followed by the var name you want to refer.</p>
-	 *
-	 * <p>This method has no side effects.</p>
-	 *
-	 * @param string $key
-	 * @return string
-	 * @static
-	 */
-	public static function get($key) {
-		if(!empty($key)) {
-			if(strpos($key, 'server.') === 0) {
-				$varName = substr($key, 7);
-				return @$_SERVER[$varName];
-			} else if(strpos($key, 'env.') === 0) {
-				$varName = substr($key, 4);
-				return @$_ENV[$varName];
-			} else if (isset($GLOBALS['log4php.LoggerMDC.ht'][$key])) {
-				return $GLOBALS['log4php.LoggerMDC.ht'][$key];
-			}
-		}
-		return '';
-	}
-
-	/**
-	 * Remove the the context identified by the key parameter. 
-	 *
-	 * It only affects user mappings.
-	 *
-	 * @param string $key
-	 * @return string
-	 * @static
-	 */
-	public static function remove($key) {
-		unset($GLOBALS['log4php.LoggerMDC.ht'][$key]);
-	}
-
-}

+ 0 - 221
main/inc/lib/phpdocx/lib/log4php/LoggerNDC.php

@@ -1,221 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-
-/**
- * This is the global repository of NDC stack
- */
-$GLOBALS['log4php.LoggerNDC.ht'] = array();
-
-/**
- * The NDC class implements <i>nested diagnostic contexts</i>.
- * 
- * NDC was defined by Neil Harrison in the article "Patterns for Logging
- * Diagnostic Messages" part of the book <i>"Pattern Languages of
- * Program Design 3"</i> edited by Martin et al.
- *
- * A Nested Diagnostic Context, or NDC in short, is an instrument
- * to distinguish interleaved log output from different sources. Log
- * output is typically interleaved when a server handles multiple
- * clients near-simultaneously.
- *
- * This class is similar to the {@link LoggerMDC} class except that it is
- * based on a stack instead of a map.
- *
- * Interleaved log output can still be meaningful if each log entry
- * from different contexts had a distinctive stamp. This is where NDCs
- * come into play.
- *
- * <b>Note that NDCs are managed on a per thread basis</b>. 
- * 
- * NDC operations such as {@link push()}, {@link pop()}, 
- * {@link clear()}, {@link getDepth()} and {@link setMaxDepth()}
- * affect the NDC of the <i>current</i> thread only. NDCs of other
- * threads remain unaffected.
- *
- * For example, a servlet can build a per client request NDC
- * consisting the clients host name and other information contained in
- * the the request. <i>Cookies</i> are another source of distinctive
- * information. To build an NDC one uses the {@link push()}
- * operation.
- * 
- * Simply put,
- *
- * - Contexts can be nested.
- * - When entering a context, call <kbd>LoggerNDC::push()</kbd>
- *	 As a side effect, if there is no nested diagnostic context for the
- *	 current thread, this method will create it.
- * - When leaving a context, call <kbd>LoggerNDC::pop()</kbd>
- * - <b>When exiting a thread make sure to call {@link remove()}</b>
- *	 
- * There is no penalty for forgetting to match each
- * <kbd>push</kbd> operation with a corresponding <kbd>pop</kbd>,
- * except the obvious mismatch between the real application context
- * and the context set in the NDC.
- *
- * If configured to do so, {@link LoggerPatternLayout} and {@link LoggerLayoutTTCC} 
- * instances automatically retrieve the nested diagnostic
- * context for the current thread without any user intervention.
- * Hence, even if a servlet is serving multiple clients
- * simultaneously, the logs emanating from the same code (belonging to
- * the same category) can still be distinguished because each client
- * request will have a different NDC tag.
- *
- * Example:
- *	
- * {@example ../../examples/php/ndc.php 19}<br>
- *
- * With the properties file:
- * 
- * {@example ../../examples/resources/ndc.properties 18}<br>
- * 
- * Will result in the following (notice the conn and client ids):
- * 
- * <pre>
- * 2009-09-13 19:04:27 DEBUG root conn=1234: just received a new connection in src/examples/php/ndc.php at 23
- * 2009-09-13 19:04:27 DEBUG root conn=1234 client=ab23: some more messages that can in src/examples/php/ndc.php at 25
- * 2009-09-13 19:04:27 DEBUG root conn=1234 client=ab23: now related to a client in src/examples/php/ndc.php at 26
- * 2009-09-13 19:04:27 DEBUG root : back and waiting for new connections in src/examples/php/ndc.php at 29
- * </pre>
- *	
- * @version $Revision: 883114 $
- * @package log4php 
- * @since 0.3
- */
-class LoggerNDC {
-	const HT_SIZE = 7;
-	/**
-	 * Clear any nested diagnostic information if any. This method is
-	 * useful in cases where the same thread can be potentially used
-	 * over and over in different unrelated contexts.
-	 *
-	 * <p>This method is equivalent to calling the {@link setMaxDepth()}
-	 * method with a zero <var>maxDepth</var> argument.
-	 *
-	 * @static	
-	 */
-	public static function clear() {
-		$GLOBALS['log4php.LoggerNDC.ht'] = array();
-	}
-
-	/**
-	 * Never use this method directly, use the {@link LoggerLoggingEvent::getNDC()} method instead.
-	 * @static
-	 * @return array
-	 */
-	public static function get() {
-		if(!array_key_exists('log4php.LoggerNDC.ht', $GLOBALS)) {
-			LoggerNDC::clear();
-		}
-		return $GLOBALS['log4php.LoggerNDC.ht'];
-	}
-  
-	/**
-	 * Get the current nesting depth of this diagnostic context.
-	 *
-	 * @see setMaxDepth()
-	 * @return integer
-	 * @static
-	 */
-	public static function getDepth() {
-		return count($GLOBALS['log4php.LoggerNDC.ht']);	  
-	}
-
-	/**
-	 * Clients should call this method before leaving a diagnostic
-	 * context.
-	 *
-	 * <p>The returned value is the value that was pushed last. If no
-	 * context is available, then the empty string "" is returned.</p>
-	 *
-	 * @return string The innermost diagnostic context.
-	 * @static
-	 */
-	public static function pop() {
-		if(count($GLOBALS['log4php.LoggerNDC.ht']) > 0) {
-			return array_pop($GLOBALS['log4php.LoggerNDC.ht']);
-		} else {
-			return '';
-		}
-	}
-
-	/**
-	 * Looks at the last diagnostic context at the top of this NDC
-	 * without removing it.
-	 *
-	 * <p>The returned value is the value that was pushed last. If no
-	 * context is available, then the empty string "" is returned.</p>
-	 * @return string The innermost diagnostic context.
-	 * @static
-	 */
-	public static function peek(){
-		if(count($GLOBALS['log4php.LoggerNDC.ht']) > 0) {
-			return end($GLOBALS['log4php.LoggerNDC.ht']);
-		} else {
-			return '';
-		}
-	}
-  
-	/**
-	 * Push new diagnostic context information for the current thread.
-	 *
-	 * <p>The contents of the <var>message</var> parameter is
-	 * determined solely by the client.
-	 *	
-	 * @param string $message The new diagnostic context information.
-	 * @static	
-	 */
-	public static function push($message) {
-		array_push($GLOBALS['log4php.LoggerNDC.ht'], (string)$message);
-	}
-
-	/**
-	 * Remove the diagnostic context for this thread.
-	 * @static
-	 */
-	public static function remove() {
-		LoggerNDC::clear();
-	}
-
-	/**
-	 * Set maximum depth of this diagnostic context. If the current
-	 * depth is smaller or equal to <var>maxDepth</var>, then no
-	 * action is taken.
-	 *
-	 * <p>This method is a convenient alternative to multiple 
-	 * {@link pop()} calls. Moreover, it is often the case that at 
-	 * the end of complex call sequences, the depth of the NDC is
-	 * unpredictable. The {@link setMaxDepth()} method circumvents
-	 * this problem.
-	 *
-	 * @param integer $maxDepth
-	 * @see getDepth()
-	 * @static
-	 */
-	public static function setMaxDepth($maxDepth) {
-		$maxDepth = (int)$maxDepth;
-		if($maxDepth <= self::HT_SIZE) {
-			if(LoggerNDC::getDepth() > $maxDepth) {
-				$GLOBALS['log4php.LoggerNDC.ht'] = array_slice($GLOBALS['log4php.LoggerNDC.ht'], $maxDepth);
-			}
-		}
-	}
-
-}

+ 0 - 154
main/inc/lib/phpdocx/lib/log4php/LoggerReflectionUtils.php

@@ -1,154 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * @package log4php
- */
- 
- /**
-  * Provides methods for reflective use on php objects
-  * @package log4php
-  */
-class LoggerReflectionUtils {
-		/** the target object */
-	private $obj;
-  
-	/**
-	 * Create a new LoggerReflectionUtils for the specified Object. 
-	 * This is done in prepartion for invoking {@link setProperty()} 
-	 * one or more times.
-	 * @param object &$obj the object for which to set properties
-	 */
-	public function __construct($obj) {
-		$this->obj = $obj;
-	}
-  
-	/**
-	 * Set the properties of an object passed as a parameter in one
-	 * go. The <code>properties</code> are parsed relative to a
-	 * <code>prefix</code>.
-	 *
-	 * @param object $obj The object to configure.
-	 * @param array $properties An array containing keys and values.
-	 * @param string $prefix Only keys having the specified prefix will be set.
-	 * @static
-	 */
-	 // TODO: check, if this is really useful
-	public static function setPropertiesByObject($obj, $properties, $prefix) {
-		$pSetter = new LoggerReflectionUtils($obj);
-		return $pSetter->setProperties($properties, $prefix);
-	}
-  
-
-	/**
-	 * Set the properites for the object that match the
-	 * <code>prefix</code> passed as parameter.
-	 * 
-	 * Example:
-	 * 
-	 * $arr['xxxname'] = 'Joe';
- 	 * $arr['xxxmale'] = true;
-	 * and prefix xxx causes setName and setMale.	
-	 *
-	 * @param array $properties An array containing keys and values.
-	 * @param string $prefix Only keys having the specified prefix will be set.
-	 */
-	 // TODO: check, if this is really useful
-	public function setProperties($properties, $prefix) {
-		$len = strlen($prefix);
-		while(list($key,) = each($properties)) {
-			if(strpos($key, $prefix) === 0) {
-				if(strpos($key, '.', ($len + 1)) > 0) {
-					continue;
-				}
-				$value = LoggerOptionConverter::findAndSubst($key, $properties);
-				$key = substr($key, $len);
-				if($key == 'layout' and ($this->obj instanceof LoggerAppender)) {
-					continue;
-				}
-				$this->setProperty($key, $value);
-			}
-		}
-		$this->activate();
-	}
-	
-	/**
-	 * Set a property on this PropertySetter's Object. If successful, this
-	 * method will invoke a setter method on the underlying Object. The
-	 * setter is the one for the specified property name and the value is
-	 * determined partly from the setter argument type and partly from the
-	 * value specified in the call to this method.
-	 *
-	 * <p>If the setter expects a String no conversion is necessary.
-	 * If it expects an int, then an attempt is made to convert 'value'
-	 * to an int using new Integer(value). If the setter expects a boolean,
-	 * the conversion is by new Boolean(value).
-	 *
-	 * @param string $name	  name of the property
-	 * @param string $value	  String value of the property
-	 */
-	public function setProperty($name, $value) {
-		if($value === null) {
-			return;
-		}
-		
-		$method = "set" . ucfirst($name);
-		
-		if(!method_exists($this->obj, $method)) {
-			throw new Exception("Error setting log4php property $name to $value: no method $method in class ".get_class($this->obj)."!");
-		} else {
-			return call_user_func(array($this->obj, $method), $value);
-		} 
-	}
-  
-	public function activate() {
-		if(method_exists($this->obj, 'activateoptions')) {
-			return call_user_func(array($this->obj, 'activateoptions'));
-		} 
-	}
-	
-	/**
-	 * Creates an instances from the given class name.
-	 *
-	 * @param string $classname
-	 * @return an object from the class with the given classname
-	 */
-	public static function createObject($class) {
-		if(!empty($class)) {
-			$class = basename($class);
-			return new $class();
-		}
-		return null;
-	}
-	
-	/**
-     * @param object $object
-     * @param string $name
-     * @param mixed $value
-     */
-    public static function setter($object, $name, $value) {
-        if (empty($name)) {
-            return false;
-        }
-        $methodName = 'set'.ucfirst($name);
-        if (method_exists($object, $methodName)) {
-            return call_user_func(array($object, $methodName), $value);
-        } else {
-            return false;
-        }
-    }
-	
-}

+ 0 - 70
main/inc/lib/phpdocx/lib/log4php/LoggerRoot.php

@@ -1,70 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * The root logger.
- *
- * @version $Revision: 822448 $
- * @package log4php
- * @see Logger
- */
-class LoggerRoot extends Logger {
-	/**
-	 * Constructor
-	 *
-	 * @param integer $level initial log level
-	 */
-	public function __construct($level = null) {
-		parent::__construct('root');
-
-		if($level == null) {
-			$level = LoggerLevel::getLevelAll();
-		}
-		$this->setLevel($level);
-	} 
-	
-	/**
-	 * @return LoggerLevel the level
-	 */
-	public function getChainedLevel() {
-		return parent::getLevel();
-	} 
-	
-	/**
-	 * Setting a null value to the level of the root category may have catastrophic results.
-	 * @param LoggerLevel $level
-	 */
-	public function setLevel($level) {
-		if($level != null) {
-			parent::setLevel($level);
-		}	 
-	}
-	
-	/**
-	 * Always returns false.
-	 * Because LoggerRoot has no parents, it returns false.
-	 * @param Logger $parent
-	 * @return boolean
-	 */
-	public function setParent(Logger $parent) {
-		return false;
-	}
-
-}

+ 0 - 263
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderAdodb.php

@@ -1,263 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/** A docblok to make phpdoc happy */
-require_once(ADODB_DIR . '/adodb.inc.php');
-
-/**
- * Appends log events to a db table using adodb class.
- *
- * <p>This appender uses a table in a database to log events.</p>
- * <p>Parameters are {@link $host}, {@link $user}, {@link $password},
- * {@link $database}, {@link $createTable}, {@link $table} and {@link $sql}.</p>
- * <p>See examples in test directory.</p>
- *
- * @deprecated Use LoggerAppenderPDO instead
- * @package log4php
- * @subpackage appenders
- * @since 0.9
- */
-class LoggerAppenderAdodb extends LoggerAppender {
-
-    /**
-     * Create the log table if it does not exists (optional).
-     * @var boolean
-     */
-    var $createTable = true;
-    
-    /**
-     * The type of database to connect to
-     * @var string
-     */
-    var $type;
-    
-    /**
-     * Database user name
-     * @var string
-     */
-    var $user;
-    
-    /**
-     * Database password
-     * @var string
-     */
-    var $password;
-    
-    /**
-     * Database host to connect to
-     * @var string
-     */
-    var $host;
-    
-    /**
-     * Name of the database to connect to
-     * @var string
-     */
-    var $database;
-    
-    /**
-     * A {@link LoggerPatternLayout} string used to format a valid insert query (mandatory).
-     * @var string
-     */
-    var $sql;
-    
-    /**
-     * Table name to write events. Used only if {@link $createTable} is true.
-     * @var string
-     */    
-    var $table;
-    
-    /**
-     * @var object Adodb instance
-     * @access private
-     */
-    var $db = null;
-    
-    /**
-     * @var boolean used to check if all conditions to append are true
-     * @access private
-     */
-    var $canAppend = true;
-    
-    /**    
-     * @access private
-     */
-    var $requiresLayout = false;
-    
-    /**
-     * Constructor.
-     *
-     * @param string $name appender name
-     */
-    function __construct($name)
-    {
-        parent::__construct($name);
-    }
-
-    /**
-     * Setup db connection.
-     * Based on defined options, this method connects to db defined in {@link $dsn}
-     * and creates a {@link $table} table if {@link $createTable} is true.
-     * @return boolean true if all ok.
-     */
-    function activateOptions()
-    {        
-        $this->db = &ADONewConnection($this->type);
-        if (! $this->db->PConnect($this->host, $this->user, $this->password, $this->database)) {
-          $this->db = null;
-          $this->closed = true;
-          $this->canAppend = false;
-          return;
-        }
-        
-        $this->layout = LoggerReflectionUtils::createObject('LoggerLayoutPattern');
-        $this->layout->setConversionPattern($this->getSql());
-    
-        // test if log table exists
-        $sql = 'select * from ' . $this->table . ' where 1 = 0';
-        $dbrs = $this->db->Execute($sql);
-        if ($dbrs == false and $this->getCreateTable()) {
-            $query = "CREATE TABLE {$this->table} (timestamp varchar(32),logger varchar(32),level varchar(32),message varchar(64),thread varchar(32),file varchar(64),line varchar(4) );";
-
-                     
-            $result = $this->db->Execute($query);
-            if (! $result) {
-                $this->canAppend = false;
-                return;
-            }
-        }
-        $this->canAppend = true;
-    }
-    
-    function append(LoggerLoggingEvent $event) {
-        if ($this->canAppend) {
-            $query = $this->layout->format($event);
-            $this->db->Execute($query);
-        }
-    }
-    
-    function close()
-    {
-        if ($this->db !== null)
-            $this->db->Close();
-        $this->closed = true;
-    }
-    
-    /**
-     * @return boolean
-     */
-    function getCreateTable()
-    {
-        return $this->createTable;
-    }
-    
-    /**
-     * @return string the sql pattern string
-     */
-    function getSql()
-    {
-        return $this->sql;
-    }
-    
-    /**
-     * @return string the table name to create
-     */
-    function getTable()
-    {
-        return $this->table;
-    }
-    
-    /**
-     * @return string the database to connect to
-     */
-    function getDatabase() {
-        return $this->database;
-    }
-    
-    /**
-     * @return string the database to connect to
-     */
-    function getHost() {
-        return $this->host;
-    }
-    
-    /**
-     * @return string the user to connect with
-     */
-    function getUser() {
-        return $this->user;
-    }
-    
-    /**
-     * @return string the password to connect with
-     */
-    function getPassword() {
-        return $this->password;
-    }
-    
-    /**
-     * @return string the type of database to connect to
-     */
-    function getType() {
-        return $this->type;
-    }
-    
-    function setCreateTable($flag)
-    {
-        $this->createTable = LoggerOptionConverter::toBoolean($flag, true);
-    }
-    
-    function setType($newType)
-    {
-        $this->type = $newType;
-    }
-    
-    function setDatabase($newDatabase)
-    {
-        $this->database = $newDatabase;
-    }
-    
-    function setHost($newHost)
-    {
-        $this->host = $newHost;
-    }
-    
-    function setUser($newUser)
-    {
-        $this->user = $newUser;
-    }
-    
-    function setPassword($newPassword)
-    {
-        $this->password = $newPassword;
-    }
-    
-    function setSql($sql)
-    {
-        $this->sql = $sql;    
-    }
-    
-    function setTable($table)
-    {
-        $this->table = $table;
-    }
-    
-}
-

+ 0 - 112
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderConsole.php

@@ -1,112 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * ConsoleAppender appends log events to STDOUT or STDERR. 
- * 
- * <p><b>Note</b>: Use this Appender with command-line php scripts. 
- * On web scripts this appender has no effects.</p>
- *
- * Configurable parameters of this appender are:
- *
- * - layout     - The layout (required)
- * - target     - "stdout" or "stderr"
- * 
- * An example php file:
- * 
- * {@example ../../examples/php/appender_console.php 19}
- * 
- * An example configuration file:
- * 
- * {@example ../../examples/resources/appender_console.properties 18}
- * 
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */
-class LoggerAppenderConsole extends LoggerAppender {
-
-	const STDOUT = 'php://stdout';
-	const STDERR = 'php://stderr';
-
-	/**
-	 * Can be 'php://stdout' or 'php://stderr'. But it's better to use keywords <b>STDOUT</b> and <b>STDERR</b> (case insensitive). 
-	 * Default is STDOUT
-	 * @var string	  
-	 */
-	private $target = self::STDOUT;
-	
-	/**
-	 * @var boolean
-	 * @access private	   
-	 */
-	protected $requiresLayout = true;
-
-	/**
-	 * @var mixed the resource used to open stdout/stderr
-	 * @access private	   
-	 */
-	protected $fp = null;
-
-	public function __destruct() {
-       $this->close();
-   	}
-   	
-	/**
-	 * Set console target.
-	 * @param mixed $value a constant or a string
-	 */
-	public function setTarget($value) {
-		$v = trim($value);
-		if ($v == self::STDOUT || strtoupper($v) == 'STDOUT') {
-			$this->target = self::STDOUT;
-		} elseif ($v == self::STDERR || strtoupper($v) == 'STDERR') {
-			$this->target = self::STDERR;
-		} 
-	}
-
-	public function activateOptions() {
-		$this->fp = fopen($this->target, 'w');
-		if(is_resource($this->fp) && $this->layout !== null) {
-			fwrite($this->fp, $this->layout->getHeader());
-		}
-		$this->closed = (bool)is_resource($this->fp) === false; 
-	}
-	
-	/**
-	 * @see LoggerAppender::close()
-	 */
-	public function close() {
-		if($this->closed != true) {
-			if (is_resource($this->fp) && $this->layout !== null) {
-				fwrite($this->fp, $this->layout->getFooter());
-				fclose($this->fp);
-			}
-			$this->closed = true;
-		}			 
-	}
-
-	public function append(LoggerLoggingEvent $event) {
-		if (is_resource($this->fp) && $this->layout !== null) {
-			fwrite($this->fp, $this->layout->format($event));
-		} 
-	}
-}
-

+ 0 - 92
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderDailyFile.php

@@ -1,92 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * An Appender that automatically creates a new logfile each day.
- *
- * The file is rolled over once a day. That means, for each day a new file 
- * is created. A formatted version of the date pattern is used as to create 
- * the file name using the {@link PHP_MANUAL#sprintf} function.
- * 
- * - layout             - Sets the layout class for this appender
- * - datePattern        - Sets date format for the file name. Should be set before $file!
- * - file               - The target file name. Should contain a '%s' which gets substituted by the date.
- * - append             - Sets if the appender should append to the end of the file or overwrite content ("true" or "false")
- * 
- * An example php file:
- * 
- * {@example ../../examples/php/appender_dailyfile.php 19}
- *  
- * An example configuration file:
- * 
- * {@example ../../examples/resources/appender_dailyfile.properties 18}
- *
- * The above will create a file like: daily_20090908.log
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */
-class LoggerAppenderDailyFile extends LoggerAppenderFile {
-
-	/**
-	 * Format date. 
-	 * It follows the {@link PHP_MANUAL#date()} formatting rules and <b>should always be set before {@link $file} param</b>.
-	 * @var string
-	 */
-	public $datePattern = "Ymd";
-	
-	public function __destruct() {
-       parent::__destruct();
-   	}
-   	
-	/**
-	* Sets date format for the file name.
-	* @param string $format a regular date() string format
-	*/
-	public function setDatePattern($format) {
-		$this->datePattern = $format;
-	}
-	
-	/**
-	* @return string returns date format for the filename
-	*/
-	public function getDatePattern() {
-		return $this->datePattern;
-	}
-	
-	/**
-	* The File property takes a string value which should be the name of the file to append to.
-	* Sets and opens the file where the log output will go.
-	*
-	* @see LoggerAppenderFile::setFile()
-	*/
-	public function setFile() {
-		$numargs = func_num_args();
-		$args = func_get_args();
-		
-		if($numargs == 1 and is_string($args[0])) {
-			parent::setFile( sprintf((string)$args[0], date($this->getDatePattern())) );
-		} else if ($numargs == 2 and is_string($args[0]) and is_bool($args[1])) {
-			parent::setFile( sprintf((string)$args[0], date($this->getDatePattern())), $args[1] );
-		}
-	} 
-
-}

+ 0 - 80
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderEcho.php

@@ -1,80 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * LoggerAppenderEcho uses {@link PHP_MANUAL#echo echo} function to output events. 
- * 
- * <p>This appender requires a layout.</p>	
- * 
- * An example php file:
- * 
- * {@example ../../examples/php/appender_echo.php 19}
- * 
- * An example configuration file:
- * 
- * {@example ../../examples/resources/appender_echo.properties 18}
- * 
- * The above example would print the following:
- * <pre>
- *    Tue Sep  8 22:44:55 2009,812 [6783] DEBUG appender_echo - Hello World!
- * </pre>
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */
-class LoggerAppenderEcho extends LoggerAppender {
-	/** boolean used internally to mark first append */
-	private $firstAppend = true;
-	
-	public function __construct($name = '') {
-	    parent::__construct($name);
-	    $this->requiresLayout = true;
-	    $this->firstAppend = true;
-	}
-	
-	public function __destruct() {
-       $this->close();
-   	}
-   	
-	public function activateOptions() {
-		$this->closed = false;
-	}
-	
-	public function close() {
-		if($this->closed != true) {
-			if(!$this->firstAppend) {
-				echo $this->layout->getFooter();
-			}
-		}
-		$this->closed = true;	 
-	}
-
-	public function append(LoggerLoggingEvent $event) {
-		if($this->layout !== null) {
-			if($this->firstAppend) {
-				echo $this->layout->getHeader();
-				$this->firstAppend = false;
-			}
-			echo $this->layout->format($event);
-		} 
-	}
-}
-

+ 0 - 170
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderFile.php

@@ -1,170 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * FileAppender appends log events to a file.
- *
- * Configurable parameters for this appender are:
- * 
- * - layout             - Sets the layout class for this appender
- * - file               - The target file to write to
- * - filename           - The target file to write to
- * - append             - Sets if the appender should append to the end of the file or overwrite content ("true" or "false")
- *
- * An example php file:
- * 
- * {@example ../../examples/php/appender_file.php 19}
- *
- * An example configuration file:
- * 
- * {@example ../../examples/resources/appender_file.properties 18}
- * 
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */
-class LoggerAppenderFile extends LoggerAppender {
-
-	/**
-	 * @var boolean if {@link $file} exists, appends events.
-	 */
-	private $append = true;
-	/**
-	 * @var string the file name used to append events
-	 */
-	protected $fileName;
-	/**
-	 * @var mixed file resource
-	 */
-	protected $fp = false;
-	
-	public function __construct($name = '') {
-		parent::__construct($name);
-		$this->requiresLayout = true;
-	}
-
-	public function __destruct() {
-       $this->close();
-   	}
-   	
-	public function activateOptions() {
-		$fileName = $this->getFile();
-
-		if(!is_file($fileName)) {
-			$dir = dirname($fileName);
-			if(!is_dir($dir)) {
-				mkdir($dir, 0777, true);
-			}
-		}
-
-		$this->fp = fopen($fileName, ($this->getAppend()? 'a':'w'));
-		if($this->fp) {
-			if(flock($this->fp, LOCK_EX)) {
-				if($this->getAppend()) {
-					fseek($this->fp, 0, SEEK_END);
-				}
-				fwrite($this->fp, $this->layout->getHeader());
-				flock($this->fp, LOCK_UN);
-				$this->closed = false;
-			} else {
-				// TODO: should we take some action in this case?
-				$this->closed = true;
-			}		 
-		} else {
-			$this->closed = true;
-		}
-	}
-	
-	public function close() {
-		if($this->closed != true) {
-			if($this->fp and $this->layout !== null) {
-				if(flock($this->fp, LOCK_EX)) {
-					fwrite($this->fp, $this->layout->getFooter());
-					flock($this->fp, LOCK_UN);
-				}
-				fclose($this->fp);
-			}
-			$this->closed = true;
-		}
-	}
-
-	public function append(LoggerLoggingEvent $event) {
-		if($this->fp and $this->layout !== null) {
-			if(flock($this->fp, LOCK_EX)) {
-				fwrite($this->fp, $this->layout->format($event));
-				flock($this->fp, LOCK_UN);
-			} else {
-				$this->closed = true;
-			}
-		} 
-	}
-	
-	/**
-	 * Sets and opens the file where the log output will go.
-	 *
-	 * This is an overloaded method. It can be called with:
-	 * - setFile(string $fileName) to set filename.
-	 * - setFile(string $fileName, boolean $append) to set filename and append.
-	 * 
-	 * TODO: remove overloading. Use only file as alias to filename
-	 */
-	public function setFile() {
-		$numargs = func_num_args();
-		$args	 = func_get_args();
-
-		if($numargs == 1 and is_string($args[0])) {
-			$this->setFileName($args[0]);
-		} else if ($numargs >=2 and is_string($args[0]) and is_bool($args[1])) {
-			$this->setFile($args[0]);
-			$this->setAppend($args[1]);
-		}
-	}
-	
-	/**
-	 * @return string
-	 */
-	public function getFile() {
-		return $this->getFileName();
-	}
-	
-	/**
-	 * @return boolean
-	 */
-	public function getAppend() {
-		return $this->append;
-	}
-
-	public function setAppend($flag) {
-		$this->append = LoggerOptionConverter::toBoolean($flag, true);		  
-	}
-
-	public function setFileName($fileName) {
-		$this->fileName = $fileName;
-	}
-	
-	/**
-	 * @return string
-	 */
-	public function getFileName() {
-		return $this->fileName;
-	}
-	
-	 
-}

+ 0 - 131
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderMail.php

@@ -1,131 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Appends log events to mail using php function {@link PHP_MANUAL#mail}.
- *
- * The appender sends all log events at once after the request has been
- * finsished and the appender is beeing closed.
- *
- * Configurable parameters for this appender:
- * 
- * - layout             - Sets the layout class for this appender (required)
- * - to                 - Sets the recipient of the mail (required)
- * - from               - Sets the sender of the mail (optional)
- * - subject            - Sets the subject of the mail (optional)
- * 
- * An example:
- * 
- * {@example ../../examples/php/appender_mail.php 19}
- * 
- * {@example ../../examples/resources/appender_mail.properties 18}
- * 
- * The above will output something like:
- * <pre>
- *      Date: Tue,  8 Sep 2009 21:51:04 +0200 (CEST)
- *      From: someone@example.com
- *      To: root@localhost
- *      Subject: Log4php test
- *      
- *      Tue Sep  8 21:51:04 2009,120 [5485] FATAL root - Some critical message!
- *      Tue Sep  8 21:51:06 2009,120 [5485] FATAL root - Some more critical message!
- * </pre>
-
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */
-class LoggerAppenderMail extends LoggerAppender {
-
-	/** @var string 'from' field */
-	private $from = null;
-
-	/** @var string 'subject' field */
-	private $subject = 'Log4php Report';
-	
-	/** @var string 'to' field */
-	private $to = null;
-
-	/** @var indiciates if this appender should run in dry mode */
-	private $dry = false;
-
-	/** @var string used to create mail body */
-	private $body = '';
-	
-	/**
-	 * Constructor.
-	 *
-	 * @param string $name appender name
-	 */
-	public function __construct($name = '') {
-		parent::__construct($name);
-		$this->requiresLayout = true;
-	}
-
-	public function __destruct() {
-       $this->close();
-   	}
-
-	public function activateOptions() {
-		$this->closed = false;
-	}
-	
-	public function close() {
-		if($this->closed != true) {
-			$from = $this->from;
-			$to = $this->to;
-	
-			if(!empty($this->body) and $from !== null and $to !== null and $this->layout !== null) {
-				$subject = $this->subject;
-				if(!$this->dry) {
-					mail(
-						$to, $subject, 
-						$this->layout->getHeader() . $this->body . $this->layout->getFooter(),
-						"From: {$from}\r\n");
-				} else {
-				    echo "DRY MODE OF MAIL APP.: Send mail to: ".$to." with content: ".$this->body;
-				}
-			}
-			$this->closed = true;
-		}
-	}
-	
-	public function setSubject($subject) {
-		$this->subject = $subject;
-	}
-	
-	public function setTo($to) {
-		$this->to = $to;
-	}
-
-	public function setFrom($from) {
-		$this->from = $from;
-	}  
-
-	public function setDry($dry) {
-		$this->dry = $dry;
-	}
-	
-	public function append(LoggerLoggingEvent $event) {
-		if($this->layout !== null) {
-			$this->body .= $this->layout->format($event);
-		}
-	}
-}

+ 0 - 179
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderMailEvent.php

@@ -1,179 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Log every events as a separate email.
- * 
- * Configurable parameters for this appender are:
- * 
- * - layout             - Sets the layout class for this appender (required)
- * - to                 - Sets the recipient of the mail (required)
- * - from               - Sets the sender of the mail (optional)
- * - subject            - Sets the subject of the mail (optional)
- * - smtpHost           - Sets the mail server (optional, default is ini_get('SMTP'))
- * - port               - Sets the port of the mail server (optional, default is 25)
- *
- * An example:
- * 
- * {@example ../../examples/php/appender_mailevent.php 19}
- *  
- * {@example ../../examples/resources/appender_mailevent.properties 18}
- *
- * 
- * The above will output something like:
- * <pre>
- *      Date: Tue,  8 Sep 2009 21:51:04 +0200 (CEST)
- *      From: someone@example.com
- *      To: root@localhost
- *      Subject: Log4php test
- *
- *      Tue Sep  8 21:51:04 2009,120 [5485] FATAL root - Some critical message!
- * </pre>
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */
-class LoggerAppenderMailEvent extends LoggerAppender {
-
-	/**  'from' field (defaults to 'sendmail_from' from php.ini on win32).
-	 * @var string
-	 */
-	private $from = null;
-
-	/** Mailserver port (win32 only).
-	 * @var integer 
-	 */
-	private $port = 25;
-
-	/** Mailserver hostname (win32 only).
-	 * @var string   
-	 */
-	private $smtpHost = null;
-
-	/**
-	 * @var string 'subject' field
-	 */
-	private $subject = '';
-
-	/**
-	 * @var string 'to' field
-	 */
-	private $to = null;
-	
-	/**
-	 * @access private
-	 */
-	protected $requiresLayout = true;
-
-	/** @var indiciates if this appender should run in dry mode */
-	private $dry = false;
-	
-	/**
-	 * Constructor.
-	 *
-	 * @param string $name appender name
-	 */
-	public function __construct($name = '') {
-		parent::__construct($name);
-	}
-
-	public function __destruct() {
-       $this->close();
-   	}
-   	
-	public function activateOptions() {
-	    if (empty($this->layout)) {
-	        throw new LoggerException("LoggerAppenderMailEvent requires layout!");
-	    }
-	    if (empty($this->to)) {
-            throw new LoggerException("LoggerAppenderMailEvent was initialized with empty 'from' ($this->from) or 'to' ($this->to) Adress!");
-        }
-        
-        $sendmail_from = ini_get('sendmail_from');
-        if (empty($this->from) and empty($sendmail_from)) {
-            throw new LoggerException("LoggerAppenderMailEvent requires 'from' or on win32 at least the ini variable sendmail_from!");
-        }
-        
-        $this->closed = false;
-	}
-	
-	public function close() {
-		$this->closed = true;
-	}
-
-	public function setFrom($from) {
-		$this->from = $from;
-	}
-	
-	public function setPort($port) {
-		$this->port = (int)$port;
-	}
-	
-	public function setSmtpHost($smtpHost) {
-		$this->smtpHost = $smtpHost;
-	}
-	
-	public function setSubject($subject) {
-		$this->subject = $subject;
-	}
-	
-	public function setTo($to) {
-		$this->to = $to;
-	}
-
-	public function setDry($dry) {
-		$this->dry = $dry;
-	}
-	
-	public function append(LoggerLoggingEvent $event) {
-		$smtpHost = $this->smtpHost;
-		$prevSmtpHost = ini_get('SMTP');
-		if(!empty($smtpHost)) {
-			ini_set('SMTP', $smtpHost);
-		} 
-
-		$smtpPort = $this->port;
-		$prevSmtpPort= ini_get('smtp_port');		
-		if($smtpPort > 0 and $smtpPort < 65535) {
-			ini_set('smtp_port', $smtpPort);
-		}
-
-		// On unix only sendmail_path, which is PHP_INI_SYSTEM i.e. not changeable here, is used.
-
-		$addHeader = empty($this->from) ? '' : "From: {$this->from}\r\n";
-		
-		if(!$this->dry) {
-			$result = mail($this->to, $this->subject, 
-				$this->layout->getHeader() . $this->layout->format($event) . $this->layout->getFooter($event), 
-				$addHeader);			
-		    if ($result === false) {
-		        // The error message is only printed to stderr as warning. Any idea how to get it?
-		        throw new LoggerException("Error sending mail to '".$this->to."'!");
-		    }
-		} else {
-		    echo "DRY MODE OF MAIL APP.: Send mail to: ".$this->to." with additional headers '".trim($addHeader)."' and content: ".$this->layout->format($event);
-		}
-			
-		ini_set('SMTP', $prevSmtpHost);
-		ini_set('smtp_port', $prevSmtpPort);
-	}
-}
-

+ 0 - 60
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderNull.php

@@ -1,60 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * A NullAppender merely exists, it never outputs a message to any device.	
- *
- * This appender has no configurable parameters.
- * 
- * An example:
- * 
- * {@example ../../examples/php/appender_null.php 19}
- * 
- * {@example ../../examples/resources/appender_null.properties 18}
- * 
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */
-class LoggerAppenderNull extends LoggerAppender {
-
-	protected $requiresLayout = false;
-	
-	public function __destruct() {
-       $this->close();
-   	}
-   	
-	public function activateOptions() {
-		$this->closed = false;
-	}
-	
-	public function close() {
-		$this->closed = true;
-	}
-	
-	/**
-	 * Do nothing. 
-	 * 
-	 * @param LoggerLoggingEvent $event
-	 */
-	public function append(LoggerLoggingEvent $event) {
-	}
-}
-

+ 0 - 296
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderPDO.php

@@ -1,296 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Appends log events to a db table using PDO.
- *
- * Configurable parameters of this appender are:
- *
- * - user            - Sets the user of this database connection
- * - password        - Sets the password of this database connection
- * - createTable     - true, if the table should be created if necessary. false otherwise
- * - table           - Sets the table name (default: log4php_log)
- * - sql             - Sets the insert statement for a logging event. Defaults
- *                     to the correct one - change only if you are sure what you are doing.
- * - dsn             - Sets the DSN string for this connection
- *
- * If $sql is set then $table and $sql are used, else $table, $insertSql and $insertPattern.
- *
- * An example:
- *
- * {@example ../../examples/php/appender_pdo.php 19}
- * 
- * {@example ../../examples/resources/appender_pdo.properties 18}
- * 
- * @version $Revision: 806678 $
- * @package log4php
- * @subpackage appenders
- * @since 2.0
- */
-class LoggerAppenderPDO extends LoggerAppender {
-
-    /** Create the log table if it does not exists (optional).
-     * @var string */
-	private $createTable = true;
-    
-    /** Database user name.
-     * @var string */
-    private $user = '';
-    
-    /** Database password
-     * @var string */
-    private $password = '';
-    
-    /** DSN string for enabling a connection.
-     * @var string */
-    private $dsn;
-    
-    /** A {@link LoggerPatternLayout} string used to format a valid insert query.
-     * @deprecated Use {@link $insertSql} and {@link $insertPattern} which properly handle quotes in the messages!
-     * @var string */
-    private $sql;
-    
-    /** Can be set to a complete insert statement with ? that are replaced using {@link insertPattern}.
-     * @var string */
-    private $insertSql = "INSERT INTO __TABLE__ (timestamp, logger, level, message, thread, file, line) VALUES (?,?,?,?,?,?,?)";
-
-    /** A comma separated list of {@link LoggerPatternLayout} format strings that replace the "?" in {@link $sql}.
-     * @var string */
-    private $insertPattern = "%d,%c,%p,%m,%t,%F,%L";
-
-    /** Table name to write events. Used only for CREATE TABLE if {@link $createTable} is true.
-     * @var string */
-    private $table = 'log4php_log';
-    
-    /** The PDO instance.
-     * @var PDO */
-    private $db = null;
-    
-    /** Prepared statement for the INSERT INTO query.
-     * @var PDOStatement */
-    private $preparedInsert;
-
-    /** Set in activateOptions() and later used in append() to check if all conditions to append are true.
-     * @var boolean */
-    private $canAppend = true;
-    
-    /**
-     * Constructor.
-     * This apender doesn't require a layout.
-     * @param string $name appender name
-     */
-    public function __construct($name = '') {
-        parent::__construct($name);
-        $this->requiresLayout = false;
-    }
-    
-	public function __destruct() {
-       $this->close();
-   	}
-   	
-    /**
-     * Setup db connection.
-     * Based on defined options, this method connects to db defined in {@link $dsn}
-     * and creates a {@link $table} table if {@link $createTable} is true.
-     * @return boolean true if all ok.
-     * @throws a PDOException if the attempt to connect to the requested database fails.
-     */
-    public function activateOptions() {
-        try {
-        	if($this->user === null) {
-	           	$this->db = new PDO($this->dsn);
-    	   } else if($this->password === null) {
-    	       $this->db = new PDO($this->dsn, $this->user);
-    	   } else {
-    	       $this->db = new PDO($this->dsn,$this->user,$this->password);
-    	   }
-    	   $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-    	
-            // test if log table exists
-            try {
-                $result = $this->db->query('SELECT * FROM ' . $this->table . ' WHERE 1 = 0');
-            } catch (PDOException $e) {
-                // It could be something else but a "no such table" is the most likely
-                $result = false;
-            }
-            
-            // create table if necessary
-            if ($result == false and $this->createTable) {
-                // The syntax should at least be compatible with MySQL, PostgreSQL, SQLite and Oracle.
-                $query = "CREATE TABLE {$this->table} (".
-                            "timestamp varchar(32)," .
-            				"logger varchar(64)," .
-            										"level varchar(32)," .
-            				"message varchar(9999)," .
-            										"thread varchar(32)," .
-            				"file varchar(255)," .
-            				"line varchar(6))";
-                $result = $this->db->query($query);
-            }
-        } catch (PDOException $e) {
-            $this->canAppend = false;
-            throw new LoggerException($e);
-        }
-        
-        $this->layout = new LoggerLayoutPattern();
-        
-        //
-        // Keep compatibility to legacy option $sql which already included the format patterns!
-        //
-        if (empty($this->sql)) {
-            // new style with prepared Statment and $insertSql and $insertPattern
-            // Maybe the tablename has to be substituted.
-            $this->insertSql = preg_replace('/__TABLE__/', $this->table, $this->insertSql);
-            $this->preparedInsert = $this->db->prepare($this->insertSql);
-            $this->layout->setConversionPattern($this->insertPattern);
-        } else {
-            // Old style with format strings in the $sql query should be used.
-        $this->layout->setConversionPattern($this->sql);
-        }
-
-        $this->canAppend = true;
-        return true;
-    }
-    
-    /**
-     * Appends a new event to the database.
-     * 
-     * @throws LoggerException      If the pattern conversion or the INSERT statement fails.
-     */
-    public function append(LoggerLoggingEvent $event) {
-        // TODO: Can't activateOptions() simply throw an Exception if it encounters problems?
-        if ( ! $this->canAppend) return;
-
-            try {
-            if (empty($this->sql)) {
-                // new style with prepared statement
-                $params = $this->layout->formatToArray($event);
-                $this->preparedInsert->execute($params);
-            } else {
-                // old style
-                $query = $this->layout->format($event);
-                $this->db->exec($query);
-            }
-            } catch (Exception $e) {
-                throw new LoggerException($e);
-            }
-        }
-    
-    /**
-     * Closes the connection to the logging database
-     */
-    public function close() {
-    	if($this->closed != true) {
-        	if ($this->db !== null) {
-            	$db = null;
-        	}
-        	$this->closed = true;
-    	}
-    }
-    
-    /**
-     * Sets the username for this connection. 
-     * Defaults to ''
-     */
-    public function setUser($user) {
-        $this->user = $user;
-    }
-    
-    /**
-     * Sets the password for this connection. 
-     * Defaults to ''
-     */
-    public function setPassword($password) {
-        $this->password = $password;
-    }
-    
-    /**
-     * Indicator if the logging table should be created on startup,
-     * if its not existing.
-     */
-    public function setCreateTable($flag) {
-        $this->createTable = LoggerOptionConverter::toBoolean($flag, true);
-    }
-   
-   	/**
-     * Sets the SQL string into which the event should be transformed.
-     * Defaults to:
-     * 
-     * INSERT INTO $this->table 
-     * ( timestamp, logger, level, message, thread, file, line) 
-     * VALUES 
-     * ('%d','%c','%p','%m','%t','%F','%L')
-     * 
-     * It's not necessary to change this except you have customized logging'
-     *
-     * @deprecated See {@link setInsertSql} and {@link setInsertPattern}.
-     */
-    public function setSql($sql) {
-        $this->sql = $sql;    
-    }
-    
-    /**
-     * Sets the SQL INSERT string to use with {@link $insertPattern}.
-     *
-     * @param $sql          A complete INSERT INTO query with "?" that gets replaced.
-     */
-    public function setInsertSql($sql) {
-        $this->insertSql = $sql;
-    }
-
-    /**
-     * Sets the {@link LoggerLayoutPattern} format strings for {@link $insertSql}.
-     *
-     * It's not necessary to change this except you have customized logging.
-     *
-     * @param $pattern          Comma separated format strings like "%p,%m,%C"
-     */
-    public function setInsertPattern($pattern) {
-        $this->insertPattern = $pattern;
-    }
-
-    /**
-     * Sets the tablename to which this appender should log.
-     * Defaults to log4php_log
-     */
-    public function setTable($table) {
-        $this->table = $table;
-    }
-    
-    /**
-     * Sets the DSN string for this connection. In case of
-     * SQLite it could look like this: 'sqlite:appenders/pdotest.sqlite'
-     */
-    public function setDSN($dsn) {
-        $this->dsn = $dsn;
-    }
-    
-    /**
-     * Sometimes databases allow only one connection to themselves in one thread.
-     * SQLite has this behaviour. In that case this handle is needed if the database
-     * must be checked for events.
-     *
-     * @return PDO
-     */
-    public function getDatabaseHandle() {
-        return $this->db;
-    }
-}
-

+ 0 - 72
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderPhp.php

@@ -1,72 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Log events using php {@link PHP_MANUAL#trigger_error} function and a {@link LoggerLayoutTTCC} default layout.
- *
- * This appender has no configurable parameters.
- *
- * <p>Levels are mapped as follows:</p>
- * - <b>level &lt; WARN</b> mapped to E_USER_NOTICE
- * - <b>WARN &lt;= level &lt; ERROR</b> mapped to E_USER_WARNING
- * - <b>level &gt;= ERROR</b> mapped to E_USER_ERROR  
- *
- * An example:
- * 
- * {@example ../../examples/php/appender_php.php 19}
- * 
- * {@example ../../examples/resources/appender_php.properties 18}
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */ 
-class LoggerAppenderPhp extends LoggerAppender {
-
-	public function __construct($name = '') {
-		parent::__construct($name);
-		$this->requiresLayout = true;
-	}
-	
-	public function __destruct() {
-       $this->close();
-   	}
-	
-	public function activateOptions() {
-		$this->closed = false;
-	}
-
-	public function close() {
-		$this->closed = true;
-	}
-
-	public function append(LoggerLoggingEvent $event) {
-		if($this->layout !== null) {
-			$level = $event->getLevel();
-			if($level->isGreaterOrEqual(LoggerLevel::getLevelError())) {
-				trigger_error($this->layout->format($event), E_USER_ERROR);
-			} else if ($level->isGreaterOrEqual(LoggerLevel::getLevelWarn())) {
-				trigger_error($this->layout->format($event), E_USER_WARNING);
-			} else {
-				trigger_error($this->layout->format($event), E_USER_NOTICE);
-			}
-		}
-	}
-}

+ 0 - 230
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderRollingFile.php

@@ -1,230 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * LoggerAppenderRollingFile extends LoggerAppenderFile to backup the log files 
- * when they reach a certain size.
- *
- * Parameters are:
- *
- * - layout            - Sets the layout class for this appender
- * - file              - The target file to write to
- * - filename          - The target file to write to
- * - append            - Sets if the appender should append to the end of the file or overwrite content ("true" or "false")
- * - maxBackupIndex    - Set the maximum number of backup files to keep around (int)
- * - maxFileSize       - Set the maximum size that the output file is allowed to
- *                       reach before being rolled over to backup files.
- *                       Suffixes like "KB", "MB" or "GB" are allowed, f. e. "10KB" is interpreted as 10240
- * - maximumFileSize   - Alias to MaxFileSize
- *
- * <p>Contributors: Sergio Strampelli.</p>
- *
- * An example:
- *
- * {@example ../../examples/php/appender_socket.php 19}
- *
- * {@example ../../examples/resources/appender_socket.properties 18}
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */
-class LoggerAppenderRollingFile extends LoggerAppenderFile {
-
-	/**
-	 * Set the maximum size that the output file is allowed to reach
-	 * before being rolled over to backup files.
-	 *
-	 * <p>In configuration files, the <var>MaxFileSize</var> option takes a
-	 * long integer in the range 0 - 2^63. You can specify the value
-	 * with the suffixes "KB", "MB" or "GB" so that the integer is
-	 * interpreted being expressed respectively in kilobytes, megabytes
-	 * or gigabytes. For example, the value "10KB" will be interpreted
-	 * as 10240.</p>
-	 * <p>The default maximum file size is 10MB.</p>
-	 *
-	 * <p>Note that MaxFileSize cannot exceed <b>2 GB</b>.</p>
-	 *
-	 * @var integer
-	 */
-	private $maxFileSize = 10485760;
-	
-	/**
-	 * Set the maximum number of backup files to keep around.
-	 * 
-	 * <p>The <var>MaxBackupIndex</var> option determines how many backup
-	 * files are kept before the oldest is erased. This option takes
-	 * a positive integer value. If set to zero, then there will be no
-	 * backup files and the log file will be truncated when it reaches
-	 * MaxFileSize.</p>
-	 * <p>There is one backup file by default.</p>
-	 *
-	 * @var integer 
-	 */
-	private $maxBackupIndex	 = 1;
-	
-	/**
-	 * @var string the filename expanded
-	 * @access private
-	 */
-	private $expandedFileName = null;
-
-	public function __destruct() {
-       parent::__destruct();
-   	}
-   	
-	/**
-	 * Returns the value of the MaxBackupIndex option.
-	 * @return integer 
-	 */
-	private function getExpandedFileName() {
-		return $this->expandedFileName;
-	}
-
-	/**
-	 * Get the maximum size that the output file is allowed to reach
-	 * before being rolled over to backup files.
-	 * @return integer
-	 */
-	private function getMaximumFileSize() {
-		return $this->maxFileSize;
-	}
-
-	/**
-	 * Implements the usual roll over behaviour.
-	 *
-	 * <p>If MaxBackupIndex is positive, then files File.1, ..., File.MaxBackupIndex -1 are renamed to File.2, ..., File.MaxBackupIndex. 
-	 * Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.
-	 * 
-	 * <p>If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.
-	 */
-	private function rollOver() {
-		// If maxBackups <= 0, then there is no file renaming to be done.
-		if($this->maxBackupIndex > 0) {
-			$fileName = $this->getExpandedFileName();
-			// Delete the oldest file, to keep Windows happy.
-			$file = $fileName . '.' . $this->maxBackupIndex;
-			if(is_writable($file))
-				unlink($file);
-			// Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
-			for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
-				$file = $fileName . "." . $i;
-				if(is_readable($file)) {
-					$target = $fileName . '.' . ($i + 1);
-					rename($file, $target);
-				}
-			}
-	
-			$this->close();
-	
-			// Rename fileName to fileName.1
-			$target = $fileName . ".1";
-			$file = $fileName;
-			rename($file, $target);
-		}
-		
-		//unset($this->fp);
-		$this->activateOptions();
-		$this->setFile($fileName, false);
-	}
-	
-	public function setFileName($fileName) {
-		$this->fileName = $fileName;
-		// As LoggerAppenderFile does not create the directory, it has to exist.
-		// realpath() fails if the argument does not exist so the filename is separated.
-		$this->expandedFileName = realpath(dirname($fileName));
-		if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!");
-		$this->expandedFileName .= '/'.basename($fileName);
-	}
-
-
-	/**
-	 * Set the maximum number of backup files to keep around.
-	 * 
-	 * <p>The <b>MaxBackupIndex</b> option determines how many backup
-	 * files are kept before the oldest is erased. This option takes
-	 * a positive integer value. If set to zero, then there will be no
-	 * backup files and the log file will be truncated when it reaches
-	 * MaxFileSize.
-	 *
-	 * @param mixed $maxBackups
-	 */
-	public function setMaxBackupIndex($maxBackups) {
-		if(is_numeric($maxBackups)) {
-			$this->maxBackupIndex = abs((int)$maxBackups);
-		}
-	}
-
-	/**
-	 * Set the maximum size that the output file is allowed to reach
-	 * before being rolled over to backup files.
-	 *
-	 * @param mixed $maxFileSize
-	 * @see setMaxFileSize()
-	 * @deprecated
-	 */
-	public function setMaximumFileSize($maxFileSize) {
-		return $this->setMaxFileSize($maxFileSize);
-	}
-
-	/**
-	 * Set the maximum size that the output file is allowed to reach
-	 * before being rolled over to backup files.
-	 * <p>In configuration files, the <b>MaxFileSize</b> option takes an
-	 * long integer in the range 0 - 2^63. You can specify the value
-	 * with the suffixes "KB", "MB" or "GB" so that the integer is
-	 * interpreted being expressed respectively in kilobytes, megabytes
-	 * or gigabytes. For example, the value "10KB" will be interpreted
-	 * as 10240.
-	 *
-	 * @param mixed $value
-	 * @return the actual file size set
-	 */
-	public function setMaxFileSize($value) {
-		$maxFileSize = null;
-		$numpart = substr($value,0, strlen($value) -2);
-		$suffix = strtoupper(substr($value, -2));
-
-		switch($suffix) {
-			case 'KB': $maxFileSize = (int)((int)$numpart * 1024); break;
-			case 'MB': $maxFileSize = (int)((int)$numpart * 1024 * 1024); break;
-			case 'GB': $maxFileSize = (int)((int)$numpart * 1024 * 1024 * 1024); break;
-			default:
-				if(is_numeric($value)) {
-					$maxFileSize = (int)$value;
-				}
-		}
-		
-		if($maxFileSize !== null) {
-			$this->maxFileSize = abs($maxFileSize);
-		}
-		return $this->maxFileSize;
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 */
-	public function append(LoggerLoggingEvent $event) {
-		parent::append($event);
-		if(ftell($this->fp) > $this->getMaximumFileSize()) {
-			$this->rollOver();
-		}
-	}
-}

+ 0 - 260
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderSocket.php

@@ -1,260 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Serialize events and send them to a network socket.
- *
- * This appender can be configured by changing the following attributes:
- * 
- * - locationInfo       - Sets the location info for the xml layout (true or false)
- * - log4jNamespace     - Sets the namespace for log4j (true or false)
- * - port               - Sets the port of the socket.
- * - remoteHost         - Sets the remote host
- * - timeout            - Sets the timeout in ms
- * - useXml             - true, if xml should be transmitted.
- *                        false, if a serialized php object should be transmitted
- *
- * Parameters are {@link $remoteHost}, {@link $port}, {@link $timeout}, 
- * {@link $locationInfo}, {@link $useXml} and {@link $log4jNamespace}.
- *
- * An example:
- * 
- * {@example ../../examples/php/appender_socket.php 19}
- * 
- * {@example ../../examples/resources/appender_socket.properties 18}
- * 
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */ 
-class LoggerAppenderSocket extends LoggerAppender {
-
-	/**
-	 * @var mixed socket connection resource
-	 * @access private
-	 */
-	private $sp = false;
-	
-	/**
-	 * Target host. On how to define remote hostaname see 
-	 * {@link PHP_MANUAL#fsockopen}
-	 * @var string 
-	 */
-	private $remoteHost = '';
-	
-	/**
-	 * @var integer the network port.
-	 */
-	private $port = 4446;
-	
-	/**
-	 * @var boolean get event's location info.
-	 */
-	private $locationInfo = false;
-	
-	/**
-	 * @var integer connection timeout
-	 */
-	private $timeout = 30;
-	
-	/**
-	 * @var boolean output events via {@link LoggerXmlLayout}
-	 */
-	private $useXml = false;
-	
-	/**
-	 * @var boolean forward this option to {@link LoggerXmlLayout}. 
-	 *				Ignored if {@link $useXml} is <i>false</i>.
-	 */
-	private $log4jNamespace = false;
-
-	/**
-	 * @var LoggerXmlLayout
-	 * @access private
-	 */
-	private $xmlLayout = null;
-	
-	/** @var indiciates if this appender should run in dry mode */
-	private $dry = false;
-	
-	public function __destruct() {
-       $this->close();
-   	}
-   	
-	/**
-	 * Create a socket connection using defined parameters
-	 */
-	public function activateOptions() {
-		if(!$this->dry) {
-			$this->sp = @fsockopen($this->getRemoteHost(), $this->getPort(), $errno, $errstr, $this->getTimeout());
-			if ($this->sp === false) {
-			    throw new LoggerException("Could not open socket to ".$this->getRemoteHost().":".$this->getPort().": $errstr ($errno)");
-			}
-		}
-		if($this->getUseXml()) {
-			$this->xmlLayout = LoggerReflectionUtils::createObject('LoggerLayoutXml');
-			if($this->xmlLayout === null) {
-				$this->setUseXml(false);
-			} else {
-				$this->xmlLayout->setLocationInfo($this->getLocationInfo());
-				$this->xmlLayout->setLog4jNamespace($this->getLog4jNamespace());
-				$this->xmlLayout->activateOptions();
-			}			 
-		}
-        $this->closed = false;
-	}
-	
-	public function close() {
-		if($this->closed != true) {
-			if(!$this->dry and $this->sp !== false) {
-				fclose($this->sp);
-			}
-			$this->closed = true;
-		}
-	}
-
-	public function setDry($dry) {
-		$this->dry = $dry;
-	}
-	
-	/**
-	 * @return string
-	 */
-	public function getHostname() {
-		return $this->getRemoteHost();
-	}
-	
-	/**
-	 * @return boolean
-	 */
-	public function getLocationInfo() {
-		return $this->locationInfo;
-	} 
-	 
-	/**
-	 * @return boolean
-	 */
-	public function getLog4jNamespace() {
-		return $this->log4jNamespace;
-	}
-
-	/**
-	 * @return integer
-	 */
-	public function getPort() {
-		return $this->port;
-	}
-	
-	public function getRemoteHost() {
-		return $this->remoteHost;
-	}
-	
-	/**
-	 * @return integer
-	 */
-	public function getTimeout() {
-		return $this->timeout;
-	}
-	
-	/**
-	 * @var boolean
-	 */
-	public function getUseXml() {
-		return $this->useXml;
-	} 
-	 
-	public function reset() {
-		$this->close();
-		parent::reset();
-	}
-
-	/**
-	 * @param mixed
-	 */
-	public function setLocationInfo($flag) {
-		$this->locationInfo = LoggerOptionConverter::toBoolean($flag, $this->getLocationInfo());
-	} 
-
-	/**
-	 * @param mixed
-	 */
-	public function setLog4jNamespace($flag) {
-		$this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, $this->getLog4jNamespace());
-	} 
-			
-	/**
-	 * @param integer
-	 */
-	public function setPort($port) {
-		$port = LoggerOptionConverter::toInt($port, 0);
-		if($port > 0 and $port < 65535) {
-			$this->port = $port;	
-		}
-	}
-	
-	/**
-	 * @param string
-	 */
-	public function setRemoteHost($hostname) {
-		$this->remoteHost = $hostname;
-	}
-	
-	/**
-	 * @param integer
-	 */
-	public function setTimeout($timeout) {
-		$this->timeout = LoggerOptionConverter::toInt($timeout, $this->getTimeout());
-	}
-	
-	/**
-	 * @param mixed
-	 */
-	public function setUseXml($flag) {
-		$this->useXml = LoggerOptionConverter::toBoolean($flag, $this->getUseXml());
-	} 
- 
-	public function append(LoggerLoggingEvent $event) {
-		if($this->sp || $this->dry) {
-			if($this->getLocationInfo()) {
-				$event->getLocationInformation();
-			}
-		
-			if(!$this->getUseXml()) {
-				$sEvent = serialize($event);
-				if(!$this->dry) {
-					fwrite($this->sp, $sEvent, strlen($sEvent));
-				} else {
-				    echo "DRY MODE OF SOCKET APPENDER: ".$sEvent;
-				}
-			} else {
-				if(!$this->dry) {
-					fwrite($this->sp, $this->xmlLayout->format($event));
-				} else {
-				    echo "DRY MODE OF SOCKET APPENDER: ".$this->xmlLayout->format($event);
-				}
-			}			 
-
-			// not sure about it...
-			if(!$this->dry) {
-				fflush($this->sp);
-			}
-		} 
-	}
-}

+ 0 - 212
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderSyslog.php

@@ -1,212 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Log events using php {@link PHP_MANUAL#syslog} function.
- *
- * This appender can be configured by changing the following attributes:
- * 
- * - layout           - Sets the layout class for this appender
- * - ident            - Set the ident of the syslog message.
- * - priority         - Set the priority value for the syslog message.
- * - facility         - Set the facility value for the syslog message
- * - overridePriority - If the priority of the message to be sent can be 
- *                      defined by a value in the properties-file, set 
- *                      parameter value to "true"
- * - option           - Set the option value for the syslog message. 
- *                      This value is used as a parameter for php openlog()
- *                      and passed on to the syslog daemon.
- *
- * Levels are mapped as follows:
- * - <b>level >= FATAL</b> to LOG_ALERT
- * - <b>FATAL > level >= ERROR</b> to LOG_ERR 
- * - <b>ERROR > level >= WARN</b> to LOG_WARNING
- * - <b>WARN  > level >= INFO</b> to LOG_INFO
- * - <b>INFO  > level >= DEBUG</b> to LOG_DEBUG
- *
- * An example:
- *
- * {@example ../../examples/php/appender_syslog.php 19}
- *
- * {@example ../../examples/resources/appender_syslog.properties 18}
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage appenders
- */ 
-class LoggerAppenderSyslog extends LoggerAppender {
-	
-	/**
-	 * The ident string is added to each message. Typically the name of your application.
-	 *
-	 * @var string Ident for your application
-	 */
-	private $_ident = "Log4PHP Syslog-Event";
-
-	/**
-	 * The priority parameter value indicates the level of importance of the message.
-	 * It is passed on to the Syslog daemon.
-	 * 
-	 * @var int Syslog priority
-	 */
-	private $_priority;
-	
-	/**
-	 * The option used when generating a log message.
-	 * It is passed on to the Syslog daemon.
-	 * 
-	 * @var int Syslog priority
-	 */
-	private $_option;
-	
-	/**
-	 * The facility value indicates the source of the message.
-	 * It is passed on to the Syslog daemon.
-	 *
-	 * @var const int Syslog facility
-	 */
-	private $_facility;
-	
-	/**
-	 * If it is necessary to define logging priority in the .properties-file,
-	 * set this variable to "true".
-	 *
-	 * @var const int  value indicating whether the priority of the message is defined in the .properties-file
-	 *				   (or properties-array)
-	 */
-	private $_overridePriority;
-
-	/** @var indiciates if this appender should run in dry mode */
-	private $dry = false;
-
-	public function __construct($name = '') {
-		parent::__construct($name);
-		$this->requiresLayout = true;
-	}
-
-	public function __destruct() {
-       $this->close();
-   	}
-   	
-   	public function setDry($dry) {
-		$this->dry = $dry;
-	}
-	
-	/**
-	 * Set the ident of the syslog message.
-	 *
-	 * @param string Ident
-	 */
-	public function setIdent($ident) {
-		$this->_ident = $ident; 
-	}
-
-	/**
-	 * Set the priority value for the syslog message.
-	 *
-	 * @param const int Priority
-	 */
-	public function setPriority($priority) {
-		$this->_priority = $priority;
-	}
-	
-	
-	/**
-	 * Set the facility value for the syslog message.
-	 *
-	 * @param const int Facility
-	 */
-	public function setFacility($facility) {
-		$this->_facility = $facility;
-	} 
-	
-	/**
-	 * If the priority of the message to be sent can be defined by a value in the properties-file, 
-	 * set parameter value to "true".
-	 *
-	 * @param bool Override priority
-	 */
-	public function setOverridePriority($overridePriority) {
-		$this->_overridePriority = $overridePriority;							
-	} 
-	
-	/**
-	 * Set the option value for the syslog message.
-	 * This value is used as a parameter for php openlog()	
-	 * and passed on to the syslog daemon.
-	 *
-	 * @param string	$option
-	 */
-	public function setOption($option) {	  
-		$this->_option = $option;		
-	}
-	
-	public function activateOptions() {
-		// Deprecated as of 5.3 and removed in 6.0
-		// define_syslog_variables();
-		$this->closed = false;
-	}
-
-	public function close() {
-		if($this->closed != true) {
-			closelog();
-			$this->closed = true;
-		}
-	}
-
-	public function append(LoggerLoggingEvent $event) {
-		if($this->_option == NULL){
-			$this->_option = LOG_PID | LOG_CONS;
-		}
-		
-		$level	 = $event->getLevel();
-		if($this->layout === null) {
-			$message = $event->getRenderedMessage();
-		} else {
-			$message = $this->layout->format($event); 
-		}
-
-		// If the priority of a syslog message can be overridden by a value defined in the properties-file,
-		// use that value, else use the one that is defined in the code.
-		if(!$this->dry) {
-			// Attach the process ID to the message, use the facility defined in the .properties-file
-			openlog($this->_ident, $this->_option, $this->_facility);
-		
-			if($this->_overridePriority) {
-				syslog($this->_priority, $message);			   
-			} else {
-				if($level->isGreaterOrEqual(LoggerLevel::getLevelFatal())) {
-					syslog(LOG_ALERT, $message);
-				} else if ($level->isGreaterOrEqual(LoggerLevel::getLevelError())) {
-					syslog(LOG_ERR, $message);		  
-				} else if ($level->isGreaterOrEqual(LoggerLevel::getLevelWarn())) {
-					syslog(LOG_WARNING, $message);
-				} else if ($level->isGreaterOrEqual(LoggerLevel::getLevelInfo())) {
-					syslog(LOG_INFO, $message);
-				} else if ($level->isGreaterOrEqual(LoggerLevel::getLevelDebug())) {
-					syslog(LOG_DEBUG, $message);
-				}
-			}
-			closelog();
-		} else {
-		      echo "DRY MODE OF SYSLOG APPENDER: ".$message;
-		}
-	}
-}

+ 0 - 47
main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorBasic.php

@@ -1,47 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Use this class to quickly configure the package.
- *
- * An example how to use this configurator:
- * 
- * {@example ../../examples/php/configurator_basic.php 19}
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage configurators
- */
-class LoggerConfiguratorBasic implements LoggerConfigurator {
-
-	/**
-	 * Add a {@link LoggerAppenderConsole} that uses 
-	 * the {@link LoggerLayoutTTCC} to the root category.
-	 * 
-	 * @param string $url not used here
-	 */
-	public function configure(LoggerHierarchy $hierarchy, $url = null) {
-		$root = $hierarchy->getRootLogger();
-		$appender = new LoggerAppenderConsole('A1');
-		$appender->setLayout( new LoggerLayoutTTCC() );
-		$appender->activateOptions();
-		$root->addAppender($appender);
-	}
-}

+ 0 - 463
main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorIni.php

@@ -1,463 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Allows the configuration of log4php from an external file.
- * 
- * <p>This is the most commonly used method of configuring log4php.</p>
- * 
- * <p>It is sometimes useful to see how log4php is reading configuration
- * files. You can enable log4php internal logging by defining the
- * <b>log4php.debug</b> variable.</p>
- *
- * <p>The <i>LoggerConfiguratorIni</i> does not handle the
- * advanced configuration features supported by the {@link LoggerConfiguratorXml} 
- * such as support for {@link LoggerFilter}, 
- * custom {@link LoggerErrorHandlers}, nested appenders such as the {@link Logger AsyncAppender}, 
- * etc.</p>
- * 
- * <p>All option <i>values</i> admit variable substitution. The
- * syntax of variable substitution is similar to that of Unix
- * shells. The string between an opening <b>"${"</b> and
- * closing <b>"}"</b> is interpreted as a key. The value of
- * the substituted variable can be defined as a system property or in
- * the configuration file itself. The value of the key is first
- * searched in the defined constants, in the enviroments variables
- * and if not found there, it is
- * then searched in the configuration file being parsed.  The
- * corresponding value replaces the ${variableName} sequence.</p>
- * <p>For example, if <b>$_ENV['home']</b> env var is set to
- * <b>/home/xyz</b>, then every occurrence of the sequence
- * <b>${home}</b> will be interpreted as
- * <b>/home/xyz</b>. See {@link LoggerOptionConverter::getSystemProperty()}
- * for details.</p>
- *
- * <p>An example how to use this appender:</p>
- *
- * {@example ../../examples/php/appender_dailyfile.php 19}
- *
- * <p>And the corresponding ini file:</p>
- *
- * {@example ../../examples/resources/appender_dailyfile.properties 18}
- *
- * @version $Revision: 883104 $
- * @package log4php
- * @subpackage configurators
- * @since 0.5
- */
-class LoggerConfiguratorIni implements LoggerConfigurator {
- 	const CATEGORY_PREFIX = "log4php.category.";
- 	const LOGGER_PREFIX = "log4php.logger.";
-	const FACTORY_PREFIX = "log4php.factory";
-	const ADDITIVITY_PREFIX = "log4php.additivity.";
-	const ROOT_CATEGORY_PREFIX = "log4php.rootCategory";
-	const ROOT_LOGGER_PREFIX = "log4php.rootLogger";
-	const APPENDER_PREFIX = "log4php.appender.";
-	const RENDERER_PREFIX = "log4php.renderer.";
-	const THRESHOLD_PREFIX = "log4php.threshold";
-	
-	/** 
-	 * Key for specifying the {@link LoggerFactory}.  
-	 */
-	const LOGGER_FACTORY_KEY = "log4php.loggerFactory";
-	const LOGGER_DEBUG_KEY = "log4php.debug";
-	const INTERNAL_ROOT_NAME = "root";
-	
-	/**
-	 * Constructor
-	 */
-	public function __construct() {
-	}
-
-	/**
-	 * Read configuration from a file.
-	 *
-	 * <p>The function {@link PHP_MANUAL#parse_ini_file} is used to read the
-	 * file.</p>
-	 *
-	 * <b>The existing configuration is not cleared nor reset.</b> 
-	 * If you require a different behavior, then call 
-	 * {@link  Logger::resetConfiguration()} 
-	 * method before calling {@link doConfigure()}.
-	 * 
-	 * <p>The configuration file consists of statements in the format
-	 * <b>key=value</b>. The syntax of different configuration
-	 * elements are discussed below.
-	 * 
-	 * <p><b>Repository-wide threshold</b></p>
-	 * 
-	 * <p>The repository-wide threshold filters logging requests by level
-	 * regardless of logger. The syntax is:
-	 * 
-	 * <pre>
-	 * log4php.threshold=[level]
-	 * </pre>
-	 * 
-	 * <p>The level value can consist of the string values OFF, FATAL,
-	 * ERROR, WARN, INFO, DEBUG, ALL or a <i>custom level</i> value. A
-	 * custom level value can be specified in the form
-	 * <samp>level#classname</samp>. By default the repository-wide threshold is set
-	 * to the lowest possible value, namely the level <b>ALL</b>.
-	 * </p>
-	 * 
-	 * 
-	 * <p><b>Appender configuration</b></p>
-	 * 
-	 * <p>Appender configuration syntax is:</p>
-	 * <pre>
-	 * ; For appender named <i>appenderName</i>, set its class.
-	 * ; Note: The appender name can contain dots.
-	 * log4php.appender.appenderName=name_of_appender_class
-	 * 
-	 * ; Set appender specific options.
-	 * 
-	 * log4php.appender.appenderName.option1=value1
-	 * log4php.appender.appenderName.optionN=valueN
-	 * </pre>
-	 * 
-	 * For each named appender you can configure its {@link LoggerLayout}. The
-	 * syntax for configuring an appender's layout is:
-	 * <pre>
-	 * log4php.appender.appenderName.layout=name_of_layout_class
-	 * log4php.appender.appenderName.layout.option1=value1
-	 *	....
-	 * log4php.appender.appenderName.layout.optionN=valueN
-	 * </pre>
-	 * 
-	 * <p><b>Configuring loggers</b></p>
-	 * 
-	 * <p>The syntax for configuring the root logger is:
-	 * <pre>
-	 * log4php.rootLogger=[level], appenderName, appenderName, ...
-	 * </pre>
-	 * 
-	 * <p>This syntax means that an optional <i>level</i> can be
-	 * supplied followed by appender names separated by commas.
-	 * 
-	 * <p>The level value can consist of the string values OFF, FATAL,
-	 * ERROR, WARN, INFO, DEBUG, ALL or a <i>custom level</i> value. A
-	 * custom level value can be specified in the form</p>
-	 *
-	 * <pre>level#classname</pre>
-	 * 
-	 * <p>If a level value is specified, then the root level is set
-	 * to the corresponding level.	If no level value is specified,
-	 * then the root level remains untouched.
-	 * 
-	 * <p>The root logger can be assigned multiple appenders.
-	 * 
-	 * <p>Each <i>appenderName</i> (separated by commas) will be added to
-	 * the root logger. The named appender is defined using the
-	 * appender syntax defined above.
-	 * 
-	 * <p>For non-root categories the syntax is almost the same:
-	 * <pre>
-	 * log4php.logger.logger_name=[level|INHERITED|NULL], appenderName, appenderName, ...
-	 * </pre>
-	 * 
-	 * <p>The meaning of the optional level value is discussed above
-	 * in relation to the root logger. In addition however, the value
-	 * INHERITED can be specified meaning that the named logger should
-	 * inherit its level from the logger hierarchy.</p>
-	 * 
-	 * <p>If no level value is supplied, then the level of the
-	 * named logger remains untouched.</p>
-	 * 
-	 * <p>By default categories inherit their level from the
-	 * hierarchy. However, if you set the level of a logger and later
-	 * decide that that logger should inherit its level, then you should
-	 * specify INHERITED as the value for the level value. NULL is a
-	 * synonym for INHERITED.</p>
-	 * 
-	 * <p>Similar to the root logger syntax, each <i>appenderName</i>
-	 * (separated by commas) will be attached to the named logger.</p>
-	 * 
-	 * <p>See the <i>appender additivity rule</i> in the user manual for 
-	 * the meaning of the <b>additivity</b> flag.
-	 * 
-	 * <p><b>ObjectRenderers</b></p>
-	 * 
-	 * <p>You can customize the way message objects of a given type are
-	 * converted to String before being logged. This is done by
-	 * specifying a {@link LoggerRendererObject}
-	 * for the object type would like to customize.</p>
-	 * 
-	 * <p>The syntax is:
-	 * 
-	 * <pre>
-	 * log4php.renderer.name_of_rendered_class=name_of_rendering.class
-	 * </pre>
-	 * 
-	 * As in,
-	 * <pre>
-	 * log4php.renderer.myFruit=myFruitRenderer
-	 * </pre>
-	 * 
-	 * <p><b>Logger Factories</b></p>
-	 * 
-	 * The usage of custom logger factories is discouraged and no longer
-	 * documented.
-	 * 
-	 * <p><b>Example</b></p>
-	 * 
-	 * <p>An example configuration is given below. Other configuration
-	 * file examples are given in the <b>tests</b> folder.
-	 * 
-	 * <pre>
-	 * ; Set options for appender named "A1".
-	 * ; Appender "A1" will be a LoggerAppenderSyslog
-	 * log4php.appender.A1=LoggerAppenderSyslog
-	 * 
-	 * ; The syslog daemon resides on www.abc.net
-	 * log4php.appender.A1.ident=log4php-test
-	 * 
-	 * ; A1's layout is a LoggerPatternLayout, using the conversion pattern
-	 * ; <b>%r %-5p %c{2} %M.%L %x - %m%n</b>. Thus, the log output will
-	 * ; include the relative time since the start of the application in
-	 * ; milliseconds, followed by the level of the log request,
-	 * ; followed by the two rightmost components of the logger name,
-	 * ; followed by the callers method name, followed by the line number,
-	 * ; the nested disgnostic context and finally the message itself.
-	 * ; Refer to the documentation of LoggerPatternLayout} for further information
-	 * ; on the syntax of the ConversionPattern key.
-	 * log4php.appender.A1.layout=LoggerPatternLayout
-	 * log4php.appender.A1.layout.ConversionPattern="%-4r %-5p %c{2} %M.%L %x - %m%n"
-	 * 
-	 * ; Set options for appender named "A2"
-	 * ; A2 should be a LoggerAppenderRollingFile, with maximum file size of 10 MB
-	 * ; using at most one backup file. A2's layout is TTCC, using the
-	 * ; ISO8061 date format with context printing enabled.
-	 * log4php.appender.A2=LoggerAppenderRollingFile
-	 * log4php.appender.A2.MaxFileSize=10MB
-	 * log4php.appender.A2.MaxBackupIndex=1
-	 * log4php.appender.A2.layout=LoggerLayoutTTCC
-	 * log4php.appender.A2.layout.ContextPrinting="true"
-	 * log4php.appender.A2.layout.DateFormat="%c"
-	 * 
-	 * ; Root logger set to DEBUG using the A2 appender defined above.
-	 * log4php.rootLogger=DEBUG, A2
-	 * 
-	 * ; Logger definitions:
-	 * ; The SECURITY logger inherits is level from root. However, it's output
-	 * ; will go to A1 appender defined above. It's additivity is non-cumulative.
-	 * log4php.logger.SECURITY=INHERIT, A1
-	 * log4php.additivity.SECURITY=false
-	 * 
-	 * ; Only warnings or above will be logged for the logger "SECURITY.access".
-	 * ; Output will go to A1.
-	 * log4php.logger.SECURITY.access=WARN
-	 * 
-	 * 
-	 * ; The logger "class.of.the.day" inherits its level from the
-	 * ; logger hierarchy.	Output will go to the appender's of the root
-	 * ; logger, A2 in this case.
-	 * log4php.logger.class.of.the.day=INHERIT
-	 * </pre>
-	 * 
-	 * <p>Refer to the <b>setOption</b> method in each Appender and
-	 * Layout for class specific options.</p>
-	 * 
-	 * <p>Use the <b>&quot;;&quot;</b> character at the
-	 * beginning of a line for comments.</p>
-	 * 
-	 * @param string $url The name of the configuration file where the
-	 *					  configuration information is stored.
-	 * @param LoggerHierarchy $repository the repository to apply the configuration
-	 */
-	public function configure(LoggerHierarchy $hierarchy, $url = '') {
-		$properties = @parse_ini_file($url);
-		if ($properties === false || count($properties) == 0) {
-			$error = error_get_last();
-		    throw new LoggerException("LoggerConfiguratorIni: ".$error['message']);
-		}
-		return $this->doConfigureProperties($properties, $hierarchy);
-	}
-
-	/**
-	 * Read configuration options from <b>properties</b>.
-	 *
-	 * @see doConfigure().
-	 * @param array $properties
-	 * @param LoggerHierarchy $hierarchy
-	 */
-	private function doConfigureProperties($properties, LoggerHierarchy $hierarchy) {
-		$thresholdStr = @$properties[self::THRESHOLD_PREFIX];
-		$hierarchy->setThreshold(LoggerOptionConverter::toLevel($thresholdStr, LoggerLevel::getLevelAll()));
-		$this->configureRootCategory($properties, $hierarchy);
-		$this->parseCatsAndRenderers($properties, $hierarchy);
-		return true;
-	}
-
-	/**
-	 * @param array $props array of properties
-	 * @param LoggerHierarchy $hierarchy
-	 */
-	private function configureRootCategory($props, LoggerHierarchy $hierarchy) {
-		$effectivePrefix = self::ROOT_LOGGER_PREFIX;
-		$value = @$props[self::ROOT_LOGGER_PREFIX];
-
-		if(empty($value)) {
-			$value = @$props[self::ROOT_CATEGORY_PREFIX];
-			$effectivePrefix = self::ROOT_CATEGORY_PREFIX;
-		}
-
-		if(empty($value)) {
-			// TODO "Could not find root logger information. Is this OK?"
-		} else {
-			$root = $hierarchy->getRootLogger();
-			$this->parseCategory($props, $root, $effectivePrefix, self::INTERNAL_ROOT_NAME,	$value);
-		}
-	}
-
-	/**
-	 * Parse non-root elements, such non-root categories and renderers.
-	 *
-	 * @param array $props array of properties
-	 * @param LoggerHierarchy $hierarchy
-	 */
-	private function parseCatsAndRenderers($props, LoggerHierarchy $hierarchy) {
-		while(list($key,$value) = each($props)) {
-			if(strpos($key, self::CATEGORY_PREFIX) === 0 or 
-				strpos($key, self::LOGGER_PREFIX) === 0) {
-				if(strpos($key, self::CATEGORY_PREFIX) === 0) {
-					$loggerName = substr($key, strlen(self::CATEGORY_PREFIX));
-				} else if(strpos($key, self::LOGGER_PREFIX) === 0) {
-					$loggerName = substr($key, strlen(self::LOGGER_PREFIX));
-				}
-				
-				$logger = $hierarchy->getLogger($loggerName);
-				$this->parseCategory($props, $logger, $key, $loggerName, $value);
-				$this->parseAdditivityForLogger($props, $logger, $loggerName);
-			} else if(strpos($key, self::RENDERER_PREFIX) === 0) {
-				$renderedClass = substr($key, strlen(self::RENDERER_PREFIX));
-				$renderingClass = $value;
-				$hierarchy->getRendererMap()->addRenderer($renderedClass, $renderingClass);
-			}
-		}
-	}
-
-	/**
-	 * Parse the additivity option for a non-root category.
-	 *
-	 * @param array $props array of properties
-	 * @param Logger $cat
-	 * @param string $loggerName
-	 */
-	private function parseAdditivityForLogger($props, Logger $cat, $loggerName) {
-		$value = LoggerOptionConverter::findAndSubst(self::ADDITIVITY_PREFIX . $loggerName, $props);
-		
-		// touch additivity only if necessary
-		if(!empty($value)) {
-			$additivity = LoggerOptionConverter::toBoolean($value, true);
-			$cat->setAdditivity($additivity);
-		}
-	}
-
-	/**
-	 * This method must work for the root category as well.
-	 *
-	 * @param array $props array of properties
-	 * @param Logger $logger
-	 * @param string $optionKey
-	 * @param string $loggerName
-	 * @param string $value
-	 * @return Logger
-	 */
-	private function parseCategory($props, Logger $logger, $optionKey, $loggerName, $value) {
-		// We must skip over ',' but not white space
-		$st = explode(',', $value);
-
-		// If value is not in the form ", appender.." or "", then we should set
-		// the level of the loggeregory.
-
-		if(!(empty($value) || @$value[0] == ',')) {
-			// just to be on the safe side...
-			if(count($st) == 0) {
-				return;
-			}
-			$levelStr = current($st);
-			
-			// If the level value is inherited, set category level value to
-			// null. We also check that the user has not specified inherited for the
-			// root category.
-			if('INHERITED' == strtoupper($levelStr) || 'NULL' == strtoupper($levelStr)) {
-				if($loggerName == self::INTERNAL_ROOT_NAME) {
-					// TODO: throw exception?	"The root logger cannot be set to null."
-				} else {
-					$logger->setLevel(null);
-				}
-			} else {
-				$logger->setLevel(LoggerOptionConverter::toLevel($levelStr, LoggerLevel::getLevelDebug()));
-			}
-		}
-
-		// TODO: removing should be done by the logger, if necessary and wanted 
-		// $logger->removeAllAppenders();
-		while($appenderName = next($st)) {
-			$appenderName = trim($appenderName);
-			if(empty($appenderName)) {
-				continue;
-			}
-			
-			$appender = $this->parseAppender($props, $appenderName);
-			if($appender !== null) {
-					$logger->addAppender($appender);
-			}
-		}
-	}
-
-	/**
-	 * @param array $props array of properties
-	 * @param string $appenderName
-	 * @return LoggerAppender
-	 */
-	private function parseAppender($props, $appenderName) {
-		$appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
-		$prefix = self::APPENDER_PREFIX . $appenderName;
-		if($appender === null) {
-			// Appender was not previously initialized.
-			$appenderClass = @$props[$prefix];
-			$appender = LoggerAppenderPool::getAppenderFromPool($appenderName, $appenderClass);
-			if($appender === null) {
-				return null;
-			}
-		}
-		
-		if($appender->requiresLayout() ) {
-			$layoutPrefix = $prefix . ".layout";
-			$layoutClass = @$props[$layoutPrefix];
-			$layoutClass = LoggerOptionConverter::substVars($layoutClass, $props);
-			if(empty($layoutClass)) {
-				$layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
-			} else {
-				$layout = LoggerReflectionUtils::createObject($layoutClass);
-				if($layout === null) {
-					$layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
-				}
-			}
-			
-			LoggerReflectionUtils::setPropertiesByObject($layout, $props, $layoutPrefix . ".");				  
-			$appender->setLayout($layout);
-			
-		}
-		LoggerReflectionUtils::setPropertiesByObject($appender, $props, $prefix . ".");
-		return $appender;		 
-	}
-}

+ 0 - 134
main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorPhp.php

@@ -1,134 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * LoggerConfiguratorPhp class
- *
- * This class allows configuration of log4php through an external file that 
- * deliver a PHP array in return.
- *
- * An example for this configurator is:
- *
- * {@example ../../examples/php/configurator_php.php 19}
- * 
- * Which includes the following snippet:
- * 
- * {@example ../../examples/resources/configurator_php.php 18}
- *
- * @package log4php
- * @subpackage configurators
- * @since 2.0
- */
-class LoggerConfiguratorPhp implements LoggerConfigurator {
-	
-	public function configure(LoggerHierarchy $hierarchy, $url = '') {
-		return $this->doConfigure($url, $hierarchy);
-	}
-	
-	private function doConfigure($url, LoggerHierarchy $hierarchy) {
-		
-		$config = require $url;
-		
-		// set threshold
-		if(isset($config['threshold'])) {
-			$hierarchy->setThreshold(LoggerOptionConverter::toLevel($config['threshold'], LoggerLevel::getLevelAll()));
-		}
-		
-		// parse and create appenders
-		if(isset($config['appenders'])) {
-			
-			foreach($config['appenders'] as $appenderName => $appenderProperties) {
-				
-				$appender = LoggerAppenderPool::getAppenderFromPool($appenderName, $appenderProperties['class']);
-				
-				if($appender->requiresLayout()) {
-					
-					if(isset($appenderProperties['layout'])) {
-						
-						if(isset($appenderProperties['layout']['class']) and !empty($appenderProperties['layout']['class'])) {
-							$layoutClass = $appenderProperties['layout']['class'];							
-						} else {
-							$layoutClass = 'LoggerLayoutSimple';
-						}
-						
-						$layout = LoggerReflectionUtils::createObject($layoutClass);
-						if($layout === null) {
-							$layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
-						}
-						
-						if($layout instanceof LoggerLayoutPattern) {
-							$layout->setConversionPattern($appenderProperties['layout']['conversionPattern']);
-						}
-						
-						$appender->setLayout($layout);
-						
-					} else {
-						// TODO: throw exception?
-					}
-					
-				}
-				
-			}
-			
-		}
-		
-		// parse and create root logger
-		if(isset($config['rootLogger'])) {
-			$rootLogger = $hierarchy->getRootLogger();
-			if(isset($config['rootLogger']['level'])) {
-				$rootLogger->setLevel(LoggerOptionConverter::toLevel($config['rootLogger']['level'], LoggerLevel::getLevelDebug()));
-				if(isset($config['rootLogger']['appenders'])) {
-					foreach($config['rootLogger']['appenders'] as $appenderName) {
-						$appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
-						if($appender !== null) {
-							$rootLogger->addAppender($appender);
-						}
-					}
-				}	
-			}
-		}
-		
-		// parse and create loggers
-		if(isset($config['loggers'])) {
-			foreach($config['loggers'] as $loggerName => $loggerProperties) {
-				if(is_string($loggerName)) {
-					$logger = $hierarchy->getLogger($loggerName);
-					
-					if(isset($loggerProperties['level'])) {
-						$logger->setLevel(LoggerOptionConverter::toLevel($loggerProperties['level'], LoggerLevel::getLevelDebug()));
-						if(isset($loggerProperties['appenders'])) {
-							foreach($loggerProperties['appenders'] as $appenderName) {
-								$appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
-								if($appender !== null) {
-									$logger->addAppender($appender);
-								}
-							}
-						}	
-					}
-				} else {
-					// TODO: throw exception
-				}
-			}
-		}
-		
-		return true;
-	}
-	
-}

+ 0 - 441
main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorXml.php

@@ -1,441 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Use this class to initialize the log4php environment using XML files.
- *
- * <p>Read the log4php.dtd included in the documentation directory. Note that
- * php parser does not validate the document.</p>
- *
- * <p>Sometimes it is useful to see how log4php is reading configuration
- * files. You can enable log4php internal logging by setting the <var>debug</var> 
- * attribute in the <var>log4php:configuration</var> element.</p>
- *
- * <p>An example for this configurator:</p>
- * 
- * {@example ../../examples/php/configurator_xml.php 19}<br>
- * 
- * <p>The corresponding XML file:</p>
- * 
- * {@example ../../examples/resources/configurator_xml.xml 18}
- * 
- * <p>There are more sample XML files included in the package under tests/ subdirectories.</p>
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage configurators
- * @since 0.4 
- */
-class LoggerConfiguratorXml implements LoggerConfigurator {
-	const APPENDER_STATE = 1000;
-	const LAYOUT_STATE = 1010;
-	const ROOT_STATE = 1020;
-	const LOGGER_STATE = 1030;
-	const FILTER_STATE = 1040;
-	
-	const DEFAULT_FILENAME = './log4php.xml';
-	
-	/**
-	 * @var string the default configuration document
-	 */
-	const DEFAULT_CONFIGURATION = 
-	'<?xml version="1.0" ?>
-	<log4php:configuration threshold="all">
-	    <appender name="A1" class="LoggerAppenderEcho">
-	        <layout class="LoggerLayoutSimple" />
-	    </appender>
-	    <root>
-	        <level value="debug" />
-	        <appender_ref ref="A1" />
-	    </root>
-	</log4php:configuration>';
-	
-	/**
-	 * @var string the elements namespace
-	 */
-	const XMLNS = 'HTTP://LOGGING.APACHE.ORG/LOG4PHP/'; 
-
-    /**
-     * @var LoggerHierarchy
-     */
-    private $repository;
-    
-    /**
-     * @var array state stack 
-     */
-    private $state;
-
-    /**
-     * @var Logger parsed Logger  
-     */
-    private $logger;
-    
-    /**
-     * @var LoggerAppender parsed LoggerAppender 
-     */
-    private $appender;
-    
-    /**
-     * @var LoggerFilter parsed LoggerFilter 
-     */
-    private $filter;
-    
-    /**
-     * @var LoggerLayout parsed LoggerLayout 
-     */
-    private $layout;
-    
-    /**
-     * Constructor
-     */
-    public function __construct() {
-        $this->state    = array();
-        $this->logger   = null;
-        $this->appender = null;
-        $this->filter   = null;
-        $this->layout   = null;
-    }
-    
-    /**
-     * Configure the default repository using the resource pointed by <b>url</b>.
-     * <b>Url</b> is any valid resource as defined in {@link PHP_MANUAL#file} function.
-     * Note that the resource will be search with <i>use_include_path</i> parameter 
-     * set to "1".
-     *
-     * @param string $url
-     * @static
-     */
-    public function configure(LoggerHierarchy $hierarchy, $url = '') {
-        return $this->doConfigure($url, $hierarchy);
-    }
-    
-    /**
-     * Configure the given <b>repository</b> using the resource pointed by <b>url</b>.
-     * <b>Url</b> is any valid resurce as defined in {@link PHP_MANUAL#file} function.
-     * Note that the resource will be search with <i>use_include_path</i> parameter 
-     * set to "1".
-     *
-     * @param string $url
-     * @param LoggerHierarchy $repository
-     */
-    private function doConfigure($url = '', LoggerHierarchy $repository)
-    {
-        $xmlData = '';
-        if (!empty($url))
-            $xmlData = implode('', file($url, 1));
-        return $this->doConfigureByString($xmlData, $repository);
-    }
-    
-    /**
-     * Configure the given <b>repository</b> using the configuration written in <b>xmlData</b>.
-     * Do not call this method directly. Use {@link doConfigure()} instead.
-     * @param string $xmlData
-     * @param LoggerHierarchy $repository
-     */
-    private function doConfigureByString($xmlData, LoggerHierarchy $repository)
-    {
-        return $this->parse($xmlData, $repository);
-    }
-    
-    /**
-     * @param LoggerHierarchy $repository
-     */
-    private function doConfigureDefault(LoggerHierarchy $repository)
-    {
-        return $this->doConfigureByString(self::DEFAULT_CONFIGURATION, $repository);
-    }
-    
-    /**
-     * @param string $xmlData
-     */
-    private function parse($xmlData, LoggerHierarchy $repository)
-    {
-        // Logger::resetConfiguration();
-        $this->repository = $repository;
-
-        $parser = xml_parser_create_ns();
-    
-        xml_set_object($parser, $this);
-        xml_set_element_handler($parser, "tagOpen", "tagClose");
-        
-        $result = xml_parse($parser, $xmlData, true);
-        if (!$result) {
-            $errorCode = xml_get_error_code($parser);
-            $errorStr = xml_error_string($errorCode);
-            $errorLine = xml_get_current_line_number($parser);
-            $this->repository->resetConfiguration();
-        } else {
-            xml_parser_free($parser);
-        }
-        return $result;
-    }
-    
-    /**
-     * @param mixed $parser
-     * @param string $tag
-     * @param array $attribs
-     *
-     * @todo In 'LOGGER' case find a better way to detect 'getLogger()' method
-     */
-    private function tagOpen($parser, $tag, $attribs)
-    {
-        switch ($tag) {
-        
-            case 'CONFIGURATION' :
-            case self::XMLNS.':CONFIGURATION':
-            
-                if (isset($attribs['THRESHOLD'])) {
-                
-                    $this->repository->setThreshold(
-                        LoggerOptionConverter::toLevel(
-                            $this->subst($attribs['THRESHOLD']), 
-                            $this->repository->getThreshold()
-                        )
-                    );
-                }
-                break;
-                
-            case 'APPENDER' :
-            case self::XMLNS.':APPENDER':
-            
-                unset($this->appender);
-                $this->appender = null;
-                
-                $name  = $this->subst(@$attribs['NAME']);
-                $class = $this->subst(@$attribs['CLASS']);
-                
-                $this->appender = LoggerAppenderPool::getAppenderFromPool($name, $class);
-                
-                if (isset($attribs['THRESHOLD'])) {
-                    $this->appender->setThreshold(
-                        LoggerOptionConverter::toLevel(
-                            $this->subst($attribs['THRESHOLD']), $this->appender->getThreshold()));
-                }
-                
-                $this->state[] = self::APPENDER_STATE;
-                break;
-                
-            case 'APPENDER_REF' :
-            case 'APPENDER-REF' :
-            case self::XMLNS.':APPENDER_REF':
-            case self::XMLNS.':APPENDER-REF':
-                if (isset($attribs['REF']) and !empty($attribs['REF'])) {
-                    $appenderName = $this->subst($attribs['REF']);
-                    
-                    $appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
-                    if ($appender !== null) {
-                        switch (end($this->state)) {
-                            case self::LOGGER_STATE:
-                            case self::ROOT_STATE:                
-                                $this->logger->addAppender($appender);
-                                break;
-                        }
-                    }
-                } 
-                break;
-                
-            case 'FILTER' :
-            case self::XMLNS.':FILTER':
-                unset($this->filter);
-                $this->filter = null;
-
-                $filterName = basename($this->subst(@$attribs['CLASS']));
-                if (!empty($filterName)) {
-                    $this->filter = new $filterName();
-                    $this->state[] = self::FILTER_STATE;
-                } 
-                break;
-                
-            case 'LAYOUT':
-            case self::XMLNS.':LAYOUT':
-                $class = @$attribs['CLASS'];
-                $this->layout = LoggerReflectionUtils::createObject($this->subst($class));
-                $this->state[] = self::LAYOUT_STATE;
-                break;
-            
-            case 'LOGGER':
-            case self::XMLNS.':LOGGER':
-                // $this->logger is assigned by reference.
-                // Only '$this->logger=null;' destroys referenced object
-                unset($this->logger);
-                $this->logger = null;
-                
-                $loggerName = $this->subst(@$attribs['NAME']);
-                if (!empty($loggerName)) {
-                    $this->logger = $this->repository->getLogger($loggerName);
-                    if ($this->logger !== null and isset($attribs['ADDITIVITY'])) {
-                        $additivity = LoggerOptionConverter::toBoolean($this->subst($attribs['ADDITIVITY']), true);     
-                        $this->logger->setAdditivity($additivity);
-                    }
-                } 
-                $this->state[] = self::LOGGER_STATE;;
-                break;
-            
-            case 'LEVEL':
-            case self::XMLNS.':LEVEL':
-            case 'PRIORITY':
-            case self::XMLNS.':PRIORITY':
-            
-                if (!isset($attribs['VALUE'])) {
-                    // LoggerDOMConfigurator::tagOpen() LEVEL value not set
-                    break;
-                }
-                    
-                if ($this->logger === null) { 
-                    // LoggerDOMConfigurator::tagOpen() LEVEL. parent logger is null
-                    break;
-                }
-        
-                switch (end($this->state)) {
-                    case self::ROOT_STATE:
-                        $this->logger->setLevel(
-                            LoggerOptionConverter::toLevel(
-                                $this->subst($attribs['VALUE']), 
-                                $this->logger->getLevel()
-                            )
-                        );
-                        break;
-                    case self::LOGGER_STATE:
-                        $this->logger->setLevel(
-                            LoggerOptionConverter::toLevel(
-                                $this->subst($attribs['VALUE']), 
-                                $this->logger->getLevel()
-                            )
-                        );
-                        break;
-                    default:
-                        //LoggerLog::warn("LoggerDOMConfigurator::tagOpen() LEVEL state '{$this->state}' not allowed here");
-                }
-                break;
-            
-            case 'PARAM':
-            case self::XMLNS.':PARAM':
-                if (!isset($attribs['NAME'])) {
-                    // LoggerDOMConfigurator::tagOpen() PARAM attribute 'name' not defined.
-                    break;
-                }
-                if (!isset($attribs['VALUE'])) {
-                    // LoggerDOMConfigurator::tagOpen() PARAM. attribute 'value' not defined.
-                    break;
-                }
-                    
-                switch (end($this->state)) {
-                    case self::APPENDER_STATE:
-                        if ($this->appender !== null) {
-                            LoggerReflectionUtils::setter($this->appender, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
-                        }
-                        break;
-                    case self::LAYOUT_STATE:
-                        if ($this->layout !== null) {
-                            LoggerReflectionUtils::setter($this->layout, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));                
-                        }
-                        break;
-                    case self::FILTER_STATE:
-                        if ($this->filter !== null) {
-                            LoggerReflectionUtils::setter($this->filter, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
-                        }
-                        break;
-                    default:
-                        //LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM state '{$this->state}' not allowed here");
-                }
-                break;
-            
-            case 'RENDERER':
-            case self::XMLNS.':RENDERER':
-
-                $renderedClass   = $this->subst(@$attribs['RENDEREDCLASS']);
-                $renderingClass  = $this->subst(@$attribs['RENDERINGCLASS']);
-        
-                if (!empty($renderedClass) and !empty($renderingClass)) {
-                    $this->repository->getRendererMap()->addRenderer($renderedClass, $renderingClass);
-                }
-                break;
-            
-            case 'ROOT':
-            case self::XMLNS.':ROOT':
-                $this->logger = Logger::getRootLogger();
-                $this->state[] = self::ROOT_STATE;
-                break;
-        }
-    }
-
-
-    /**
-     * @param mixed $parser
-     * @param string $tag
-     */
-    private function tagClose($parser, $tag)
-    {
-        switch ($tag) {
-        
-            case 'CONFIGURATION' : 
-            case self::XMLNS.':CONFIGURATION':
-                break;
-                
-            case 'APPENDER' :
-            case self::XMLNS.':APPENDER':
-                if ($this->appender !== null) {
-                    if ($this->appender->requiresLayout() and $this->appender->getLayout() === null) {
-                        $appenderName = $this->appender->getName();
-                        $this->appender->setLayout(LoggerReflectionUtils::createObject('LoggerLayoutSimple'));
-                    }                    
-                    $this->appender->activateOptions();
-                }        
-                array_pop($this->state);        
-                break;
-                
-            case 'FILTER' :
-            case self::XMLNS.':FILTER':
-                if ($this->filter !== null) {
-                    $this->filter->activateOptions();
-                    $this->appender->addFilter($this->filter);
-                    $this->filter = null;
-                }
-                array_pop($this->state);        
-                break;
-                
-            case 'LAYOUT':
-            case self::XMLNS.':LAYOUT':
-                if ($this->appender !== null and $this->layout !== null and $this->appender->requiresLayout()) {
-                    $this->layout->activateOptions();
-                    $this->appender->setLayout($this->layout);
-                    $this->layout = null;
-                }
-                array_pop($this->state);
-                break;
-            
-            case 'LOGGER':
-            case self::XMLNS.':LOGGER':
-                array_pop($this->state);
-                break;
-            
-            case 'ROOT':
-            case self::XMLNS.':ROOT':
-                array_pop($this->state);
-                break;
-        }
-    }
-    
-    private function subst($value)
-    {
-        return LoggerOptionConverter::substVars($value);
-    }
-
-}

+ 0 - 56
main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterDenyAll.php

@@ -1,56 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * This filter drops all logging events. 
- * 
- * You can add this filter to the end of a filter chain to
- * switch from the default "accept all unless instructed otherwise"
- * filtering behaviour to a "deny all unless instructed otherwise"
- * behaviour.
- * 
- * <p>
- * An example for this filter:
- * 
- * {@example ../../examples/php/filter_denyall.php 19}
- *
- * <p>
- * The corresponding XML file:
- * 
- * {@example ../../examples/resources/filter_denyall.xml 18}
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage filters
- * @since 0.3
- */
-class LoggerFilterDenyAll extends LoggerFilter {
-
-	/**
-	 * Always returns the integer constant {@link LoggerFilter::DENY}
-	 * regardless of the {@link LoggerLoggingEvent} parameter.
-	 * 
-	 * @param LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to filter.
-	 * @return LoggerFilter::DENY Always returns {@link LoggerFilter::DENY}
-	 */
-	public function decide(LoggerLoggingEvent $event) {
-		return LoggerFilter::DENY;
-	}
-}

+ 0 - 104
main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterLevelMatch.php

@@ -1,104 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * This is a very simple filter based on level matching.
- *
- * <p>The filter admits two options <b><var>LevelToMatch</var></b> and
- * <b><var>AcceptOnMatch</var></b>. If there is an exact match between the value
- * of the <b><var>LevelToMatch</var></b> option and the level of the 
- * {@link LoggerLoggingEvent}, then the {@link decide()} method returns 
- * {@link LoggerFilter::ACCEPT} in case the <b><var>AcceptOnMatch</var></b> 
- * option value is set to <i>true</i>, if it is <i>false</i> then 
- * {@link LoggerFilter::DENY} is returned. If there is no match, 
- * {@link LoggerFilter::NEUTRAL} is returned.</p>
- * 
- * <p>
- * An example for this filter:
- * 
- * {@example ../../examples/php/filter_levelmatch.php 19}
- *
- * <p>
- * The corresponding XML file:
- * 
- * {@example ../../examples/resources/filter_levelmatch.xml 18}
- * 
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage filters
- * @since 0.6
- */
-class LoggerFilterLevelMatch extends LoggerFilter {
-  
-	/** 
-	 * Indicates if this event should be accepted or denied on match
-	 * @var boolean
-	 */
-	private $acceptOnMatch = true;
-
-	/**
-	 * The level, when to match
-	 * @var LoggerLevel
-	 */
-	private $levelToMatch;
-  
-	/**
-	 * @param boolean $acceptOnMatch
-	 */
-	public function setAcceptOnMatch($acceptOnMatch) {
-		$this->acceptOnMatch = LoggerOptionConverter::toBoolean($acceptOnMatch, true); 
-	}
-	
-	/**
-	 * @param string $l the level to match
-	 */
-	public function setLevelToMatch($l) {
-		if($l instanceof LoggerLevel) {
-		    $this->levelToMatch = $l;
-		} else {
-			$this->levelToMatch = LoggerOptionConverter::toLevel($l, null);
-		}
-	}
-
-	/**
-	 * Return the decision of this filter.
-	 * 
-	 * Returns {@link LoggerFilter::NEUTRAL} if the <b><var>LevelToMatch</var></b>
-	 * option is not set or if there is not match.	Otherwise, if there is a
-	 * match, then the returned decision is {@link LoggerFilter::ACCEPT} if the
-	 * <b><var>AcceptOnMatch</var></b> property is set to <i>true</i>. The
-	 * returned decision is {@link LoggerFilter::DENY} if the
-	 * <b><var>AcceptOnMatch</var></b> property is set to <i>false</i>.
-	 *
-	 * @param LoggerLoggingEvent $event
-	 * @return integer
-	 */
-	public function decide(LoggerLoggingEvent $event) {
-		if($this->levelToMatch === null) {
-			return LoggerFilter::NEUTRAL;
-		}
-		
-		if($this->levelToMatch->equals($event->getLevel())) {	
-			return $this->acceptOnMatch ? LoggerFilter::ACCEPT : LoggerFilter::DENY;
-		} else {
-			return LoggerFilter::NEUTRAL;
-		}
-	}
-}

+ 0 - 146
main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterLevelRange.php

@@ -1,146 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * This is a very simple filter based on level matching, which can be
- * used to reject messages with priorities outside a certain range.
- *	
- * <p>The filter admits three options <b><var>LevelMin</var></b>, <b><var>LevelMax</var></b>
- * and <b><var>AcceptOnMatch</var></b>.</p>
- *
- * <p>If the level of the {@link LoggerLoggingEvent} is not between Min and Max
- * (inclusive), then {@link LoggerFilter::DENY} is returned.</p>
- *	
- * <p>If the Logging event level is within the specified range, then if
- * <b><var>AcceptOnMatch</var></b> is <i>true</i>, 
- * {@link LoggerFilter::ACCEPT} is returned, and if
- * <b><var>AcceptOnMatch</var></b> is <i>false</i>, 
- * {@link LoggerFilter::NEUTRAL} is returned.</p>
- *	
- * <p>If <b><var>LevelMin</var></b> is not defined, then there is no
- * minimum acceptable level (i.e. a level is never rejected for
- * being too "low"/unimportant).  If <b><var>LevelMax</var></b> is not
- * defined, then there is no maximum acceptable level (ie a
- * level is never rejected for being too "high"/important).</p>
- *
- * <p>Refer to the {@link LoggerAppender::setThreshold()} method
- * available to <b>all</b> appenders extending {@link LoggerAppender} 
- * for a more convenient way to filter out events by level.</p>
- *
- * <p>
- * An example for this filter:
- * 
- * {@example ../../examples/php/filter_levelrange.php 19}
- *
- * <p>
- * The corresponding XML file:
- * 
- * {@example ../../examples/resources/filter_levelrange.xml 18}
- *
- * @author Simon Kitching
- * @author based on the org.apache.log4j.varia.LevelRangeFilte Java code by Ceki G&uuml;lc&uuml; 
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage filters
- * @since 0.6
- */
-class LoggerFilterLevelRange extends LoggerFilter {
-
-	/**
-	 * @var boolean
-	 */
-	private $acceptOnMatch = true;
-
-	/**
-	 * @var LoggerLevel
-	 */
-	private $levelMin;
-  
-	/**
-	 * @var LoggerLevel
-	 */
-	private $levelMax;
-
-	/**
-	 * @param boolean $acceptOnMatch
-	 */
-	public function setAcceptOnMatch($acceptOnMatch) {
-		$this->acceptOnMatch = LoggerOptionConverter::toBoolean($acceptOnMatch, true); 
-	}
-	
-	/**
-	 * @param string $l the level min to match
-	 */
-	public function setLevelMin($l) {
-		if($l instanceof LoggerLevel) {
-		    $this->levelMin = $l;
-		} else {
-			$this->levelMin = LoggerOptionConverter::toLevel($l, null);
-		}
-	}
-
-	/**
-	 * @param string $l the level max to match
-	 */
-	public function setLevelMax($l) {
-		if($l instanceof LoggerLevel) {
-		    $this->levelMax = $l;
-		} else {
-			$this->levelMax = LoggerOptionConverter::toLevel($l, null);
-		}
-	}
-
-	/**
-	 * Return the decision of this filter.
-	 *
-	 * @param LoggerLoggingEvent $event
-	 * @return integer
-	 */
-	public function decide(LoggerLoggingEvent $event) {
-		$level = $event->getLevel();
-		
-		if($this->levelMin !== null) {
-			if($level->isGreaterOrEqual($this->levelMin) == false) {
-				// level of event is less than minimum
-				return LoggerFilter::DENY;
-			}
-		}
-
-		if($this->levelMax !== null) {
-			if($level->toInt() > $this->levelMax->toInt()) {
-				// level of event is greater than maximum
-				// Alas, there is no Level.isGreater method. and using
-				// a combo of isGreaterOrEqual && !Equal seems worse than
-				// checking the int values of the level objects..
-				return LoggerFilter::DENY;
-			}
-		}
-
-		if($this->acceptOnMatch) {
-			// this filter set up to bypass later filters and always return
-			// accept if level in range
-			return LoggerFilter::ACCEPT;
-		} else {
-			// event is ok for this filter; allow later filters to have a look..
-			return LoggerFilter::NEUTRAL;
-		}
-	}
-}

+ 0 - 89
main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterStringMatch.php

@@ -1,89 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * This is a very simple filter based on string matching.
- * 
- * <p>The filter admits two options {@link $stringToMatch} and
- * {@link $acceptOnMatch}. If there is a match (using {@link PHP_MANUAL#strpos}
- * between the value of the {@link $stringToMatch} option and the message 
- * of the {@link LoggerLoggingEvent},
- * then the {@link decide()} method returns {@link LoggerFilter::ACCEPT} if
- * the <b>AcceptOnMatch</b> option value is true, if it is false then
- * {@link LoggerFilter::DENY} is returned. If there is no match, {@link LoggerFilter::NEUTRAL}
- * is returned.</p>
- * 
- * <p>
- * An example for this filter:
- * 
- * {@example ../../examples/php/filter_stringmatch.php 19}
- *
- * <p>
- * The corresponding XML file:
- * 
- * {@example ../../examples/resources/filter_stringmatch.xml 18}
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage filters
- * @since 0.3
- */
-class LoggerFilterStringMatch extends LoggerFilter {
-
-	/**
-	 * @var boolean
-	 */
-	private $acceptOnMatch = true;
-
-	/**
-	 * @var string
-	 */
-	private $stringToMatch = null;
-
-	/**
-	 * @param mixed $acceptOnMatch a boolean or a string ('true' or 'false')
-	 */
-	public function setAcceptOnMatch($acceptOnMatch) {
-		$this->acceptOnMatch = is_bool($acceptOnMatch) ? $acceptOnMatch : (bool)(strtolower($acceptOnMatch) == 'true');
-	}
-	
-	/**
-	 * @param string $s the string to match
-	 */
-	public function setStringToMatch($s) {
-		$this->stringToMatch = $s;
-	}
-
-	/**
-	 * @return integer a {@link LOGGER_FILTER_NEUTRAL} is there is no string match.
-	 */
-	public function decide(LoggerLoggingEvent $event) {
-		$msg = $event->getRenderedMessage();
-		
-		if($msg === null or $this->stringToMatch === null) {
-			return LoggerFilter::NEUTRAL;
-		}
-		
-		if(strpos($msg, $this->stringToMatch) !== false ) {
-			return ($this->acceptOnMatch) ? LoggerFilter::ACCEPT : LoggerFilter::DENY;
-		}
-		return LoggerFilter::NEUTRAL;
-	}
-}

+ 0 - 71
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerBasicPatternConverter.php

@@ -1,71 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * @package log4php
- * @subpackage helpers
- */
-class LoggerBasicPatternConverter extends LoggerPatternConverter {
-
-	/**
-	 * @var integer
-	 */
-	private $type;
-
-	/**
-	 * Constructor
-	 *
-	 * @param string $formattingInfo
-	 * @param integer $type
-	 */
-	public function __construct($formattingInfo, $type) {
-	  parent::__construct($formattingInfo);
-	  $this->type = $type;
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	public function convert($event) {
-		switch($this->type) {
-			case LoggerPatternParser::RELATIVE_TIME_CONVERTER:
-				$timeStamp = $event->getTimeStamp();
-				$startTime = LoggerLoggingEvent::getStartTime();
-				return (string)(int)($timeStamp * 1000 - $startTime * 1000);
-				
-			case LoggerPatternParser::THREAD_CONVERTER:
-				return $event->getThreadName();
-
-			case LoggerPatternParser::LEVEL_CONVERTER:
-				$level = $event->getLevel();
-				return $level->toString();
-
-			case LoggerPatternParser::NDC_CONVERTER:
-				return $event->getNDC();
-
-			case LoggerPatternParser::MESSAGE_CONVERTER:
-				return $event->getRenderedMessage();
-				
-			default: 
-				return '';
-		}
-	}
-}

+ 0 - 44
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerCategoryPatternConverter.php

@@ -1,44 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * @package log4php
- * @subpackage helpers
- */
-class LoggerCategoryPatternConverter extends LoggerNamedPatternConverter {
-
-	/**
-	 * Constructor
-	 *
-	 * @param string $formattingInfo
-	 * @param integer $precision
-	 */
-	public function __construct($formattingInfo, $precision) {
-		parent::__construct($formattingInfo, $precision);
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	public function getFullyQualifiedName($event) {
-		return $event->getLoggerName();
-	}
-}

+ 0 - 45
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerClassNamePatternConverter.php

@@ -1,45 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * @package log4php
- * @subpackage helpers
- */
-class LoggerClassNamePatternConverter extends LoggerNamedPatternConverter {
-
-	/**
-	 * Constructor
-	 *
-	 * @param string $formattingInfo
-	 * @param integer $precision
-	 */
-	public function __construct($formattingInfo, $precision) {
-		parent::__construct($formattingInfo, $precision);
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	public function getFullyQualifiedName($event) {
-		return $event->fqcn;
-	}
-}
-

+ 0 - 53
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerDatePatternConverter.php

@@ -1,53 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * @package log4php
- * @subpackage helpers
- */
-class LoggerDatePatternConverter extends LoggerPatternConverter {
-
-	/**
-	 * @var string
-	 */
-	private $df;
-	
-	/**
-	 * Constructor
-	 *
-	 * @param string $formattingInfo
-	 * @param string $df
-	 */
-	public function __construct($formattingInfo, $df) {
-		parent::__construct($formattingInfo);
-		$this->df = $df;
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	public function convert($event) {
-		$timeStamp = $event->getTimeStamp();
-		$usecs = round(($timeStamp - (int)$timeStamp) * 1000);
-		$this->df = preg_replace('/((?<!\\\\)(?:\\\\{2})*)u/', '${1}' . sprintf('%03d', $usecs), $this->df);
-		return date($this->df, $event->getTimeStamp());
-	}
-}

+ 0 - 50
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerFormattingInfo.php

@@ -1,50 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * This class encapsulates the information obtained when parsing
- * formatting modifiers in conversion modifiers.
- * 
- * @package log4php
- * @subpackage helpers
- * @since 0.3
- */
-class LoggerFormattingInfo {
-
-	public $min = -1;
-	public $max = 0x7FFFFFFF;
-	public $leftAlign = false;
-
-	/**
-	 * Constructor
-	 */
-	public function __construct() {}
-	
-	public function reset() {
-		$this->min = -1;
-		$this->max = 0x7FFFFFFF;
-		$this->leftAlign = false;	  
-	}
-
-	public function dump() {
-		// TODO: other option to dump?
-		// LoggerLog::debug("LoggerFormattingInfo::dump() min={$this->min}, max={$this->max}, leftAlign={$this->leftAlign}");
-	}
-}

+ 0 - 57
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerLiteralPatternConverter.php

@@ -1,57 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * @package log4php
- * @subpackage helpers
- */
-class LoggerLiteralPatternConverter extends LoggerPatternConverter {
-	
-	/**
-	 * @var string
-	 */
-	private $literal;
-
-	/**
-	 * Constructor
-	 *
-	 * @param string $value
-	 */
-	public function __construct($value) {
-		$this->literal = $value;
-	}
-
-	/**
-	 * @param string &$sbuf
-	 * @param LoggerLoggingEvent $event
-	 */
-	public function format(&$sbuf, $event) {
-		$sbuf .= $this->literal;
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	public function convert($event) {
-		return $this->literal;
-	}
-}
-

+ 0 - 63
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerLocationPatternConverter.php

@@ -1,63 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * @package log4php
- * @subpackage helpers
- */
-class LoggerLocationPatternConverter extends LoggerPatternConverter {
-	
-	/**
-	 * @var integer
-	 */
-	private $type;
-
-	/**
-	 * Constructor
-	 *
-	 * @param string $formattingInfo
-	 * @param integer $type
-	 */
-	public function __construct($formattingInfo, $type) {
-	  parent::__construct($formattingInfo);
-	  $this->type = $type;
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	public function convert($event) {
-		$locationInfo = $event->getLocationInformation();
-		switch($this->type) {
-			case LoggerPatternParser::FULL_LOCATION_CONVERTER:
-				return $locationInfo->getFullInfo();
-			case LoggerPatternParser::METHOD_LOCATION_CONVERTER:
-				return $locationInfo->getMethodName();
-			case LoggerPatternParser::LINE_LOCATION_CONVERTER:
-				return $locationInfo->getLineNumber();
-			case LoggerPatternParser::FILE_LOCATION_CONVERTER:
-				return $locationInfo->getFileName();
-			default: 
-				return '';
-		}
-	}
-}
-

+ 0 - 50
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerMDCPatternConverter.php

@@ -1,50 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * @package log4php
- * @subpackage helpers
- */
-class LoggerMDCPatternConverter extends LoggerPatternConverter {
-
-	/**
-	 * @var string
-	 */
-	private $key;
-
-	/**
-	 * Constructor
-	 *
-	 * @param string $formattingInfo
-	 * @param string $key
-	 */
-	public function __construct($formattingInfo, $key) {
-		parent::__construct($formattingInfo);
-		$this->key = $key;
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	public function convert($event) {
-		return $event->getMDC($this->key);
-	}
-}

+ 0 - 77
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerNamedPatternConverter.php

@@ -1,77 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * @package log4php
- * @subpackage helpers
- * @abstract
- */
-class LoggerNamedPatternConverter extends LoggerPatternConverter {
-
-	/**
-	 * @var integer
-	 */
-	private $precision;
-
-	/**
-	 * Constructor
-	 *
-	 * @param string $formattingInfo
-	 * @param integer $precision
-	 */
-	public function __construct($formattingInfo, $precision) {
-	  parent::__construct($formattingInfo);
-	  $this->precision =  $precision;
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 * @abstract
-	 */
-	public function getFullyQualifiedName($event) {
-		// abstract
-		return;
-	}
-
-	/**
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	function convert($event) {
-		$n = $this->getFullyQualifiedName($event);
-		if($this->precision <= 0) {
-			return $n;
-		} else {
-			$len = strlen($n);
-			// We substract 1 from 'len' when assigning to 'end' to avoid out of
-			// bounds exception in return r.substring(end+1, len). This can happen if
-			// precision is 1 and the category name ends with a dot.
-			$end = $len -1 ;
-			for($i = $this->precision; $i > 0; $i--) {
-				$end = strrpos(substr($n, 0, ($end - 1)), '.');
-				if($end == false) {
-					return $n;
-				}
-			}
-			return substr($n, ($end + 1), $len);
-		}
-	}
-}

+ 0 - 322
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerOptionConverter.php

@@ -1,322 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * A convenience class to convert property values to specific types.
- *
- * @version $Revision: 822464 $ 
- * @package log4php
- * @subpackage helpers
- * @static
- * @since 0.5
- */
-class LoggerOptionConverter {
-
-	const DELIM_START = '${';
-	const DELIM_STOP = '}';
-	const DELIM_START_LEN = 2;
-	const DELIM_STOP_LEN = 1;
-
-   /**
-	* Read a predefined var.
-	*
-	* It returns a value referenced by <var>$key</var> using this search criteria:
-	* - if <var>$key</var> is a constant then return it. Else
-	* - if <var>$key</var> is set in <var>$_ENV</var> then return it. Else
-	* - return <var>$def</var>. 
-	*
-	* @param string $key The key to search for.
-	* @param string $def The default value to return.
-	* @return string	the string value of the system property, or the default
-	*					value if there is no property with that key.
-	*
-	* @static
-	*/
-	public static function getSystemProperty($key, $def) {
-		if(defined($key)) {
-			return (string)constant($key);
-		} else if(isset($_SERVER[$key])) {
-			return (string)$_SERVER[$key];
-		} else if(isset($_ENV[$key])) {
-			return (string)$_ENV[$key];
-		} else {
-			return $def;
-		}
-	}
-
-	/**
-	 * If <var>$value</var> is <i>true</i>, then <i>true</i> is
-	 * returned. If <var>$value</var> is <i>false</i>, then
-	 * <i>true</i> is returned. Otherwise, <var>$default</var> is
-	 * returned.
-	 *
-	 * <p>Case of value is unimportant.</p>
-	 *
-	 * @param string $value
-	 * @param boolean $default
-	 * @return boolean
-	 *
-	 * @static
-	 */
-	public static function toBoolean($value, $default=true) {
-	    if (is_null($value)) {
-			return $default;
-	    } elseif (is_string($value)) {
-		$trimmedVal = strtolower(trim($value));
-	
-            if("1" == $trimmedVal or "true" == $trimmedVal or "yes" == $trimmedVal or "on" == $trimmedVal) {
-			return true;
-            } else if ("" == $trimmedVal or "0" == $trimmedVal or "false" == $trimmedVal or "no" == $trimmedVal or "off" == $trimmedVal) {
-			return false;
-		}
-		} elseif (is_bool($value)) {
-		    return $value;
-		} elseif (is_int($value)) {
-		    return !($value == 0); // true is everything but 0 like in C 
-		}
-		
-		trigger_error("Could not convert ".var_export($value,1)." to boolean!", E_USER_WARNING);
-		return $default;
-	}
-
-	/**
-	 * @param string $value
-	 * @param integer $default
-	 * @return integer
-	 * @static
-	 */
-	public static function toInt($value, $default) {
-		$value = trim($value);
-		if(is_numeric($value)) {
-			return (int)$value;
-		} else {
-			return $default;
-		}
-	}
-
-	/**
-	 * Converts a standard or custom priority level to a Level
-	 * object.
-	 *
-	 * <p> If <var>$value</var> is of form "<b>level#full_file_classname</b>",
-	 * where <i>full_file_classname</i> means the class filename with path
-	 * but without php extension, then the specified class' <i>toLevel()</i> method
-	 * is called to process the specified level string; if no '#'
-	 * character is present, then the default {@link LoggerLevel}
-	 * class is used to process the level value.</p>
-	 *
-	 * <p>As a special case, if the <var>$value</var> parameter is
-	 * equal to the string "NULL", then the value <i>null</i> will
-	 * be returned.</p>
-	 *
-	 * <p>If any error occurs while converting the value to a level,
-	 * the <var>$defaultValue</var> parameter, which may be
-	 * <i>null</i>, is returned.</p>
-	 *
-	 * <p>Case of <var>$value</var> is insignificant for the level level, but is
-	 * significant for the class name part, if present.</p>
-	 *
-	 * @param string $value
-	 * @param LoggerLevel $defaultValue
-	 * @return LoggerLevel a {@link LoggerLevel} or null
-	 * @static
-	 */
-	public static function toLevel($value, $defaultValue) {
-		if($value === null) {
-			return $defaultValue;
-		}
-		$hashIndex = strpos($value, '#');
-		if($hashIndex === false) {
-			if("NULL" == strtoupper($value)) {
-				return null;
-			} else {
-				// no class name specified : use standard Level class
-				return LoggerLevel::toLevel($value, $defaultValue);
-			}
-		}
-
-		$result = $defaultValue;
-
-		$clazz = substr($value, ($hashIndex + 1));
-		$levelName = substr($value, 0, $hashIndex);
-
-		// This is degenerate case but you never know.
-		if("NULL" == strtoupper($levelName)) {
-			return null;
-		}
-
-		$clazz = basename($clazz);
-
-		if(class_exists($clazz)) {
-			$result = @call_user_func(array($clazz, 'toLevel'), $levelName, $defaultValue);
-			if(!$result instanceof LoggerLevel) {
-				$result = $defaultValue;
-			}
-		} 
-		return $result;
-	}
-
-	/**
-	 * @param string $value
-	 * @param float $default
-	 * @return float
-	 *
-	 * @static
-	 */
-	public static function toFileSize($value, $default) {
-		if($value === null) {
-			return $default;
-		}
-
-		$s = strtoupper(trim($value));
-		$multiplier = (float)1;
-		if(($index = strpos($s, 'KB')) !== false) {
-			$multiplier = 1024;
-			$s = substr($s, 0, $index);
-		} else if(($index = strpos($s, 'MB')) !== false) {
-			$multiplier = 1024 * 1024;
-			$s = substr($s, 0, $index);
-		} else if(($index = strpos($s, 'GB')) !== false) {
-			$multiplier = 1024 * 1024 * 1024;
-			$s = substr($s, 0, $index);
-		}
-		if(is_numeric($s)) {
-			return (float)$s * $multiplier;
-		} 
-		return $default;
-	}
-
-	/**
-	 * Find the value corresponding to <var>$key</var> in
-	 * <var>$props</var>. Then perform variable substitution on the
-	 * found value.
-	 *
-	 * @param string $key
-	 * @param array $props
-	 * @return string
-	 *
-	 * @static
-	 */
-	public static function findAndSubst($key, $props) {
-		$value = @$props[$key];
-
-        // If coming from the LoggerConfiguratorIni, some options were
-        // already mangled by parse_ini_file:
-        //
-        // not specified      => never reaches this code
-        // ""|off|false|null  => string(0) ""
-        // "1"|on|true        => string(1) "1"
-        // "true"             => string(4) "true"
-        // "false"            => string(5) "false"
-        // 
-        // As the integer 1 and the boolean true are therefore indistinguable
-        // it's up to the setter how to deal with it, they can not be cast
-        // into a boolean here. {@see toBoolean}
-        // Even an empty value has to be given to the setter as it has been
-        // explicitly set by the user and is different from an option which
-        // has not been specified and therefore keeps its default value.
-        //
-		// if(!empty($value)) {
-			return LoggerOptionConverter::substVars($value, $props);
-		// }
-    }
-
-	/**
-	 * Perform variable substitution in string <var>$val</var> from the
-	 * values of keys found with the {@link getSystemProperty()} method.
-	 * 
-	 * <p>The variable substitution delimeters are <b>${</b> and <b>}</b>.
-	 * 
-	 * <p>For example, if the "MY_CONSTANT" contains "value", then
-	 * the call
-	 * <code>
-	 * $s = LoggerOptionConverter::substituteVars("Value of key is ${MY_CONSTANT}.");
-	 * </code>
-	 * will set the variable <i>$s</i> to "Value of key is value.".</p>
-	 * 
-	 * <p>If no value could be found for the specified key, then the
-	 * <var>$props</var> parameter is searched, if the value could not
-	 * be found there, then substitution defaults to the empty string.</p>
-	 * 
-	 * <p>For example, if {@link getSystemProperty()} cannot find any value for the key
-	 * "inexistentKey", then the call
-	 * <code>
-	 * $s = LoggerOptionConverter::substVars("Value of inexistentKey is [${inexistentKey}]");
-	 * </code>
-	 * will set <var>$s</var> to "Value of inexistentKey is []".</p>
-	 * 
-	 * <p>A warn is thrown if <var>$val</var> contains a start delimeter "${" 
-	 * which is not balanced by a stop delimeter "}" and an empty string is returned.</p>
-	 * 
-	 * @author Avy Sharell
-	 * 
-	 * @param string $val The string on which variable substitution is performed.
-	 * @param array $props
-	 * @return string
-	 *
-	 * @static
-	 */
-	 // TODO: this method doesn't work correctly with key = true, it needs key = "true" which is odd
-	public static function substVars($val, $props = null) {
-		$sbuf = '';
-		$i = 0;
-		while(true) {
-			$j = strpos($val, self::DELIM_START, $i);
-			if($j === false) {
-				// no more variables
-				if($i == 0) { // this is a simple string
-					return $val;
-				} else { // add the tail string which contails no variables and return the result.
-					$sbuf .= substr($val, $i);
-					return $sbuf;
-				}
-			} else {
-			
-				$sbuf .= substr($val, $i, $j-$i);
-				$k = strpos($val, self::DELIM_STOP, $j);
-				if($k === false) {
-					// LoggerOptionConverter::substVars() has no closing brace. Opening brace
-					return '';
-				} else {
-					$j += self::START_LEN;
-					$key = substr($val, $j, $k - $j);
-					// first try in System properties
-					$replacement = LoggerOptionConverter::getSystemProperty($key, null);
-					// then try props parameter
-					if($replacement == null and $props !== null) {
-						$replacement = @$props[$key];
-					}
-
-					if(!empty($replacement)) {
-						// Do variable substitution on the replacement string
-						// such that we can solve "Hello ${x2}" as "Hello p1" 
-						// the where the properties are
-						// x1=p1
-						// x2=${x1}
-						$recursiveReplacement = LoggerOptionConverter::substVars($replacement, $props);
-						$sbuf .= $recursiveReplacement;
-					}
-					$i = $k + self::DELIM_STOP_LEN;
-				}
-			}
-		}
-	}
-
-}

+ 0 - 138
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerPatternConverter.php

@@ -1,138 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Array for fast space padding
- * Used by {@link LoggerPatternConverter::spacePad()}.	
- * 
- * @package log4php
- * @subpackage helpers
- */
-$GLOBALS['log4php.LoggerPatternConverter.spaces'] = array(
-	" ", // 1 space
-	"  ", // 2 spaces
-	"    ", // 4 spaces
-	"        ", // 8 spaces
-	"                ", // 16 spaces
-	"                                " ); // 32 spaces
-
-
-/**
- * LoggerPatternConverter is an abstract class that provides the formatting 
- * functionality that derived classes need.
- * 
- * <p>Conversion specifiers in a conversion patterns are parsed to
- * individual PatternConverters. Each of which is responsible for
- * converting a logging event in a converter specific manner.</p>
- * 
- * @version $Revision: 822445 $
- * @package log4php
- * @subpackage helpers
- * @abstract
- * @since 0.3
- */
-class LoggerPatternConverter {
-
-	/**
-	 * @var LoggerPatternConverter next converter in converter chain
-	 */
-	public $next = null;
-	
-	public $min = -1;
-	public $max = 0x7FFFFFFF;
-	public $leftAlign = false;
-
-	/**
-	 * Constructor 
-	 *
-	 * @param LoggerFormattingInfo $fi
-	 */
-	public function __construct($fi = null) {  
-		if($fi !== null) {
-			$this->min = $fi->min;
-			$this->max = $fi->max;
-			$this->leftAlign = $fi->leftAlign;
-		}
-	}
-  
-	/**
-	 * Derived pattern converters must override this method in order to
-	 * convert conversion specifiers in the correct way.
-	 *
-	 * @param LoggerLoggingEvent $event
-	 */
-	public function convert($event) {}
-
-	/**
-	 * A template method for formatting in a converter specific way.
-	 *
-	 * @param string &$sbuf string buffer
-	 * @param LoggerLoggingEvent $e
-	 */
-	public function format(&$sbuf, $e) {
-		$s = $this->convert($e);
-		
-		if($s == null or empty($s)) {
-			if(0 < $this->min) {
-				$this->spacePad($sbuf, $this->min);
-			}
-			return;
-		}
-		
-		$len = strlen($s);
-	
-		if($len > $this->max) {
-			$sbuf .= substr($s , 0, ($len - $this->max));
-		} else if($len < $this->min) {
-			if($this->leftAlign) {		
-				$sbuf .= $s;
-				$this->spacePad($sbuf, ($this->min - $len));
-			} else {
-				$this->spacePad($sbuf, ($this->min - $len));
-				$sbuf .= $s;
-			}
-		} else {
-			$sbuf .= $s;
-		}
-	}	
-
-	/**
-	 * Fast space padding method.
-	 *
-	 * @param string	$sbuf	   string buffer
-	 * @param integer	$length	   pad length
-	 *
-	 * @todo reimplement using PHP string functions
-	 */
-	public function spacePad($sbuf, $length) {
-		while($length >= 32) {
-		  $sbuf .= $GLOBALS['log4php.LoggerPatternConverter.spaces'][5];
-		  $length -= 32;
-		}
-		
-		for($i = 4; $i >= 0; $i--) {	
-			if(($length & (1<<$i)) != 0) {
-				$sbuf .= $GLOBALS['log4php.LoggerPatternConverter.spaces'][$i];
-			}
-		}
-
-		// $sbuf = str_pad($sbuf, $length);
-	}
-}

+ 0 - 341
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerPatternParser.php

@@ -1,341 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Most of the work of the {@link LoggerPatternLayout} class 
- * is delegated to the {@link LoggerPatternParser} class.
- * 
- * <p>It is this class that parses conversion patterns and creates
- * a chained list of {@link LoggerPatternConverter} converters.</p>
- * 
- * @version $Revision: 822445 $ 
- * @package log4php
- * @subpackage helpers
- *
- * @since 0.3
- */
-class LoggerPatternParser {
-
-	const ESCAPE_CHAR = '%';
-	
-	const LITERAL_STATE = 0;
-	const CONVERTER_STATE = 1;
-	const MINUS_STATE = 2;
-	const DOT_STATE = 3;
-	const MIN_STATE = 4;
-	const MAX_STATE = 5;
-	
-	const FULL_LOCATION_CONVERTER = 1000;
-	const METHOD_LOCATION_CONVERTER = 1001;
-	const CLASS_LOCATION_CONVERTER = 1002;
-	const FILE_LOCATION_CONVERTER = 1003;
-	const LINE_LOCATION_CONVERTER = 1004;
-	
-	const RELATIVE_TIME_CONVERTER = 2000;
-	const THREAD_CONVERTER = 2001;
-	const LEVEL_CONVERTER = 2002;
-	const NDC_CONVERTER = 2003;
-	const MESSAGE_CONVERTER = 2004;
-	
-	const DATE_FORMAT_ISO8601 = 'Y-m-d H:i:s,u'; 
-	const DATE_FORMAT_ABSOLUTE = 'H:i:s';
-	const DATE_FORMAT_DATE = 'd M Y H:i:s,u';
-
-	private $state;
-	private $currentLiteral;
-	private $patternLength;
-	private $i;
-	
-	/**
-	 * @var LoggerPatternConverter
-	 */
-	private $head = null;
-	 
-	/**
-	 * @var LoggerPatternConverter
-	 */
-	private $tail = null;
-	
-	/**
-	 * @var LoggerFormattingInfo
-	 */
-	private $formattingInfo;
-	
-	/**
-	 * @var string pattern to parse
-	 */
-	private $pattern;
-
-	/**
-	 * Constructor 
-	 *
-	 * @param string $pattern
-	 */
-	public function __construct($pattern) {
-		$this->pattern = $pattern;
-		$this->patternLength =	strlen($pattern);
-		$this->formattingInfo = new LoggerFormattingInfo();
-		$this->state = self::LITERAL_STATE;
-	}
-
-	/**
-	 * @param LoggerPatternConverter $pc
-	 */
-	public function addToList($pc) {
-		if($this->head == null) {
-			$this->head = $pc;
-			$this->tail = $this->head;
-		} else {
-			$this->tail->next = $pc;
-			$this->tail = $this->tail->next;
-		}
-	}
-
-	/**
-	 * @return string
-	 */
-	public function extractOption() {
-		if(($this->i < $this->patternLength) and ($this->pattern{$this->i} == '{')) {
-			$end = strpos($this->pattern, '}' , $this->i);
-			if($end !== false) {
-				$r = substr($this->pattern, ($this->i + 1), ($end - $this->i - 1));
-				$this->i= $end + 1;
-				return $r;
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * The option is expected to be in decimal and positive. In case of
-	 * error, zero is returned.	 
-	 */
-	public function extractPrecisionOption() {
-		$opt = $this->extractOption();
-		$r = 0;
-		if($opt !== null) {
-			if(is_numeric($opt)) {
-				$r = (int)$opt;
-				if($r <= 0) {
-					$r = 0;
-				}
-			}
-		}
-		return $r;
-	}
-
-	
-	/** Parser.
-	 * 
-	 * @return LoggerPatternConverter Returns $this->head.
-	 */
-	public function parse() {
-		$c = '';
-		$this->i = 0;
-		$this->currentLiteral = '';
-		while($this->i < $this->patternLength) {
-			$c = $this->pattern{$this->i++};
-
-			switch($this->state) {
-				case self::LITERAL_STATE:
-					// In literal state, the last char is always a literal.
-					if($this->i == $this->patternLength) {
-						$this->currentLiteral .= $c;
-						continue;
-					}
-					if($c == self::ESCAPE_CHAR) {
-						// peek at the next char.
-						switch($this->pattern{$this->i}) {
-							case self::ESCAPE_CHAR:
-								$this->currentLiteral .= $c;
-								$this->i++; // move pointer
-								break;
-							case 'n':
-								$this->currentLiteral .= PHP_EOL;
-								$this->i++; // move pointer
-								break;
-							default:
-								if(strlen($this->currentLiteral) != 0) {
-									$this->addToList(new LoggerLiteralPatternConverter($this->currentLiteral));
-								}
-								$this->currentLiteral = $c;
-								$this->state = self::CONVERTER_STATE;
-								$this->formattingInfo->reset();
-						}
-					} else {
-						$this->currentLiteral .= $c;
-					}
-					break;
-				case self::CONVERTER_STATE:
-						$this->currentLiteral .= $c;
-						switch($c) {
-						case '-':
-							$this->formattingInfo->leftAlign = true;
-							break;
-						case '.':
-							$this->state = self::DOT_STATE;
-								break;
-						default:
-							if(ord($c) >= ord('0') and ord($c) <= ord('9')) {
-								$this->formattingInfo->min = ord($c) - ord('0');
-								$this->state = self::MIN_STATE;
-							} else {
-								$this->finalizeConverter($c);
-							}
-						} // switch
-					break;
-				case self::MIN_STATE:
-					$this->currentLiteral .= $c;
-					if(ord($c) >= ord('0') and ord($c) <= ord('9')) {
-						$this->formattingInfo->min = ($this->formattingInfo->min * 10) + (ord($c) - ord('0'));
-					} else if ($c == '.') {
-						$this->state = self::DOT_STATE;
-					} else {
-						$this->finalizeConverter($c);
-					}
-					break;
-				case self::DOT_STATE:
-					$this->currentLiteral .= $c;
-					if(ord($c) >= ord('0') and ord($c) <= ord('9')) {
-						$this->formattingInfo->max = ord($c) - ord('0');
-						$this->state = self::MAX_STATE;
-					} else {
-						$this->state = self::LITERAL_STATE;
-					}
-					break;
-				case self::MAX_STATE:
-					$this->currentLiteral .= $c;
-					if(ord($c) >= ord('0') and ord($c) <= ord('9')) {
-						$this->formattingInfo->max = ($this->formattingInfo->max * 10) + (ord($c) - ord('0'));
-					} else {
-						$this->finalizeConverter($c);
-						$this->state = self::LITERAL_STATE;
-					}
-					break;
-			} // switch
-		} // while
-		if(strlen($this->currentLiteral) != 0) {
-			$this->addToList(new LoggerLiteralPatternConverter($this->currentLiteral));
-		}
-		return $this->head;
-	}
-
-	public function finalizeConverter($c) {
-		$pc = null;
-		switch($c) {
-			case 'c':
-				$pc = new LoggerCategoryPatternConverter($this->formattingInfo, $this->extractPrecisionOption());
-				$this->currentLiteral = '';
-				break;
-			case 'C':
-				$pc = new LoggerClassNamePatternConverter($this->formattingInfo, $this->extractPrecisionOption());
-				$this->currentLiteral = '';
-				break;
-			case 'd':
-				$dateFormatStr = self::DATE_FORMAT_ISO8601; // ISO8601_DATE_FORMAT;
-				$dOpt = $this->extractOption();
-
-				if($dOpt !== null)
-					$dateFormatStr = $dOpt;
-					
-				if($dateFormatStr == 'ISO8601') {
-					$df = self::DATE_FORMAT_ISO8601;
-				} else if($dateFormatStr == 'ABSOLUTE') {
-					$df = self::DATE_FORMAT_ABSOLUTE;
-				} else if($dateFormatStr == 'DATE') {
-					$df = self::DATE_FORMAT_DATE;
-				} else {
-					$df = $dateFormatStr;
-					if($df == null) {
-						$df = self::DATE_FORMAT_ISO8601;
-					}
-				}
-				$pc = new LoggerDatePatternConverter($this->formattingInfo, $df);
-				$this->currentLiteral = '';
-				break;
-			case 'F':
-				$pc = new LoggerLocationPatternConverter($this->formattingInfo, self::FILE_LOCATION_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 'l':
-				$pc = new LoggerLocationPatternConverter($this->formattingInfo, self::FULL_LOCATION_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 'L':
-				$pc = new LoggerLocationPatternConverter($this->formattingInfo, self::LINE_LOCATION_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 'm':
-				$pc = new LoggerBasicPatternConverter($this->formattingInfo, self::MESSAGE_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 'M':
-				$pc = new LoggerLocationPatternConverter($this->formattingInfo, self::METHOD_LOCATION_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 'p':
-				$pc = new LoggerBasicPatternConverter($this->formattingInfo, self::LEVEL_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 'r':
-				$pc = new LoggerBasicPatternConverter($this->formattingInfo, self::RELATIVE_TIME_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 't':
-				$pc = new LoggerBasicPatternConverter($this->formattingInfo, self::THREAD_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 'u':
-				if($this->i < $this->patternLength) {
-					$cNext = $this->pattern{$this->i};
-					if(ord($cNext) >= ord('0') and ord($cNext) <= ord('9')) {
-						$pc = new LoggerUserFieldPatternConverter($this->formattingInfo, (string)(ord($cNext) - ord('0')));
-						$this->currentLiteral = '';
-						$this->i++;
-					}
-				}
-				break;
-			case 'x':
-				$pc = new LoggerBasicPatternConverter($this->formattingInfo, self::NDC_CONVERTER);
-				$this->currentLiteral = '';
-				break;
-			case 'X':
-				$xOpt = $this->extractOption();
-				$pc = new LoggerMDCPatternConverter($this->formattingInfo, $xOpt);
-				$this->currentLiteral = '';
-				break;
-			default:
-				$pc = new LoggerLiteralPatternConverter($this->currentLiteral);
-				$this->currentLiteral = '';
-		}
-		$this->addConverter($pc);
-	}
-
-	public function addConverter($pc) {
-		$this->currentLiteral = '';
-		// Add the pattern converter to the list.
-		$this->addToList($pc);
-		// Next pattern is assumed to be a literal.
-		$this->state = self::LITERAL_STATE;
-		// Reset formatting info
-		$this->formattingInfo->reset();
-	}
-}
-

+ 0 - 228
main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutHtml.php

@@ -1,228 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * This layout outputs events in a HTML table.
- *
- * Configurable parameters for this layout are:
- * 
- * - title
- * - locationInfo
- *
- * An example for this layout:
- * 
- * {@example ../../examples/php/layout_html.php 19}<br>
- * 
- * The corresponding XML file:
- * 
- * {@example ../../examples/resources/layout_html.properties 18}
- * 
- * The above will print a HTML table that looks, converted back to plain text, like the following:<br>
- * <pre>
- *    Log session start time Wed Sep 9 00:11:30 2009
- *
- *    Time Thread Level Category   Message
- *    0    8318   INFO  root       Hello World!
- * </pre>
- * 
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage layouts
- */
-class LoggerLayoutHtml extends LoggerLayout {
-
-    /**
-     * The <b>LocationInfo</b> option takes a boolean value. By
-     * default, it is set to false which means there will be no location
-     * information output by this layout. If the the option is set to
-     * true, then the file name and line number of the statement
-     * at the origin of the log statement will be output.
-     *
-     * <p>If you are embedding this layout within a {@link LoggerAppenderMail}
-     * or a {@link LoggerAppenderMailEvent} then make sure to set the
-     * <b>LocationInfo</b> option of that appender as well.
-     * @var boolean
-     */
-    private $locationInfo = false;
-    
-    /**
-     * The <b>Title</b> option takes a String value. This option sets the
-     * document title of the generated HTML document.
-     * Defaults to 'Log4php Log Messages'.
-     * @var string
-     */
-    private $title = "Log4php Log Messages";
-    
-    /**
-     * Constructor
-     */
-    public function __construct() {
-    }
-    
-    /**
-     * The <b>LocationInfo</b> option takes a boolean value. By
-     * default, it is set to false which means there will be no location
-     * information output by this layout. If the the option is set to
-     * true, then the file name and line number of the statement
-     * at the origin of the log statement will be output.
-     *
-     * <p>If you are embedding this layout within a {@link LoggerAppenderMail}
-     * or a {@link LoggerAppenderMailEvent} then make sure to set the
-     * <b>LocationInfo</b> option of that appender as well.
-     */
-    public function setLocationInfo($flag) {
-        if (is_bool($flag)) {
-            $this->locationInfo = $flag;
-        } else {
-            $this->locationInfo = (bool)(strtolower($flag) == 'true');
-        }
-    }
-
-    /**
-     * Returns the current value of the <b>LocationInfo</b> option.
-     */
-    public function getLocationInfo() {
-        return $this->locationInfo;
-    }
-    
-    /**
-     * The <b>Title</b> option takes a String value. This option sets the
-     * document title of the generated HTML document.
-     * Defaults to 'Log4php Log Messages'.
-     */
-    public function setTitle($title) {
-        $this->title = $title;
-    }
-
-    /**
-     * @return string Returns the current value of the <b>Title</b> option.
-     */
-    public function getTitle() {
-        return $this->title;
-    }
-    
-    /**
-     * @return string Returns the content type output by this layout, i.e "text/html".
-     */
-    public function getContentType() {
-        return "text/html";
-    }
-    
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    public function format(LoggerLoggingEvent $event) {
-        $sbuf = PHP_EOL . "<tr>" . PHP_EOL;
-    
-        $sbuf .= "<td>";
-        $sbuf .= $event->getTime();
-        $sbuf .= "</td>" . PHP_EOL;
-    
-        $sbuf .= "<td title=\"" . $event->getThreadName() . " thread\">";
-        $sbuf .= $event->getThreadName();
-        $sbuf .= "</td>" . PHP_EOL;
-    
-        $sbuf .= "<td title=\"Level\">";
-        
-        $level = $event->getLevel();
-        
-        if ($level->equals(LoggerLevel::getLevelDebug())) {
-          $sbuf .= "<font color=\"#339933\">";
-          $sbuf .= $level->toString();
-          $sbuf .= "</font>";
-        } else if ($level->equals(LoggerLevel::getLevelWarn())) {
-          $sbuf .= "<font color=\"#993300\"><strong>";
-          $sbuf .= $level->toString();
-          $sbuf .= "</strong></font>";
-        } else {
-          $sbuf .= $level->toString();
-        }
-        $sbuf .= "</td>" . PHP_EOL;
-    
-        $sbuf .= "<td title=\"" . htmlentities($event->getLoggerName(), ENT_QUOTES) . " category\">";
-        $sbuf .= htmlentities($event->getLoggerName(), ENT_QUOTES);
-        $sbuf .= "</td>" . PHP_EOL;
-    
-        if ($this->locationInfo) {
-            $locInfo = $event->getLocationInformation();
-            $sbuf .= "<td>";
-            $sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES). ':' . $locInfo->getLineNumber();
-            $sbuf .= "</td>" . PHP_EOL;
-        }
-
-        $sbuf .= "<td title=\"Message\">";
-        $sbuf .= htmlentities($event->getRenderedMessage(), ENT_QUOTES);
-        $sbuf .= "</td>" . PHP_EOL;
-
-        $sbuf .= "</tr>" . PHP_EOL;
-        
-        if ($event->getNDC() != null) {
-            $sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" title=\"Nested Diagnostic Context\">";
-            $sbuf .= "NDC: " . htmlentities($event->getNDC(), ENT_QUOTES);
-            $sbuf .= "</td></tr>" . PHP_EOL;
-        }
-        return $sbuf;
-    }
-
-    /**
-     * @return string Returns appropriate HTML headers.
-     */
-    public function getHeader() {
-        $sbuf = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" . PHP_EOL;
-        $sbuf .= "<html>" . PHP_EOL;
-        $sbuf .= "<head>" . PHP_EOL;
-        $sbuf .= "<title>" . $this->title . "</title>" . PHP_EOL;
-        $sbuf .= "<style type=\"text/css\">" . PHP_EOL;
-        $sbuf .= "<!--" . PHP_EOL;
-        $sbuf .= "body, table {font-family: arial,sans-serif; font-size: x-small;}" . PHP_EOL;
-        $sbuf .= "th {background: #336699; color: #FFFFFF; text-align: left;}" . PHP_EOL;
-        $sbuf .= "-->" . PHP_EOL;
-        $sbuf .= "</style>" . PHP_EOL;
-        $sbuf .= "</head>" . PHP_EOL;
-        $sbuf .= "<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">" . PHP_EOL;
-        $sbuf .= "<hr size=\"1\" noshade>" . PHP_EOL;
-        $sbuf .= "Log session start time " . strftime('%c', time()) . "<br>" . PHP_EOL;
-        $sbuf .= "<br>" . PHP_EOL;
-        $sbuf .= "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" bordercolor=\"#224466\" width=\"100%\">" . PHP_EOL;
-        $sbuf .= "<tr>" . PHP_EOL;
-        $sbuf .= "<th>Time</th>" . PHP_EOL;
-        $sbuf .= "<th>Thread</th>" . PHP_EOL;
-        $sbuf .= "<th>Level</th>" . PHP_EOL;
-        $sbuf .= "<th>Category</th>" . PHP_EOL;
-        if ($this->locationInfo)
-            $sbuf .= "<th>File:Line</th>" . PHP_EOL;
-        $sbuf .= "<th>Message</th>" . PHP_EOL;
-        $sbuf .= "</tr>" . PHP_EOL;
-
-        return $sbuf;
-    }
-
-    /**
-     * @return string Returns the appropriate HTML footers.
-     */
-    public function getFooter() {
-        $sbuf = "</table>" . PHP_EOL;
-        $sbuf .= "<br>" . PHP_EOL;
-        $sbuf .= "</body></html>";
-
-        return $sbuf;
-    }
-}

+ 0 - 219
main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutPattern.php

@@ -1,219 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * A flexible layout configurable with pattern string.
- *
- * <p>Example:</p>
- * 
- * {@example ../../examples/php/layout_pattern.php 19}<br>
- * 
- * <p>with the following properties file:</p>
- * 
- * {@example ../../examples/resources/layout_pattern.properties 18}<br>
- * 
- * <p>would print the following:</p>
- * 
- * <pre>
- * 2009-09-09 00:27:35,787 [INFO] root: Hello World! (at src/examples/php/layout_pattern.php line 6)
- * 2009-09-09 00:27:35,787 [DEBUG] root: Second line (at src/examples/php/layout_pattern.php line 7)
- * </pre>
- *
- * <p>The conversion pattern is closely related to the conversion pattern of the printf function in C.
- * A conversion pattern is composed of literal text and format control expressions called conversion specifiers.
- * You are free to insert any literal text within the conversion pattern.</p> 
- *
- * <p>Each conversion specifier starts with a percent sign (%) and is followed by optional 
- * format modifiers and a conversion character.</p>
- * 
- * <p>The conversion character specifies the type of data, e.g. category, priority, date, thread name. 
- * The format modifiers control such things as field width, padding, left and right justification.</p>
- * 
- * <p>Note that there is no explicit separator between text and conversion specifiers.</p>
- * 
- * <p>The pattern parser knows when it has reached the end of a conversion specifier when it reads a conversion character. 
- * In the example above the conversion specifier %-5p means the priority of the logging event should be 
- * left justified to a width of five characters.</p> 
- *
- * Not all log4j conversion characters are implemented. The recognized conversion characters are:
- * - <b>c</b> Used to output the category of the logging event. The category conversion specifier can be optionally followed by precision specifier, that is a decimal constant in brackets. 
- *         If a precision specifier is given, then only the corresponding number of right most components of the category name will be printed. 
- *         By default the category name is printed in full. 
- *         For example, for the category name "a.b.c" the pattern %c{2} will output "b.c". 
- * - <b>C</b> Used to output the fully qualified class name of the caller issuing the logging request. 
- *         This conversion specifier can be optionally followed by precision specifier, that is a decimal constant in brackets. 
- *         If a precision specifier is given, then only the corresponding number of right most components of the class name will be printed. 
- *         By default the class name is output in fully qualified form. 
- *         For example, for the class name "org.apache.xyz.SomeClass", the pattern %C{1} will output "SomeClass". 
- * - <b>d</b> Used to output the date of the logging event. 
- *         The date conversion specifier may be followed by a date format specifier enclosed between braces.
- *         The format specifier follows the {@link PHP_MANUAL#date} function.
- *         Note that the special character <b>u</b> is used to as microseconds replacement (to avoid replacement,
- *         use <b>\u</b>).  
- *         For example, %d{H:i:s,u} or %d{d M Y H:i:s,u}. If no date format specifier is given then ISO8601 format is assumed. 
- *         The date format specifier admits the same syntax as the time pattern string of the SimpleDateFormat. 
- *         It is recommended to use the predefined log4php date formatters. 
- *         These can be specified using one of the strings "ABSOLUTE", "DATE" and "ISO8601" for specifying 
- *         AbsoluteTimeDateFormat, DateTimeDateFormat and respectively ISO8601DateFormat. 
- *         For example, %d{ISO8601} or %d{ABSOLUTE}. 
- * - <b>F</b> Used to output the file name where the logging request was issued. 
- * - <b>l</b> Used to output location information of the caller which generated the logging event. 
- * - <b>L</b> Used to output the line number from where the logging request was issued.
- * - <b>m</b> Used to output the application supplied message associated with the logging event.
- * - <b>M</b> Used to output the method name where the logging request was issued.  
- * - <b>p</b> Used to output the priority of the logging event.
- * - <b>r</b> Used to output the number of milliseconds elapsed since the start of 
- *            the application until the creation of the logging event. 
- * - <b>t</b> Used to output the name of the thread that generated the logging event.
- * - <b>x</b> Used to output the NDC (nested diagnostic context) associated with 
- *            the thread that generated the logging event.  
- * - <b>X</b> Used to output the MDC (mapped diagnostic context) associated with 
- *            the thread that generated the logging event. 
- *            The X conversion character must be followed by the key for the map placed between braces, 
- *            as in <i>%X{clientNumber}</i> where clientNumber is the key.
- *            The value in the MDC corresponding to the key will be output.
- *            See {@link LoggerMDC} class for more details. 
- * - <b>%</b> The sequence %% outputs a single percent sign.  
- *
- * <p>By default the relevant information is output as is. 
- *  However, with the aid of format modifiers it is possible to change the minimum field width, 
- *  the maximum field width and justification.</p> 
- *
- * <p>The optional format modifier is placed between the percent sign and the conversion character.</p>
- * <p>The first optional format modifier is the left justification flag which is just the minus (-) character. 
- *  Then comes the optional minimum field width modifier. 
- *  This is a decimal constant that represents the minimum number of characters to output. 
- *  If the data item requires fewer characters, it is padded on either the left or the right until the minimum width is reached. The default is to pad on the left (right justify) but you can specify right padding with the left justification flag. The padding character is space. If the data item is larger than the minimum field width, the field is expanded to accommodate the data. 
- *  The value is never truncated.</p>
- * 
- * <p>This behavior can be changed using the maximum field width modifier which is designated by a period 
- *  followed by a decimal constant. 
- *  If the data item is longer than the maximum field, 
- *  then the extra characters are removed from the beginning of the data item and not from the end. 
- *  For example, it the maximum field width is eight and the data item is ten characters long, 
- *  then the first two characters of the data item are dropped. 
- *  This behavior deviates from the printf function in C where truncation is done from the end.</p> 
- *
- * <p>Below are various format modifier examples for the category conversion specifier.</p> 
- * <pre>
- *   Format modifier  left justify  minimum width  maximum width  comment
- *   %20c             false         20             none           Left pad with spaces if the category name 
- *                                                                is less than 20 characters long.
- *   %-20c            true          20             none           Right pad with spaces if the category name 
- *                                                                is less than 20 characters long.  
- *   %.30c            NA            none           30             Truncate from the beginning if the category name 
- *                                                                is longer than 30 characters.  
- *   %20.30c          false         20             30             Left pad with spaces if the category name 
- *                                                                is shorter than 20 characters. 
- *                                                                However, if category name is longer than 30 chars, 
- *                                                                then truncate from the beginning.  
- *   %-20.30c         true          20             30             Right pad with spaces if the category name is 
- *                                                                shorter than 20 chars. 
- *                                                                However, if category name is longer than 30 chars, 
- *                                                                then truncate from the beginning.  
- * </pre>
- * 
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage layouts
- * @since 0.3 
- */
-class LoggerLayoutPattern extends LoggerLayout {
-	/** Default conversion Pattern */
-	const DEFAULT_CONVERSION_PATTERN = '%m%n';
-
-	/** Default conversion TTCC Pattern */
-	const TTCC_CONVERSION_PATTERN = '%r [%t] %p %c %x - %m%n';
-
-	/** The pattern. 
-	 * @var string */
-	private $pattern;
-
-	/** Head of a chain of Converters.
-	 * @var LoggerPatternConverter */
-	private $head;
-
-	private $timezone;
-
-	/**
-	 * Constructs a PatternLayout using the 
-	 * {@link DEFAULT_LAYOUT_PATTERN}.
-	 * The default pattern just produces the application supplied message.
-	 */
-	public function __construct($pattern = null) {
-		if ($pattern === null) {
-			$this->pattern = self :: DEFAULT_CONVERSION_PATTERN;
-		} else {
-			$this->pattern = $pattern;
-		}
-	}
-
-	/**
-	 * Set the <b>ConversionPattern</b> option. This is the string which
-	 * controls formatting and consists of a mix of literal content and
-	 * conversion specifiers.
-	 */
-	public function setConversionPattern($conversionPattern) {
-		$this->pattern = $conversionPattern;
-		$patternParser = new LoggerPatternParser($this->pattern);
-		$this->head = $patternParser->parse();
-	}
-
-	/**
-	 * Produces a formatted string as specified by the conversion pattern.
-	 *
-	 * @param LoggerLoggingEvent $event
-	 * @return string
-	 */
-	public function format(LoggerLoggingEvent $event) {
-		$sbuf = '';
-		$c = $this->head;
-		while ($c !== null) {
-			$c->format($sbuf, $event);
-			$c = $c->next;
-		}
-		return $sbuf;
-	}
-	
-    /**
-     * Returns an array with the formatted elements.
-     * 
-     * This method is mainly used for the prepared statements of {@see LoggerAppenderPDO}.
-     * 
-     * It requires {@link $this->pattern} to be a comma separated string of patterns like
-     * e.g. <code>%d,%c,%p,%m,%t,%F,%L</code>.
-     * 
-     * @return array(string)   An array of the converted elements i.e. timestamp, message, filename etc.
-     */
-    public function formatToArray(LoggerLoggingEvent $event) {
-        $results = array();
-        $c = $this->head;
-        while ($c !== null) {
-            if ( ! $c instanceOf LoggerLiteralPatternConverter) {
-                $sbuf = null;
-                $c->format($sbuf, $event);
-                $results[] = $sbuf;
-            }
-            $c = $c->next;
-        }
-        return $results;
-    }      
-	
-}

+ 0 - 61
main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutSimple.php

@@ -1,61 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * A simple layout.
- *
- * Returns the log statement in a format consisting of the
- * <b>level</b>, followed by " - " and then the <b>message</b>. 
- *
- * For example the following php and properties files
- * 
- * {@example ../../examples/php/layout_simple.php 19}<br>
- * 
- * {@example ../../examples/resources/layout_simple.properties 18}<br>
- *
- * would result in:
- * 
- * <samp>INFO - Hello World!</samp>
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage layouts
- */  
-class LoggerLayoutSimple extends LoggerLayout {
-    /**
-     * Constructor
-     */
-    public function __construct() {
-    }
-
-    /**
-     * Returns the log statement in a format consisting of the
-     * <b>level</b>, followed by " - " and then the
-     * <b>message</b>. For example, 
-     * <samp> INFO - "A message" </samp>
-     *
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    public function format(LoggerLoggingEvent $event) {
-        $level = $event->getLevel();
-        return $level->toString() . ' - ' . $event->getRenderedMessage(). PHP_EOL;
-    }
-}

+ 0 - 215
main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutTTCC.php

@@ -1,215 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * TTCC layout format consists of <b>t</b>ime, <b>t</b>hread, <b>c</b>ategory and nested
- * diagnostic <b>c</b>ontext information, hence the name.
- * 
- * <p>Each of the four fields can be individually enabled or
- * disabled. The time format depends on the <b>DateFormat</b> used.</p>
- *
- * <p>If no dateFormat is specified it defaults to '%c'. 
- * See php {@link PHP_MANUAL#date} function for details.</p>
- *
- * Configurable parameters for this layout are:
- * - {@link $threadPrinting} (true|false) enable/disable pid reporting.
- * - {@link $categoryPrefixing} (true|false) enable/disable logger category reporting.
- * - {@link $contextPrinting} (true|false) enable/disable NDC reporting.
- * - {@link $microSecondsPrinting} (true|false) enable/disable micro seconds reporting in timestamp.
- * - {@link $dateFormat} (string) set date format. See php {@link PHP_MANUAL#date} function for details.
- *
- * An example how to use this layout:
- * 
- * {@example ../../examples/php/layout_ttcc.php 19}<br>
- * 
- * {@example ../../examples/resources/layout_ttcc.properties 18}<br>
- *
- * The above would print:<br>
- * <samp>02:28 [13714] INFO root - Hello World!</samp>
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage layouts
- */
-class LoggerLayoutTTCC extends LoggerLayout {
-
-	/**
-	 * String constant designating no time information. Current value of
-	 * this constant is <b>NULL</b>.
-	 */
-	 // TODO: not used?
-	const LOG4PHP_LOGGER_LAYOUT_NULL_DATE_FORMAT = 'NULL';
-	
-	/**
-	 * String constant designating relative time. Current value of
-	 * this constant is <b>RELATIVE</b>.
-	 */
-	 // TODO: not used?
-	const LOG4PHP_LOGGER_LAYOUT_RELATIVE_TIME_DATE_FORMAT = 'RELATIVE';
-	
-    // Internal representation of options
-    protected $threadPrinting    = true;
-    protected $categoryPrefixing = true;
-    protected $contextPrinting   = true;
-    protected $microSecondsPrinting = true;
-    
-    /**
-     * @var string date format. See {@link PHP_MANUAL#strftime} for details
-     */
-    protected $dateFormat = '%c';
-
-    /**
-     * Constructor
-     *
-     * @param string date format
-     * @see dateFormat
-     */
-    public function __construct($dateFormat = '') {
-        if (!empty($dateFormat)) {
-            $this->dateFormat = $dateFormat;
-        }
-        return;
-    }
-
-    /**
-     * The <b>ThreadPrinting</b> option specifies whether the name of the
-     * current thread is part of log output or not. This is true by default.
-     */
-    public function setThreadPrinting($threadPrinting) {
-        $this->threadPrinting = is_bool($threadPrinting) ? 
-            $threadPrinting : 
-            (bool)(strtolower($threadPrinting) == 'true'); 
-    }
-
-    /**
-     * @return boolean Returns value of the <b>ThreadPrinting</b> option.
-     */
-    public function getThreadPrinting() {
-        return $this->threadPrinting;
-    }
-
-    /**
-     * The <b>CategoryPrefixing</b> option specifies whether {@link Category}
-     * name is part of log output or not. This is true by default.
-     */
-    public function setCategoryPrefixing($categoryPrefixing) {
-        $this->categoryPrefixing = LoggerOptionConverter::toBoolean($categoryPrefixing);
-    }
-
-    /**
-     * @return boolean Returns value of the <b>CategoryPrefixing</b> option.
-     */
-    public function getCategoryPrefixing() {
-        return $this->categoryPrefixing;
-    }
-
-    /**
-     * The <b>ContextPrinting</b> option specifies log output will include
-     * the nested context information belonging to the current thread.
-     * This is true by default.
-     */
-    public function setContextPrinting($contextPrinting) {
-        $this->contextPrinting = LoggerOptionConverter::toBoolean($contextPrinting); 
-    }
-
-    /**
-     * @return boolean Returns value of the <b>ContextPrinting</b> option.
-     */
-    public function getContextPrinting() {
-        return $this->contextPrinting;
-    }
-    
-    /**
-     * The <b>MicroSecondsPrinting</b> option specifies if microseconds infos
-     * should be printed at the end of timestamp.
-     * This is true by default.
-     */
-    public function setMicroSecondsPrinting($microSecondsPrinting) {
-        $this->microSecondsPrinting = is_bool($microSecondsPrinting) ? 
-            $microSecondsPrinting : 
-            (bool)(strtolower($microSecondsPrinting) == 'true'); 
-    }
-
-    /**
-     * @return boolean Returns value of the <b>MicroSecondsPrinting</b> option.
-     */
-    public function getMicroSecondsPrinting() {
-        return $this->microSecondsPrinting;
-    }
-    
-    
-    public function setDateFormat($dateFormat) {
-        $this->dateFormat = $dateFormat;
-    }
-    
-    /**
-     * @return string
-     */
-    public function getDateFormat() {
-        return $this->dateFormat;
-    }
-
-    /**
-     * In addition to the level of the statement and message, the
-     * returned string includes time, thread, category.
-     * <p>Time, thread, category are printed depending on options.
-     *
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    public function format(LoggerLoggingEvent $event) {
-        $timeStamp = (float)$event->getTimeStamp();
-        $format = strftime($this->dateFormat, (int)$timeStamp);
-        
-        if ($this->microSecondsPrinting) {
-            $usecs = floor(($timeStamp - (int)$timeStamp) * 1000);
-            $format .= sprintf(',%03d', $usecs);
-        }
-            
-        $format .= ' ';
-        
-        if ($this->threadPrinting) {
-            $format .= '['.getmypid().'] ';
-        }
-        
-        $level = $event->getLevel();
-        $format .= $level->toString().' ';
-        
-        if($this->categoryPrefixing) {
-            $format .= $event->getLoggerName().' ';
-        }
-       
-        if($this->contextPrinting) {
-            $ndc = $event->getNDC();
-            if($ndc != null) {
-                $format .= $ndc.' ';
-            }
-        }
-        
-        $format .= '- '.$event->getRenderedMessage();
-        $format .= PHP_EOL;
-        
-        return $format;
-    }
-
-    public function ignoresThrowable() {
-        return true;
-    }
-}

+ 0 - 222
main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutXml.php

@@ -1,222 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * The output of the LoggerXmlLayout consists of a series of log4php:event elements. 
- * 
- * <p>Parameters: {@link $locationInfo}.</p>
- *
- * <p>It does not output a complete well-formed XML file. 
- * The output is designed to be included as an external entity in a separate file to form
- * a correct XML file.</p>
- * 
- * Example:
- * 
- * {@example ../../examples/php/layout_xml.php 19}<br>
- * 
- * {@example ../../examples/resources/layout_xml.properties 18}<br>
- *
- * The above would print:
- * 
- * <pre>
- *   <log4php:eventSet xmlns:log4php="http://logging.apache.org/log4php/" version="0.3" includesLocationInfo="true">
- *     <log4php:event logger="root" level="INFO" thread="13802" timestamp="1252456226491">
- *       <log4php:message><![CDATA[Hello World!]]></log4php:message>
- *       <log4php:locationInfo class="main" file="examples/php/layout_xml.php" line="6" method="main" />
- *     </log4php:event>
- *   </log4php:eventSet>
- * </pre>
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage layouts
- */
-class LoggerLayoutXml extends LoggerLayout {
-	const LOG4J_NS_PREFIX ='log4j';
-	const LOG4J_NS = 'http://jakarta.apache.org/log4j/';
-	
-	const LOG4PHP_NS_PREFIX = 'log4php';
-	const LOG4PHP_NS = 'http://logging.apache.org/log4php/';
-	
-	const CDATA_START = '<![CDATA[';
-	const CDATA_END = ']]>';
-	const CDATA_PSEUDO_END = ']]&gt;';
-
-	const CDATA_EMBEDDED_END = ']]>]]&gt;<![CDATA[';
-
-    /**
-     * If set to true then the file name and line number of the origin of the
-     * log statement will be output.
-     * 
-     * @var boolean
-     */
-    private $locationInfo = true;
-  
-    /**
-     * @var boolean set the elements namespace
-     */
-    private $log4jNamespace = false;
-    
-    
-    /**
-     * @var string namespace
-     * @private
-     */
-    private $_namespace = self::LOG4PHP_NS;
-    
-    /**
-     * @var string namespace prefix
-     * @private
-     */
-    private $_namespacePrefix = self::LOG4PHP_NS_PREFIX;
-     
-    /** 
-     * No options to activate. 
-     */
-    public function activateOptions() {
-        if ($this->getLog4jNamespace()) {
-            $this->_namespace        = self::LOG4J_NS;
-            $this->_namespacePrefix  = self::LOG4J_NS_PREFIX;
-        } else {
-            $this->_namespace        = self::LOG4PHP_NS;
-            $this->_namespacePrefix  = self::LOG4PHP_NS_PREFIX;
-        }     
-    }
-    
-    /**
-     * @return string
-     */
-    public function getHeader() {
-        return "<{$this->_namespacePrefix}:eventSet ".
-                    "xmlns:{$this->_namespacePrefix}=\"{$this->_namespace}\" ".
-                    "version=\"0.3\" ".
-                    "includesLocationInfo=\"".($this->getLocationInfo() ? "true" : "false")."\"".
-               ">\r\n";
-    }
-
-    /**
-     * Formats a {@link LoggerLoggingEvent} in conformance with the log4php.dtd.
-     *
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    public function format(LoggerLoggingEvent $event) {
-    	$loggerName = $event->getLoggerName();
-        $timeStamp  = number_format((float)($event->getTimeStamp() * 1000), 0, '', '');
-        $thread     = $event->getThreadName();
-        $level      = $event->getLevel();
-        $levelStr   = $level->toString();
-
-        $buf = "<{$this->_namespacePrefix}:event logger=\"{$loggerName}\" level=\"{$levelStr}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">".PHP_EOL;
-        $buf .= "<{$this->_namespacePrefix}:message><![CDATA["; 
-        $this->appendEscapingCDATA($buf, $event->getRenderedMessage()); 
-        $buf .= "]]></{$this->_namespacePrefix}:message>".PHP_EOL;        
-
-        $ndc = $event->getNDC();
-        if($ndc != null) {
-            $buf .= "<{$this->_namespacePrefix}:NDC><![CDATA[";
-            $this->appendEscapingCDATA($buf, $ndc);
-            $buf .= "]]></{$this->_namespacePrefix}:NDC>".PHP_EOL;       
-        }
-
-        if ($this->getLocationInfo()) {
-            $locationInfo = $event->getLocationInformation();
-            $buf .= "<{$this->_namespacePrefix}:locationInfo ". 
-                    "class=\"" . $locationInfo->getClassName() . "\" ".
-                    "file=\"" .  htmlentities($locationInfo->getFileName(), ENT_QUOTES) . "\" ".
-                    "line=\"" .  $locationInfo->getLineNumber() . "\" ".
-                    "method=\"" . $locationInfo->getMethodName() . "\" ";
-            $buf .= "/>".PHP_EOL;
-
-        }
-
-        $buf .= "</{$this->_namespacePrefix}:event>".PHP_EOL.PHP_EOL;
-        
-        return $buf;
-
-    }
-    
-    /**
-     * @return string
-     */
-    public function getFooter() {
-        return "</{$this->_namespacePrefix}:eventSet>\r\n";
-    }
-    
-    
-    /** Whether or not file name and line number will be included in the output.
-     * 
-     * @return boolean
-     */
-    public function getLocationInfo() {
-        return $this->locationInfo;
-    }
-  
-    /**
-     * The {@link $locationInfo} option takes a boolean value. By default,
-     * it is set to false which means there will be no location
-     * information output by this layout. If the the option is set to
-     * true, then the file name and line number of the statement at the
-     * origin of the log statement will be output.
-     */
-    public function setLocationInfo($flag) {
-        $this->locationInfo = LoggerOptionConverter::toBoolean($flag, true);
-    }
-  
-	/**
-	 * @return boolean
-	 */
-	 public function getLog4jNamespace() {
-	 	return $this->log4jNamespace;
-	 }
-
-    /**
-     * @param boolean
-     */
-    public function setLog4jNamespace($flag) {
-        $this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, true);
-    }
-    
-    /**
-	 * Ensures that embeded CDEnd strings (]]&gt;) are handled properly
-	 * within message, NDC and throwable tag text.
-	 *
-	 * @param string $buf	String holding the XML data to this point.	The
-	 *						initial CDStart (<![CDATA[) and final CDEnd (]]>) 
-	 *						of the CDATA section are the responsibility of 
-	 *						the calling method.
-	 * @param string str	The String that is inserted into an existing 
-	 *						CDATA Section within buf.
-	 * @static  
-	 */
-	private function appendEscapingCDATA(&$buf, $str) {
-		if(empty($str)) {
-			return;
-		}
-	
-		$rStr = str_replace(
-			self::CDATA_END,
-			self::CDATA_EMBEDDED_END,
-			$str
-		);
-		$buf .= $rStr;
-	}
-}
-

+ 0 - 51
main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererDefault.php

@@ -1,51 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * The default Renderer renders objects by type casting.
- * 
- * Example:
- * 
- * {@example ../../examples/php/renderer_default.php 19}<br>
- * {@example ../../examples/resources/renderer_default.properties 18}<br>
- * <pre>
- * DEBUG - Now comes the current MyClass object:
- * DEBUG - Person::__set_state(array(
- *  'firstName' => 'John',
- *  'lastName' => 'Doe',
- * ))
- * </pre>
- *
- * @package log4php
- * @subpackage renderers
- * @since 0.3
- */
-class LoggerRendererDefault implements LoggerRendererObject {
-
-	/**
-	 * Render objects by type casting
-	 *
-	 * @param mixed $o the object to render
-	 * @return string
-	 */
-	public function render($o) {
-		return var_export($o, true);
-	}
-}

+ 0 - 149
main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererMap.php

@@ -1,149 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Log objects using customized renderers that implement {@link LoggerRendererObject}.
- *
- * Example:
- * {@example ../../examples/php/renderer_map.php 19}<br>
- * {@example ../../examples/resources/renderer_map.properties 18}<br>
- * <pre>
- * DEBUG - Now comes the current MyClass object:
- * DEBUG - Doe, John
- * </pre>
- * 
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage renderers
- * @since 0.3
- */
-class LoggerRendererMap {
-
-	/**
-	 * @var array
-	 */
-	private $map;
-
-	/**
-	 * @var LoggerDefaultRenderer
-	 */
-	private $defaultRenderer;
-
-	/**
-	 * Constructor
-	 */
-	public function __construct() {
-		$this->map = array();
-		$this->defaultRenderer = new LoggerRendererDefault();
-	}
-
-	/**
-	 * Add a renderer to a hierarchy passed as parameter.
-	 * Note that hierarchy must implement getRendererMap() and setRenderer() methods.
-	 *
-	 * @param LoggerHierarchy $repository a logger repository.
-	 * @param string $renderedClassName
-	 * @param string $renderingClassName
-	 * @static
-	 */
-	public function addRenderer($renderedClassName, $renderingClassName) {
-		$renderer = LoggerReflectionUtils::createObject($renderingClassName);
-		if($renderer == null) {
-			return;
-		} else {
-			$this->put($renderedClassName, $renderer);
-		}
-	}
-
-
-	/**
-	 * Find the appropriate renderer for the class type of the
-	 * <var>o</var> parameter. 
-	 *
-	 * This is accomplished by calling the {@link getByObject()} 
-	 * method if <var>o</var> is object or using {@link LoggerRendererDefault}. 
-	 * Once a renderer is found, it is applied on the object <var>o</var> and 
-	 * the result is returned as a string.
-	 *
-	 * @param mixed $o
-	 * @return string 
-	 */
-	public function findAndRender($o) {
-		if($o == null) {
-			return null;
-		} else {
-			if(is_object($o)) {
-				$renderer = $this->getByObject($o);
-				if($renderer !== null) {
-					return $renderer->render($o);
-				} else {
-					return null;
-				}
-			} else {
-				$renderer = $this->defaultRenderer;
-				return $renderer->render($o);
-			}
-		}
-	}
-
-	/**
-	 * Syntactic sugar method that calls {@link PHP_MANUAL#get_class} with the
-	 * class of the object parameter.
-	 * 
-	 * @param mixed $o
-	 * @return string
-	 */
-	public function getByObject($o) {
-		return ($o == null) ? null : $this->getByClassName(get_class($o));
-	}
-
-
-	/**
-	 * Search the parents of <var>clazz</var> for a renderer. 
-	 *
-	 * The renderer closest in the hierarchy will be returned. If no
-	 * renderers could be found, then the default renderer is returned.
-	 *
-	 * @param string $class
-	 * @return LoggerRendererObject
-	 */
-	public function getByClassName($class) {
-		$r = null;
-		for($c = strtolower($class); !empty($c); $c = get_parent_class($c)) {
-			if(isset($this->map[$c])) {
-				return $this->map[$c];
-			}
-		}
-		return $this->defaultRenderer;
-	}
-
-	public function clear() {
-		$this->map = array();
-	}
-
-	/**
-	 * Register a {@link LoggerRendererObject} for <var>clazz</var>.
-	 * @param string $class
-	 * @param LoggerRendererObject $or
-	 */
-	private function put($class, $or) {
-		$this->map[strtolower($class)] = $or;
-	}
-}

+ 0 - 46
main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererObject.php

@@ -1,46 +0,0 @@
-<?php
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *	   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @package log4php
- */
-
-/**
- * Implement this interface in order to render objects as strings using {@link LoggerRendererMap}.
- *
- * Implement this interface in order to render objects as strings using {@link LoggerRendererMap}.
- *
- * Example:
- * {@example ../../examples/php/renderer_map.php 19}<br>
- * {@example ../../examples/resources/renderer_map.properties 18}<br>
- * <pre>
- * DEBUG - Now comes the current MyClass object:
- * DEBUG - Doe, John
- * </pre>
- *
- * @version $Revision: 883108 $
- * @package log4php
- * @subpackage renderers
- * @since 0.3
- */
-interface LoggerRendererObject {
-	/**
-	 * Render the entity passed as parameter as a String.
-	 * @param mixed $o entity to render
-	 * @return string
-	 */
-	public function render($o);
-}

+ 0 - 28
main/inc/lib/phpdocx/lib/log4php/tutorials/log4php/log4php.pkg

@@ -1,28 +0,0 @@
-<refentry id="{@id}">
-
-  <refnamediv>
-    <refname>Apache log4php</refname>                                                                                                                                                                                                                                                              
-   </refnamediv>  
- 
-  <refsect1 id="{@id license}">
-    <para>
-        <![CDATA[
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements. See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License. You may obtain a copy of the License at
- 
-      http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-       ]]>
-    </para>
- </refsect1>
- 
-</refentry>

+ 0 - 148
main/inc/lib/phpdocx/lib/log4php/xml/log4php.dtd

@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<!-- Authors: Chris Taylor, Ceki Gülcü. -->
-<!-- Version: 1.2 -->
-
-<!-- PHP Port Modifications Author: Marco Vassura -->
-<!-- PHP dtd Version: $Revision: 823875 $ -->
-
-<!-- A configuration element consists of optional renderer
-elements,appender elements, categories and an optional root
-element. -->
-<!-- [log4php] -->
-<!--
-    category instead of logger cannot be used. categoryFactory is not implemented in log4php.
--->
-<!-- [/log4php] -->
-<!ELEMENT log4php:configuration (renderer*, appender*,(logger)*,root?)>
-
-<!-- The "threshold" attribute takes a level value such that all -->
-<!-- logging statements with a level equal or below this value are -->
-<!-- disabled. -->
-
-<!-- Setting the "debug" enable the printing of internal log4j logging   -->
-<!-- statements.                                                         -->
-
-<!-- By default, debug attribute is "null", meaning that we not do touch -->
-<!-- internal log4j logging settings. The "null" value for the threshold -->
-<!-- attribute can be misleading. The threshold field of a repository    -->
-<!-- cannot be set to null. The "null" value for the threshold attribute -->
-<!-- simply means don't touch the threshold field, the threshold field   --> 
-<!-- keeps its old value.                                                -->
-     
-<!ATTLIST log4php:configuration
-  xmlns:log4php            CDATA #FIXED "http://logging.apache.org/log4php"
-  threshold                (all|debug|info|warn|error|fatal|off|null) "null"
->
-
-<!-- renderer elements allow the user to customize the conversion of  -->
-<!-- message objects to String.                                       -->
-<!ELEMENT renderer EMPTY>
-<!ATTLIST renderer
-    renderedClass  CDATA #REQUIRED
-    renderingClass CDATA #REQUIRED
->
-
-<!-- Appenders must have a name and a class. -->
-<!-- Appenders may contain an error handler, a layout, optional parameters -->
-<!-- and filters. They may also reference (or include) other appenders. -->
-<!-- [log4php] -->
-<!-- error handler tag has no effects since log4php does not handle errors. Defintion deleted. -->
-<!-- [/log4php] -->
-<!ELEMENT appender (param*, layout?, filter*, appender-ref*)>
-<!ATTLIST appender
-  name      ID  #REQUIRED
-  class     CDATA   #REQUIRED
->
-
-<!ELEMENT layout (param*)>
-<!ATTLIST layout
-  class     CDATA   #REQUIRED
->
-
-<!ELEMENT filter (param*)>
-<!ATTLIST filter
-  class     CDATA   #REQUIRED
->
-
-
-<!ELEMENT param EMPTY>
-<!ATTLIST param
-  name      CDATA   #REQUIRED
-  value     CDATA   #REQUIRED
->
-
-<!ELEMENT priority EMPTY>
-<!ATTLIST priority
-  value   CDATA #REQUIRED
->
-
-<!ELEMENT level EMPTY>
-<!ATTLIST level
-  value   CDATA #REQUIRED
->
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named logger. -->
-<!ELEMENT logger (level?,appender-ref*)>
-<!ATTLIST logger
-  name      ID  #REQUIRED
-  additivity    (true|false) "true"  
->
-
-<!ELEMENT appender-ref EMPTY>
-<!ATTLIST appender-ref
-  ref IDREF #REQUIRED
->
-
-<!-- If no priority element is specified, then the configurator MUST not -->
-<!-- touch the priority of root. -->
-<!-- The root category always exists and cannot be subclassed. -->
-<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
-
-
-<!-- ==================================================================== -->
-<!--                       A logging event                                -->
-<!-- ==================================================================== -->
-<!ELEMENT log4php:eventSet (log4php:event*)>
-<!ATTLIST log4php:eventSet
-  xmlns:log4php          CDATA #FIXED "http://www.vxr.it/log4php/" 
-  version                (0.2|0.3) "0.3" 
-  includesLocationInfo   (true|false) "true"
->
-
-<!ELEMENT log4php:event (log4php:message, log4php:locationInfo?) >
-
-<!-- The timestamp format is application dependent. -->
-<!ATTLIST log4php:event
-    logger     CDATA #REQUIRED
-    level      CDATA #REQUIRED
-    thread     CDATA #REQUIRED
-    timestamp  CDATA #REQUIRED
->
-
-<!ELEMENT log4php:message (#PCDATA)>
-<!ELEMENT log4php:NDC (#PCDATA)>
-
-<!ELEMENT log4php:locationInfo EMPTY>
-<!ATTLIST log4php:locationInfo
-  class  CDATA  #REQUIRED
-  method CDATA  #REQUIRED
-  file   CDATA  #REQUIRED
-  line   CDATA  #REQUIRED
->

+ 0 - 456
main/inc/lib/phpdocx/pdf/LICENSE.LGPL

@@ -1,456 +0,0 @@
-		  GNU LESSER GENERAL PUBLIC LICENSE
-		       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-		  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-			    NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.

+ 0 - 323
main/inc/lib/phpdocx/pdf/dompdf.php

@@ -1,323 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: dompdf.php,v $
- * Created on: 2004-06-22
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * dompdf.php is a simple script to drive DOMPDF.  It can be executed from
- * a browser or from the command line.
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: dompdf.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Display command line usage:
- *
- * Usage: ./dompdf.php [options] html_file
- *
- * html_file can be a filename, a url if fopen_wrappers are enabled, or the '-'
- * character to read from standard input.
- *
- * Options:
- *  -h             Show this message
- *  -l             list available paper sizes
- *  -p size        paper size; something like 'letter', 'A4', 'legal', etc.  The default is
- *                 'letter'
- *  -o orientation either 'portrait' or 'landscape'.  Default is 'portrait'.
- *  -b path        set the 'document root' of the html_file.  Relative urls (for
- *                 stylesheets) are resolved using this directory.  Default is the
- *                 directory of html_file.
- *  -f file        the output filename.  Default is the input [html_file].pdf.
- *  -v             verbose: display html parsing warnings and file not found errors.
- *  -d             very verbose: display oodles of debugging output: every frame in the
- *                 tree is printed to stdout.
- *  -t             comma separated list of debugging types (page-break,reflow,split)
- *  -r             write the render time to the log file
- *
- *
- */
-
-function dompdf_usage() {
-  echo
-    "\nUsage: {$_SERVER["argv"][0]} [options] html_file\n\n".
-    "html_file can be a filename, a url if fopen_wrappers are enabled, or the '-' \n".
-    "character to read from standard input.\n\n".
-    "Options:\n".
-    " -h\t\tShow this message\n".
-    " -l\t\tlist available paper sizes\n".
-    " -p size\tpaper size; something like 'letter', 'A4', 'legal', etc.  The default is\n".
-    "   \t\t'" . DOMPDF_DEFAULT_PAPER_SIZE . "'\n".
-    " -o orientation\teither 'portrait' or 'landscape'.  Default is 'portrait'.\n".
-    " -b path\tset the 'document root' of the html_file.  Relative urls (for \n".
-    "        \tstylesheets) are resolved using this directory.  Default is the \n".
-    "        \tdirectory of html_file.\n".
-    " -f file\tthe output filename.  Default is the input [html_file].pdf.\n".
-    " -v     \tverbose: display html parsing warnings and file not found errors.\n".
-    " -d     \tvery verbose:  display oodles of debugging output: every frame\n".
-    "        \tin the tree printed to stdout.\n".
-    " -t             comma separated list of debugging types (page-break,reflow,split)\n\n";
-    
-
-}
-
-function getoptions() {
-
-  $opts = array();
-
-  if ( $_SERVER["argc"] == 1 )
-    return $opts;
-
-  $i = 1;
-  while ($i < $_SERVER["argc"]) {
-
-    switch ($_SERVER["argv"][$i]) {
-
-    case "--help":
-    case "-h":
-      $opts["h"] = true;
-      $i++;
-      break;
-
-    case "-l":
-      $opts["l"] = true;
-      $i++;
-      break;
-
-    case "-p":
-      if ( !isset($_SERVER["argv"][$i+1]) )
-        die("-p switch requires a size parameter\n");
-      $opts["p"] = $_SERVER["argv"][$i+1];
-      $i += 2;
-      break;
-
-    case "-o":
-      if ( !isset($_SERVER["argv"][$i+1]) )
-        die("-o switch requires an orientation parameter\n");
-      $opts["o"] = $_SERVER["argv"][$i+1];
-      $i += 2;
-      break;
-
-    case "-b":
-      if ( !isset($_SERVER["argv"][$i+1]) )
-        die("-b switch requires a path parameter\n");
-      $opts["b"] = $_SERVER["argv"][$i+1];
-      $i += 2;
-      break;
-
-    case "-f":
-      if ( !isset($_SERVER["argv"][$i+1]) )
-        die("-f switch requires a filename parameter\n");
-      $opts["f"] = $_SERVER["argv"][$i+1];
-      $i += 2;
-      break;
-
-    case "-v":
-      $opts["v"] = true;
-      $i++;
-      break;
-
-    case "-d":
-      $opts["d"] = true;
-      $i++;
-      break;
-
-    case "-t":
-      if ( !isset($_SERVER['argv'][$i + 1]) )
-        die("-t switch requires a comma separated list of types\n");
-      $opts["t"] = $_SERVER['argv'][$i+1];
-      $i += 2;
-      break;
-
-   default:
-      $opts["filename"] = $_SERVER["argv"][$i];
-      $i++;
-      break;
-    }
-
-  }
-  return $opts;
-}
-
-require_once("dompdf_config.inc.php");
-global $_dompdf_show_warnings;
-global $_dompdf_debug;
-global $_DOMPDF_DEBUG_TYPES;
-
-$sapi = php_sapi_name();
-
-switch ( $sapi ) {
-
- case "cli":
-
-  $opts = getoptions();
-
-  if ( isset($opts["h"]) || (!isset($opts["filename"]) && !isset($opts["l"])) ) {
-    dompdf_usage();
-    exit;
-  }
-
-  if ( isset($opts["l"]) ) {
-    echo "\nUnderstood paper sizes:\n";
-
-    foreach (array_keys(CPDF_Adapter::$PAPER_SIZES) as $size)
-      echo "  " . mb_strtoupper($size) . "\n";
-    exit;
-  }
-  $file = $opts["filename"];
-
-  if ( isset($opts["p"]) )
-    $paper = $opts["p"];
-  else
-    $paper = DOMPDF_DEFAULT_PAPER_SIZE;
-
-  if ( isset($opts["o"]) )
-    $orientation = $opts["o"];
-  else
-    $orientation = "portrait";
-
-  if ( isset($opts["b"]) )
-    $base_path = $opts["b"];
-
-  if ( isset($opts["f"]) )
-    $outfile = $opts["f"];
-  else {
-    if ( $file === "-" )
-      $outfile = "dompdf_out.pdf";
-    else
-      $outfile = str_ireplace(array(".html", ".htm", ".php"), "", $file) . ".pdf";
-  }
-
-  if ( isset($opts["v"]) )
-    $_dompdf_show_warnings = true;
-
-  if ( isset($opts["d"]) ) {
-    $_dompdf_show_warnings = true;
-    $_dompdf_debug = true;
-  }
-
-  if ( isset($opts['t']) ) {
-    $arr = split(',',$opts['t']);
-    $types = array();
-    foreach ($arr as $type)
-      $types[ trim($type) ] = 1;
-    $_DOMPDF_DEBUG_TYPES = $types;
-  }
-  
-  $save_file = true;
-
-  break;
-
- default:
-
- 	if ( isset($_GET["input_file"]) )
- 		$file = basename(rawurldecode($_GET["input_file"]));
- 	else
- 		throw new DOMPDF_Exception("An input file is required (i.e. input_file _GET variable).");
- 		
- 	if ( isset($_GET["paper"]) )
- 		$paper = rawurldecode($_GET["paper"]);
- 	else
- 		$paper = DOMPDF_DEFAULT_PAPER_SIZE;
- 		
- 	if ( isset($_GET["orientation"]) )
- 		$orientation = rawurldecode($_GET["orientation"]);
- 	else
- 		$orientation = "portrait";
- 		
- 	if ( isset($_GET["base_path"]) )
- 		$base_path = rawurldecode($_GET["base_path"]);
- 		
- 		
- 		$outfile = "dompdf_out.pdf"; # Don't allow them to set the output file
- 		$save_file = false; # Don't save the file
- 		$file = $base_path . $file; # Set the input file
-
- 		/* Check to see if the input file and base path = www/test */
- 		if($base_path !== "www/test/")
- 			throw new DOMPDF_Exception("Access to dompdf.php via non-cli SAPI has been deprecated due to security concerns.  Please use the dompdf class directly.");
-
-   break;
-}
-
-$dompdf = new DOMPDF();
-
-if ( $file === "-" ) {
-  $str = "";
-  while ( !feof(STDIN) )
-    $str .= fread(STDIN, 4096);
-
-  $dompdf->load_html($str);
-
-} else
-  $dompdf->load_html_file($file);
-
-if ( isset($base_path) ) {
-  $dompdf->set_base_path($base_path);
-}
-
-$dompdf->set_paper($paper, $orientation);
-
-$dompdf->render();
-
-if ( $_dompdf_show_warnings ) {
-  global $_dompdf_warnings;
-  foreach ($_dompdf_warnings as $msg)
-    echo $msg . "\n";
-  echo $dompdf->get_canvas()->get_cpdf()->messages;
-  flush();
-}
-
-if ( $save_file ) {
-//   if ( !is_writable($outfile) )
-//     throw new DOMPDF_Exception("'$outfile' is not writable.");
-  if ( strtolower(DOMPDF_PDF_BACKEND) === "gd" )
-    $outfile = str_replace(".pdf", ".png", $outfile);
-
-  list($proto, $host, $path, $file) = explode_url($outfile);
-  if ( $proto != "" ) // i.e. not file://
-    $outfile = $file; // just save it locally, FIXME? could save it like wget: ./host/basepath/file
-
-  $outfile = realpath(dirname($outfile)) . DIRECTORY_SEPARATOR . basename($outfile);
-
-  if ( strpos($outfile, DOMPDF_CHROOT) !== 0 )
-    throw new DOMPDF_Exception("Permission denied.");
-
-  file_put_contents($outfile, $dompdf->output( array("compress" => 0) ));
-  exit(0);
-}
-
-if ( !headers_sent() ) {
-  $dompdf->stream($outfile);
-}

+ 0 - 426
main/inc/lib/phpdocx/pdf/dompdf_config.inc.php

@@ -1,426 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: dompdf_config.inc.php,v $
- * Created on: 2004-08-04
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @contributor Helmut Tischer <htischer@weihenstephan.org>
- * @package dompdf
- *
- * Changes
- * @contributor Helmut Tischer <htischer@weihenstephan.org>
- * @version 0.5.1.htischer.20090507
- * - Allow overriding of configuration settings by calling php script.
- *   This allows replacing of dompdf by a new version in an application
- *   without any modification,
- * - Optionally separate font cache folder from font folder.
- *   This allows write protecting the entire installation
- * - Add settings to enable/disable additional debug output categories
- * - Change some defaults to more practical values
- * - Add comments about configuration parameter implications
- */
-
-/* $Id: dompdf_config.inc.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-error_reporting(E_ERROR);
-
-/**
- * The root of your DOMPDF installation
- */
-define("DOMPDF_DIR", str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname(__FILE__))));
-
-/**
- * The location of the DOMPDF include directory
- */
-define("DOMPDF_INC_DIR", DOMPDF_DIR . "/include");
-
-/**
- * The location of the DOMPDF lib directory
- */
-define("DOMPDF_LIB_DIR", DOMPDF_DIR . "/lib");
-
-//FIXME: Some function definitions rely on the constants defined by DOMPDF. However, might this location prove problematic?
-require_once(DOMPDF_INC_DIR . "/functions.inc.php");
-
-/**
- * The location of the DOMPDF font directory
- *
- * If DOMPDF_FONT_DIR identical to DOMPDF_FONT_CACHE or user executing DOMPDF from the CLI,
- * this directory must be writable by the webserver process ().
- * *Please note the trailing slash.*
- *
- * Notes regarding fonts:
- * Additional .afm font metrics can be added by executing load_font.php from command line.
- * Converting ttf fonts to afm requires the external tool referenced by TTF2AFM
- *
- * Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must
- * be embedded in the pdf file or the PDF may not display correctly. This can significantly
- * increase file size and could violate copyright provisions of a font. Font embedding is
- * not currently supported (? via HT).
- *
- * Any font specification in the source HTML is translated to the closest font available
- * in the font directory.
- *
- * The pdf standard "Base 14 fonts" are:
- * Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique,
- * Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,
- * Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
- * Symbol,
- * ZapfDingbats,
- *
- * *Please note the trailing slash.*
- */
-define("DOMPDF_FONT_DIR", DOMPDF_DIR . "/lib/fonts/");
-
-/**
- * The location of the DOMPDF font cache directory
- *
- * Note this directory must be writable by the webserver process
- * This folder must already exist!
- * It contains the .afm files, on demand parsed, converted to php syntax and cached
- * This folder can be the same as DOMPDF_FONT_DIR
- *
- * *Please note the trailing slash.*
- */
-
-if (!defined("DOMPDF_FONT_CACHE")) {
-  define("DOMPDF_FONT_CACHE", DOMPDF_FONT_DIR);
-}
-
-/**
- * The location of a temporary directory.
- *
- * The directory specified must be writeable by the webserver process.
- * The temporary directory is required to download remote images and when
- * using the PFDLib back end.
- */
-if (!defined('DOMPDF_TEMP_DIR')) {
-  define("DOMPDF_TEMP_DIR", sys_get_temp_dir());
-}
-
-/**
- * ==== IMPORTANT ====
- *
- * dompdf's "chroot": Prevents dompdf from accessing system files or other
- * files on the webserver.  All local files opened by dompdf must be in a
- * subdirectory of this directory.  DO NOT set it to '/' since this could
- * allow an attacker to use dompdf to read any files on the server.  This
- * should be an absolute path.
- * This is only checked on command line call by dompdf.php, but not by
- * direct class use like:
- * $dompdf = new DOMPDF();	$dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
- */
-if (!defined("DOMPDF_CHROOT")) {
-  define("DOMPDF_CHROOT", realpath(DOMPDF_DIR));
-}
-
-/**
- * Whether to use Unicode fonts or not.
- *
- * When set to true the PDF backend must be set to "CPDF" and fonts must be
- * loaded via the modified ttf2ufm tool included with dompdf (see below).
- * Unicode font metric files (with .ufm extensions) must be created with
- * ttf2ufm.  load_font.php should do this for you if the TTF2AFM define below
- * points to the modified ttf2ufm tool included with dompdf.
- *
- * When enabled, dompdf can support all Unicode glyphs.  Any glyphs used in a
- * document must be present in your fonts, however.
- *
- */
-if (!defined("DOMPDF_UNICODE_ENABLED")) {
-  define("DOMPDF_UNICODE_ENABLED", false);
-}
-
-/**
- * The path to the tt2pt1 utility (used to convert ttf to afm)
- *
- * Not strictly necessary, but useful if you would like to install
- * additional fonts using the {@link load_font.php} utility.
- *
- * Windows users should use something like this:
- * define("TTF2AFM", "C:\\Program Files\\Ttf2Pt1\\bin\\ttf2pt1.exe");
- *
- * @link http://ttf2pt1.sourceforge.net/
- */
-if (!defined("TTF2AFM")) {
-  define("TTF2AFM", DOMPDF_LIB_DIR ."/ttf2ufm/ttf2ufm-src/ttf2pt1");
-  //define("TTF2AFM", "/usr/bin/ttf2pt1");
-}
-
-/**
- * The PDF rendering backend to use
- *
- * Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and
- * 'auto'.  'auto' will look for PDFLib and use it if found, or if not it will
- * fall back on CPDF.  'GD' renders PDFs to graphic files.  {@link
- * Canvas_Factory} ultimately determines which rendering class to instantiate
- * based on this setting.
- *
- * Both PDFLib & CPDF rendering backends provide sufficient rendering
- * capabilities for dompdf, however additional features (e.g. object,
- * image and font support, etc.) differ between backends.  Please see
- * {@link PDFLib_Adapter} for more information on the PDFLib backend
- * and {@link CPDF_Adapter} and lib/class.pdf.php for more information
- * on CPDF.  Also see the documentation for each backend at the links
- * below.
- *
- * The GD rendering backend is a little different than PDFLib and
- * CPDF.  Several features of CPDF and PDFLib are not supported or do
- * not make any sense when creating image files.  For example,
- * multiple pages are not supported, nor are PDF 'objects'.  Have a
- * look at {@link GD_Adapter} for more information.  GD support is new
- * and experimental, so use it at your own risk.
- *
- * @link http://www.pdflib.com
- * @link http://www.ros.co.nz/pdf
- * @link http://www.php.net/image
- */
-if (!defined("DOMPDF_PDF_BACKEND")) {
-  define("DOMPDF_PDF_BACKEND", "CPDF");
-}
-
-/**
- * PDFlib license key
- *
- * If you are using a licensed, commercial version of PDFlib, specify
- * your license key here.  If you are using PDFlib-Lite or are evaluating
- * the commercial version of PDFlib, comment out this setting.
- *
- * @link http://www.pdflib.com
- *
- * If pdflib present in web server and auto or selected explicitely above,
- * a real license code must exist!
- */
-if (!defined("DOMPDF_PDFLIB_LICENSE")) {
-  #define("DOMPDF_PDFLIB_LICENSE", "your license key here");
-}
-
-/**
- * html target media view which should be rendered into pdf.
- * List of types and parsing rules for future extensions:
- * http://www.w3.org/TR/REC-html40/types.html
- *   screen, tty, tv, projection, handheld, print, braille, aural, all
- * Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3.
- * Note, even though the generated pdf file is intended for print output,
- * the desired content might be different (e.g. screen or projection view of html file).
- * Therefore allow specification of content here.
- */
-if (!defined("DOMPDF_DEFAULT_MEDIA_TYPE")) {
-  define("DOMPDF_DEFAULT_MEDIA_TYPE", "screen");
-}
-
-/**
- * The default paper size.
- *
- * North America standard is "letter"; other countries generally "a4"
- *
- * @see CPDF_Adapter::PAPER_SIZES for valid sizes
- */
-if (!defined("DOMPDF_DEFAULT_PAPER_SIZE")) {
-  define("DOMPDF_DEFAULT_PAPER_SIZE", "letter");
-}
-
-
-/**
- * The default font family
- *
- * Used if no suitable fonts can be found. This must exist in the font folder.
- * @var string
- */
-if (!defined("DOMPDF_DEFAULT_FONT")) {
-  define("DOMPDF_DEFAULT_FONT", "serif");
-}
-/**
- * Image DPI setting
- *
- * This setting determines the default DPI setting for images and fonts.  The
- * DPI may be overridden for inline images by explictly setting the
- * image's width & height style attributes (i.e. if the image's native
- * width is 600 pixels and you specify the image's width as 72 points,
- * the image will have a DPI of 600 in the rendered PDF.  The DPI of
- * background images can not be overridden and is controlled entirely
- * via this parameter.
- *
- * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
- * If a size in html is given as px (or without unit as image size),
- * this tells the corresponding size in pt.
- * This adjusts the relative sizes to be similar to the rendering of the
- * html page in a reference browser.
- *
- * In pdf, always 1 pt = 1/72 inch
- *
- * Rendering resolution of various browsers in px per inch:
- * Windows Firefox and Internet Explorer:
- *   SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
- * Linux Firefox:
- *   about:config *resolution: Default:96
- *   (xorg screen dimension in mm and Desktop font dpi settings are ignored)
- *
- * Take care about extra font/image zoom factor of browser.
- *
- * In images, <img> size in pixel attribute, img css style, are overriding
- * the real image dimension in px for rendering.
- *
- * @var int
- */
-if (!defined("DOMPDF_DPI")) {
-  define("DOMPDF_DPI", "96");
-}
-
-/**
- * Enable inline PHP
- *
- * If this setting is set to true then DOMPDF will automatically evaluate
- * inline PHP contained within <script type="text/php"> ... </script> tags.
- *
- * Enabling this for documents you do not trust (e.g. arbitrary remote html
- * pages) is a security risk.  Set this option to false if you wish to process
- * untrusted documents.
- *
- * @var bool
- */
-if (!defined("DOMPDF_ENABLE_PHP")) {
-  define("DOMPDF_ENABLE_PHP", true);
-}
-
-/**
- * Enable remote file access
- *
- * If this setting is set to true, DOMPDF will access remote sites for
- * images and CSS files as required.
- * This is required for part of test case www/test/image_variants.html through www/examples.php
- *
- * Attention!
- * This can be a security risk, in particular in combination with DOMPDF_ENABLE_PHP and
- * allowing remote access to dompdf.php or on allowing remote html code to be passed to
- * $dompdf = new DOMPDF(); $dompdf->load_html(...);
- * This allows anonymous users to download legally doubtful internet content which on
- * tracing back appears to being downloaded by your server, or allows malicious php code
- * in remote html pages to be executed by your server with your account privileges.
- *
- * @var bool
- */
-if (!defined("DOMPDF_ENABLE_REMOTE")) {
-  define("DOMPDF_ENABLE_REMOTE", false);
-}
- 
-/**
- * DOMPDF autoload function
- *
- * If you have an existing autoload function, add a call to this function
- * from your existing __autoload() implementation.
- *
- * TODO: use spl_autoload(), if available
- *
- * @param string $class
- */
-function DOMPDF_autoload($class) {
-  $filename = DOMPDF_INC_DIR . "/" . mb_strtolower($class) . ".cls.php";
-  
-  if ( is_file($filename) )
-    require_once($filename);
-}
-
-if ( function_exists("spl_autoload_register") ) {
-
-   spl_autoload_register("DOMPDF_autoload");
-
-} else if ( !function_exists("__autoload") ) {
-  /**
-   * Default __autoload() function
-   *
-   * @param string $class
-   */
-  function __autoload($class) {
-    DOMPDF_autoload($class);
-  }
-}
-
-// ### End of user-configurable options ###
-
-
-/**
- * Ensure that PHP is working with text internally using UTF8 character encoding.
- */
-mb_internal_encoding('UTF-8');
-
-/**
- * Global array of warnings generated by DomDocument parser and
- * stylesheet class
- *
- * @var array
- */
-global $_dompdf_warnings;
-$_dompdf_warnings = array();
-
-/**
- * If true, $_dompdf_warnings is dumped on script termination when using
- * dompdf/dompdf.php or after rendering when using the DOMPDF class.
- * When using the class, setting this value to true will prevent you from
- * streaming the PDF.
- *
- * @var bool
- */
-global $_dompdf_show_warnings;
-$_dompdf_show_warnings = false;
-
-/**
- * If true, the entire tree is dumped to stdout in dompdf.cls.php.
- * Setting this value to true will prevent you from streaming the PDF.
- *
- * @var bool
- */
-global $_dompdf_debug;
-$_dompdf_debug = false;
-
-/**
- * Array of enabled debug message types
- *
- * @var array
- */
-global $_DOMPDF_DEBUG_TYPES;
-$_DOMPDF_DEBUG_TYPES = array(); //array("page-break" => 1);
-
-/* Optionally enable different classes of debug output before the pdf content.
- * Visible if displaying pdf as text,
- * E.g. on repeated display of same pdf in browser when pdf is not taken out of
- * the browser cache and the premature output prevents setting of the mime type.
- */
-if (!defined('DEBUGPNG')) {
-  define('DEBUGPNG',0);
-}
-if (!defined('DEBUGKEEPTEMP')) {
-  define('DEBUGKEEPTEMP',0);
-}
-if (!defined('DEBUGCSS')) {
-  define('DEBUGCSS',0);
-}

+ 0 - 87
main/inc/lib/phpdocx/pdf/include/absolute_positioner.cls.php

@@ -1,87 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: absolute_positioner.cls.php,v $
- * Created on: 2004-06-08
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id */
-
-/**
- * Positions absolutly positioned frames
- */
-class Absolute_Positioner extends Positioner {
-
-  function __construct(Frame_Decorator $frame) { parent::__construct($frame); }
-
-  function position() {
-
-    $cb = $this->_frame->get_containing_block();
-
-    $style = $this->_frame->get_style();
-
-    $top = $style->length_in_pt($style->top, $cb["w"]);
-    $left =   $style->length_in_pt($style->left, $cb["w"]);
-    $right =  $style->length_in_pt($style->right, $cb["w"]);
-    $bottom = $style->length_in_pt($style->bottom, $cb["w"]);
-    
-    $p = $this->_frame->find_block_parent();
-
-    if ( $p ) {
-
-      // Get the parent's padding box (see http://www.w3.org/TR/CSS21/visuren.html#propdef-top)
-
-      list($x, $y, $w, $h) = $p->get_padding_box();
-
-    } else {
-
-      $x = $cb["x"];
-      $y = $cb["y"];
-
-    }
-
-    if ( isset($top) ) {
-      $y += $top;
-    } else if ( isset($bottom) ) {
-      // FIXME: need to know this frame's height before we can do this correctly
-    }
-
-    $x += $left;
-
-    $this->_frame->set_position($x, $y);
-
-  }
-
-}

+ 0 - 847
main/inc/lib/phpdocx/pdf/include/abstract_renderer.cls.php

@@ -1,847 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: abstract_renderer.cls.php,v $
- * Created on: 2004-06-01
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @contributor Helmut Tischer <htischer@weihenstephan.org>
- * @package dompdf
- *
- * Changes
- * @contributor Helmut Tischer <htischer@weihenstephan.org>
- * @version 0.5.1.htischer.20090507
- * - On background image
- *   - Clip invisible areas from background images, then merge identical
- *     image/size/offset to a single image.
- *   - Fix rounding of background image size.
- *   - Fix background image position given as percent
- *   - Check if identical image is already cached by cpdf. Then do not create
- *     duplicates to save memory and CPU time
- *   - Fix skipping of image repetition if area is too small
- *   - Do not create temporary files, but pass gd object directly
- */
-
-/* $Id: abstract_renderer.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Base renderer class
- *
- * @access private
- * @package dompdf
- */
-abstract class Abstract_Renderer {
-
-  /**
-   * Rendering backend
-   *
-   * @var Canvas
-   */
-  protected $_canvas;
-
-  /**
-   * Current dompdf instance
-   *
-   * @var DOMPDF
-   */
-  protected $_dompdf;
-  
-  /**
-   * Class constructor
-   *
-   * @param DOMPDF $dompdf The current dompdf instance
-   */
-  function __construct(DOMPDF $dompdf) {
-    $this->_dompdf = $dompdf;
-    $this->_canvas = $dompdf->get_canvas();
-  }
-  
-  /**
-   * Render a frame.
-   *
-   * Specialized in child classes
-   *
-   * @param Frame $frame The frame to render
-   */
-  abstract function render(Frame $frame);
-
-  //........................................................................
-
-  /**
-   * Render a background image over a rectangular area
-   *
-   * @param string $img      The background image to load
-   * @param float  $x        The left edge of the rectangular area
-   * @param float  $y        The top edge of the rectangular area
-   * @param float  $width    The width of the rectangular area
-   * @param float  $height   The height of the rectangular area
-   * @param Style  $style    The associated Style object
-   */
-  protected function _background_image($url, $x, $y, $width, $height, $style) {
-    $sheet = $style->get_stylesheet();
-
-    // Skip degenerate cases
-    if ( $width == 0 || $height == 0 )
-      return;
-
-    //debugpng
-    if (DEBUGPNG) print '[_background_image '.$url.']';
-
-    list($img, $ext) = Image_Cache::resolve_url($url,
-                                                $sheet->get_protocol(),
-                                                $sheet->get_host(),
-                                                $sheet->get_base_path());
-
-    // Bail if the image is no good
-    if ( $img === DOMPDF_LIB_DIR . "/res/broken_image.png" )
-      return;
-
-	//Try to optimize away reading and composing of same background multiple times
-	//Postponing read with imagecreatefrom   ...()
-	//final composition paramters and name not known yet
-	//Therefore read dimension directly from file, instead of creating gd object first.
-    //$img_w = imagesx($src); $img_h = imagesy($src);
-
-    list($img_w, $img_h) = getimagesize($img);
-    if (!isset($img_w) || $img_w == 0 || !isset($img_h) || $img_h == 0) {
-      return;
-    }
-
-    $repeat = $style->background_repeat;
-    $bg_color = $style->background_color;
-
-	//Increase background resolution and dependent box size according to image resolution to be placed in
-	//Then image can be copied in without resize
-    $bg_width = round((float)($width * DOMPDF_DPI) / 72);
-    $bg_height = round((float)($height * DOMPDF_DPI) / 72);
-
-    //Need %bg_x, $bg_y as background pos, where img starts, converted to pixel
-
-    list($bg_x, $bg_y) = $style->background_position;
-
-    if ( is_percent($bg_x) ) {
-      // The point $bg_x % from the left edge of the image is placed
-      // $bg_x % from the left edge of the background rectangle
-      $p = ((float)$bg_x)/100.0;
-      $x1 = $p * $img_w;
-      $x2 = $p * $bg_width;
-
-      $bg_x = round($x2 - $x1);
-    } else {
-      $bg_x = round((float)($style->length_in_pt($bg_x)*DOMPDF_DPI) / 72);
-    }
-
-    if ( is_percent($bg_y) ) {
-      // The point $bg_y % from the left edge of the image is placed
-      // $bg_y % from the left edge of the background rectangle
-      $p = ((float)$bg_y)/100.0;
-      $y1 = $p * $img_h;
-      $y2 = $p * $bg_height;
-
-      $bg_y = round($y2 - $y1);
-    } else {
-      $bg_y = round((float)($style->length_in_pt($bg_y)*DOMPDF_DPI) / 72);
-    }
-
-    //clip background to the image area on partial repeat. Nothing to do if img off area
-    //On repeat, normalize start position to the tile at immediate left/top or 0/0 of area
-    //On no repeat with positive offset: move size/start to have offset==0
-    //Handle x/y Dimensions separately
-
-    if ( $repeat !== "repeat" && $repeat !== "repeat-x" ) {
-      //No repeat x
-      if ($bg_x < 0) {
-        $bg_width = $img_w + $bg_x;
-      } else {
-        $x += ($bg_x * 72)/DOMPDF_DPI;
-        $bg_width = $bg_width - $bg_x;
-        if ($bg_width > $img_w) {
-          $bg_width = $img_w;
-        }
-        $bg_x = 0;
-      }
-      if ($bg_width <= 0) {
-      	return;
-      }
-      $width = (float)($bg_width * 72)/DOMPDF_DPI;
-    } else {
-      //repeat x
-      if ($bg_x < 0) {
-        $bg_x = - ((-$bg_x) % $img_w);
-      } else {
-        $bg_x = $bg_x % $img_w;
-        if ($bg_x > 0) {
-          $bg_x -= $img_w;
-        }
-      }
-    }
-
-    if ( $repeat !== "repeat" && $repeat !== "repeat-y" ) {
-      //no repeat y
-      if ($bg_y < 0) {
-        $bg_height = $img_h + $bg_y;
-      } else {
-        $y += ($bg_y * 72)/DOMPDF_DPI;
-        $bg_height = $bg_height - $bg_y;
-        if ($bg_height > $img_h) {
-          $bg_height = $img_h;
-        }
-        $bg_y = 0;
-      }
-      if ($bg_height <= 0) {
-      	return;
-      }
-      $height = (float)($bg_height * 72)/DOMPDF_DPI;
-    } else {
-      //repeat y
-      if ($bg_y < 0) {
-        $bg_y = - ((-$bg_y) % $img_h);
-      } else {
-        $bg_y = $bg_y % $img_h;
-        if ($bg_y > 0) {
-          $bg_y -= $img_h;
-        }
-      }
-    }
-
-    //Optimization, if repeat has no effect
-    if ( $repeat === "repeat" && $bg_y <= 0 && $img_h+$bg_y >= $bg_height ) {
-      $repeat = "repeat-x";
-    }
-    if ( $repeat === "repeat" && $bg_x <= 0 && $img_w+$bg_x >= $bg_width ) {
-      $repeat = "repeat-y";
-    }
-    if ( ($repeat === "repeat-x" && $bg_x <= 0 && $img_w+$bg_x >= $bg_width) ||
-         ($repeat === "repeat-y" && $bg_y <= 0 && $img_h+$bg_y >= $bg_height) ) {
-      $repeat = "no-repeat";
-    }
-
-	//Use filename as indicator only
-	//different names for different variants to have different copies in the pdf
-	//This is not dependent of background color of box! .'_'.(is_array($bg_color) ? $bg_color["hex"] : $bg_color)
-	//Note: Here, bg_* are the start values, not end values after going through the tile loops!
-
-	$filedummy = $img;
-
-    /* 
-    //Make shorter strings with limited characters for cache associative array index - needed?	
-	//Strip common base path - server root, explicite temp, default temp; remove unwanted characters;
-	$filedummy = strtr($filedummy,"\\:","//");
-	$p = strtr($_SERVER["DOCUMENT_ROOT"],"\\:","//");
-	$l = strlen($p);
-	if ( substr($filedummy,0,$l) == $p) {
-	  $filedummy = substr($filedummy,$l);
-	} else {
-      $p = strtr(DOMPDF_TEMP_DIR,"\\:","//");
-	  $l = strlen($p);
-	  if ( substr($filedummy,0,$l) == $p) {
-	    $filedummy = substr($filedummy,$l);
-	  } else {
-        $p = strtr(sys_get_temp_dir(),"\\:","//");
-	    $l = strlen($p);
-	    if ( substr($filedummy,0,$l) == $p) {
-	      $filedummy = substr($filedummy,$l);
-	    }
-	  }
-	}
-	*/
-	
-	$filedummy .= '_'.$bg_width.'_'.$bg_height.'_'.$bg_x.'_'.$bg_y.'_'.$repeat;
-    //debugpng
-    //if (DEBUGPNG) print '<pre>[_background_image name '.$filedummy.']</pre>';
-
-    //Optimization to avoid multiple times rendering the same image.
-    //If check functions are existing and identical image already cached,
-    //then skip creation of duplicate, because it is not needed by addImagePng
-	if ( method_exists( $this->_canvas, "get_cpdf" ) &&
-	     method_exists( $this->_canvas->get_cpdf(), "addImagePng" ) &&
-	     method_exists( $this->_canvas->get_cpdf(), "image_iscached" ) &&
-	     $this->_canvas->get_cpdf()->image_iscached($filedummy) ) {
-	  $bg = null;
-
-      //debugpng
-      //if (DEBUGPNG) print '[_background_image skip]';
-
-	} else {
-
-    // Create a new image to fit over the background rectangle
-    $bg = imagecreatetruecolor($bg_width, $bg_height);
-    //anyway default
-	//imagealphablending($img, true);
-
-    switch (strtolower($ext)) {
-
-    case "png":
-      $src = imagecreatefrompng($img);
-      break;
-
-    case "jpg":
-    case "jpeg":
-      $src = imagecreatefromjpeg($img);
-      break;
-
-    case "gif":
-      $src = imagecreatefromgif($img);
-      break;
-
-    default:
-      return; // Unsupported image type
-    }
-
-    if ($src == null) {
-      return;
-    }
-
-    //Background color if box is not relevant here
-    //Non transparent image: box clipped to real size. Background non relevant.
-    //Transparent image: The image controls the transparency and lets shine through whatever background.
-    //However on transparent imaage preset the composed image with the transparency color,
-    //to keep the transparency when copying over the non transparent parts of the tiles.
-	$ti = imagecolortransparent($src);
-	if ($ti >= 0) {
-	  $tc = imagecolorsforindex($src,$ti);
-      $ti = imagecolorallocate($bg,$tc['red'],$tc['green'],$tc['blue']);
-      imagefill($bg,0,0,$ti);
-      imagecolortransparent($bg, $ti);
-    }
-
-    //This has only an effect for the non repeatable dimension.
-    //compute start of src and dest coordinates of the single copy
-    if ( $bg_x < 0 ) {
-      $dst_x = 0;
-      $src_x = -$bg_x;
-    } else {
-      $src_x = 0;
-      $dst_x = $bg_x;
-    }
-
-    if ( $bg_y < 0 ) {
-      $dst_y = 0;
-      $src_y = -$bg_y;
-    } else {
-      $src_y = 0;
-      $dst_y = $bg_y;
-    }
-
-	//For historical reasons exchange meanings of variables:
-	//start_* will be the start values, while bg_* will be the temporary start values in the loops
-    $start_x = $bg_x;
-    $start_y = $bg_y;
-
-    // Copy regions from the source image to the background
-
-    if ( $repeat === "no-repeat" ) {
-
-      // Simply place the image on the background
-      imagecopy($bg, $src, $dst_x, $dst_y, $src_x, $src_y, $img_w, $img_h);
-
-    } else if ( $repeat === "repeat-x" ) {
-
-      for ( $bg_x = $start_x; $bg_x < $bg_width; $bg_x += $img_w ) {
-        if ( $bg_x < 0 ) {
-          $dst_x = 0;
-          $src_x = -$bg_x;
-          $w = $img_w + $bg_x;
-        } else {
-          $dst_x = $bg_x;
-          $src_x = 0;
-          $w = $img_w;
-        }
-        imagecopy($bg, $src, $dst_x, $dst_y, $src_x, $src_y, $w, $img_h);
-      }
-
-    } else if ( $repeat === "repeat-y" ) {
-
-      for ( $bg_y = $start_y; $bg_y < $bg_height; $bg_y += $img_h ) {
-        if ( $bg_y < 0 ) {
-          $dst_y = 0;
-          $src_y = -$bg_y;
-          $h = $img_h + $bg_y;
-        } else {
-          $dst_y = $bg_y;
-          $src_y = 0;
-          $h = $img_h;
-        }
-        imagecopy($bg, $src, $dst_x, $dst_y, $src_x, $src_y, $img_w, $h);
-
-      }
-
-    } else if ( $repeat === "repeat" ) {
-
-      for ( $bg_y = $start_y; $bg_y < $bg_height; $bg_y += $img_h ) {
-        for ( $bg_x = $start_x; $bg_x < $bg_width; $bg_x += $img_w ) {
-
-          if ( $bg_x < 0 ) {
-            $dst_x = 0;
-            $src_x = -$bg_x;
-            $w = $img_w + $bg_x;
-          } else {
-            $dst_x = $bg_x;
-            $src_x = 0;
-            $w = $img_w;
-          }
-
-          if ( $bg_y < 0 ) {
-            $dst_y = 0;
-            $src_y = -$bg_y;
-            $h = $img_h + $bg_y;
-          } else {
-            $dst_y = $bg_y;
-            $src_y = 0;
-            $h = $img_h;
-          }
-          imagecopy($bg, $src, $dst_x, $dst_y, $src_x, $src_y, $w, $h);
-        }
-      }
-    } else {
- print 'Unknown repeat!';
-    }   
-
-    } /* End optimize away creation of duplicates */
-
-    //img: image url string
-	//img_w, img_h: original image size in px
-	//width, height: box size in pt
-	//bg_width, bg_height: box size in px
-	//x, y: left/top edge of box on page in pt
-	//start_x, start_y: placement of image relativ to pattern
-	//$repeat: repeat mode
-	//$bg: GD object of result image
-	//$src: GD object of original image
-    //When using cpdf and optimization to direct png creation from gd object is available,
-    //don't create temp file, but place gd object directly into the pdf
-	if ( method_exists( $this->_canvas, "get_cpdf" ) && method_exists( $this->_canvas->get_cpdf(), "addImagePng" ) ) {
-      //Note: CPDF_Adapter image converts y position
-	  $this->_canvas->get_cpdf()->addImagePng(
-	  		$filedummy,
-			$x, $this->_canvas->get_height() - $y - $height, $width, $height, $bg);
-	} else {
-      $tmp_file = tempnam(DOMPDF_TEMP_DIR, "bg_dompdf_img_").'.png';
-      //debugpng
-      if (DEBUGPNG) print '[_background_image '.$tmp_file.']';
-
-      imagepng($bg, $tmp_file);
-      $this->_canvas->image($tmp_file, "png", $x, $y, $width, $height);
-
-      //debugpng
-      if (DEBUGPNG) print '[_background_image unlink '.$tmp_file.']';
-
-      if (!DEBUGKEEPTEMP)
-        unlink($tmp_file);
-    }
-  }
-
-  protected function _border_none($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    return;
-  }
-  
-  // Border rendering functions
-  protected function _border_dotted($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    list($top, $right, $bottom, $left) = $widths;
-
-    if ( $$side < 2 )
-      $dash = array($$side, 2);
-    else
-      $dash = array($$side);
-  
-    
-    switch ($side) {
-
-    case "top":
-      $delta = $top / 2;
-    case "bottom":
-      $delta = isset($delta) ? $delta : -$bottom / 2;
-      $this->_canvas->line($x, $y + $delta, $x + $length, $y + $delta, $color, $$side, $dash);
-      break;
-
-    case "left":
-      $delta = $left / 2;
-    case "right":
-      $delta = isset($delta) ? $delta : - $right / 2;
-      $this->_canvas->line($x + $delta, $y, $x + $delta, $y + $length, $color, $$side, $dash);
-      break;
-
-    default:
-      return;
-
-    }
-  }
-
-  
-  protected function _border_dashed($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    list($top, $right, $bottom, $left) = $widths;
-
-    switch ($side) {
-
-    case "top":
-      $delta = $top / 2;
-    case "bottom":
-      $delta = isset($delta) ? $delta : -$bottom / 2;
-      $this->_canvas->line($x, $y + $delta, $x + $length, $y + $delta, $color, $$side, array(3 * $$side));
-      break;
-
-    case "left":
-      $delta = $left / 2;
-    case "right":
-      $delta = isset($delta) ? $delta : - $right / 2;
-      $this->_canvas->line($x + $delta, $y, $x + $delta, $y + $length, $color, $$side, array(3 * $$side));
-      break;
-
-    default:
-      return;
-    }
-    
-  }
-
-  
-  protected function _border_solid($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    list($top, $right, $bottom, $left) = $widths;
-
-    // All this polygon business is for beveled corners...
-    switch ($side) {
-
-    case "top":
-      if ( $corner_style === "bevel" ) {
-        
-        $points = array($x, $y,
-                        $x + $length, $y,
-                        $x + $length - $right, $y + $top,
-                        $x + $left, $y + $top);
-        $this->_canvas->polygon($points, $color, null, null, true);
-      } else
-        $this->_canvas->filled_rectangle($x, $y, $length, $top, $color);
-      
-      break;
-      
-    case "bottom":
-      if ( $corner_style === "bevel" ) {
-        $points = array($x, $y,
-                        $x + $length, $y,
-                        $x + $length - $right, $y - $bottom,
-                        $x + $left, $y - $bottom);
-        $this->_canvas->polygon($points, $color, null, null, true);
-      } else
-        $this->_canvas->filled_rectangle($x, $y - $bottom, $length, $bottom, $color);
-      
-      break;
-      
-    case "left":
-      if ( $corner_style === "bevel" ) {
-        $points = array($x, $y,
-                        $x, $y + $length,
-                        $x + $left, $y + $length - $bottom,
-                        $x + $left, $y + $top);
-        $this->_canvas->polygon($points, $color, null, null, true);
-      } else
-        $this->_canvas->filled_rectangle($x, $y, $left, $length, $color);
-      
-      break;
-      
-    case "right":
-      if ( $corner_style === "bevel" ) {
-        $points = array($x, $y,
-                        $x, $y + $length,
-                        $x - $right, $y + $length - $bottom,
-                        $x - $right, $y + $top);
-        $this->_canvas->polygon($points, $color, null, null, true);
-      } else
-        $this->_canvas->filled_rectangle($x - $right, $y, $right, $length, $color);
-
-      break;
-
-    default:
-      return;
-
-    }
-        
-  }
-
-
-  protected function _border_double($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    list($top, $right, $bottom, $left) = $widths;
-    
-    $line_width = $$side / 4;
-    
-    // We draw the outermost edge first. Points are ordered: outer left,
-    // outer right, inner right, inner left, or outer top, outer bottom,
-    // inner bottom, inner top.
-    switch ($side) {
-
-    case "top":
-      if ( $corner_style === "bevel" ) {
-        $left_line_width = $left / 4;
-        $right_line_width = $right / 4;
-        
-        $points = array($x, $y,
-                        $x + $length, $y,
-                        $x + $length - $right_line_width, $y + $line_width,
-                        $x + $left_line_width, $y + $line_width,);
-        $this->_canvas->polygon($points, $color, null, null, true);
-        
-        $points = array($x + $left - $left_line_width, $y + $top - $line_width,
-                        $x + $length - $right + $right_line_width, $y + $top - $line_width,
-                        $x + $length - $right, $y + $top,
-                        $x + $left, $y + $top);
-        $this->_canvas->polygon($points, $color, null, null, true);
-
-      } else {
-        $this->_canvas->filled_rectangle($x, $y, $length, $line_width, $color);
-        $this->_canvas->filled_rectangle($x, $y + $top - $line_width, $length, $line_width, $color);
-
-      }
-      break;
-      
-    case "bottom":
-      if ( $corner_style === "bevel" ) {
-        $left_line_width = $left / 4;
-        $right_line_width = $right / 4;
-        
-        $points = array($x, $y,
-                        $x + $length, $y,
-                        $x + $length - $right_line_width, $y - $line_width,
-                        $x + $left_line_width, $y - $line_width);
-        $this->_canvas->polygon($points, $color, null, null, true);
-        
-        $points = array($x + $left - $left_line_width, $y - $bottom + $line_width,
-                        $x + $length - $right + $right_line_width, $y - $bottom + $line_width,
-                        $x + $length - $right, $y - $bottom,
-                        $x + $left, $y - $bottom);
-        $this->_canvas->polygon($points, $color, null, null, true);
-
-      } else {
-        $this->_canvas->filled_rectangle($x, $y - $line_width, $length, $line_width, $color);
-        $this->_canvas->filled_rectangle($x, $y - $bottom, $length, $line_width, $color);
-      }
-          
-      break;
-
-    case "left":
-      if ( $corner_style === "bevel" ) {
-        $top_line_width = $top / 4;
-        $bottom_line_width = $bottom / 4;
-        
-        $points = array($x, $y,
-                        $x, $y + $length,
-                        $x + $line_width, $y + $length - $bottom_line_width,
-                        $x + $line_width, $y + $top_line_width);
-        $this->_canvas->polygon($points, $color, null, null, true);
-
-        $points = array($x + $left - $line_width, $y + $top - $top_line_width,
-                        $x + $left - $line_width, $y + $length - $bottom + $bottom_line_width,
-                        $x + $left, $y + $length - $bottom,
-                        $x + $left, $y + $top);
-        $this->_canvas->polygon($points, $color, null, null, true);
-
-      } else {
-        $this->_canvas->filled_rectangle($x, $y, $line_width, $length, $color);
-        $this->_canvas->filled_rectangle($x + $left - $line_width, $y, $line_width, $length, $color);
-      }
-      
-      break;
-                      
-    case "right":
-      if ( $corner_style === "bevel" ) {
-        $top_line_width = $top / 4;
-        $bottom_line_width = $bottom / 4;
-        
-      
-        $points = array($x, $y,
-                      $x, $y + $length,
-                        $x - $line_width, $y + $length - $bottom_line_width,
-                        $x - $line_width, $y + $top_line_width);
-        $this->_canvas->polygon($points, $color, null, null, true);
-        
-        $points = array($x - $right + $line_width, $y + $top - $top_line_width,
-                        $x - $right + $line_width, $y + $length - $bottom + $bottom_line_width,
-                        $x - $right, $y + $length - $bottom,
-                        $x - $right, $y + $top);
-        $this->_canvas->polygon($points, $color, null, null, true);
-
-      } else {
-        $this->_canvas->filled_rectangle($x - $line_width, $y, $line_width, $length, $color);
-        $this->_canvas->filled_rectangle($x - $right, $y, $line_width, $length, $color);
-      }
-      
-      break;
-
-    default:
-      return;
-
-    }
-        
-  }
-
-  protected function _border_groove($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    list($top, $right, $bottom, $left) = $widths;
-      
-    $half_widths = array($top / 2, $right / 2, $bottom / 2, $left / 2);
-    
-    $this->_border_inset($x, $y, $length, $color, $half_widths, $side);
-
-    switch ($side) {
-
-    case "top":
-      $x += $left / 2;
-      $y += $top / 2;
-      $length -= $left / 2 + $right / 2;
-      break;
-
-    case "bottom":
-      $x += $left / 2;
-      $y -= $bottom / 2;
-      $length -= $left / 2 + $right / 2;
-      break;
-
-    case "left":
-      $x += $left / 2;
-      $y += $top / 2;
-      $length -= $top / 2 + $bottom / 2;
-      break;
-
-    case "right":
-      $x -= $right / 2;
-      $y += $top / 2;
-      $length -= $top / 2 + $bottom / 2;
-      break;
-
-    default:
-      return;
-
-    }
-
-    $this->_border_outset($x, $y, $length, $color, $half_widths, $side);
-    
-  }
-  
-  protected function _border_ridge($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    list($top, $right, $bottom, $left) = $widths;
-     
-    $half_widths = array($top / 2, $right / 2, $bottom / 2, $left / 2);
-    
-    $this->_border_outset($x, $y, $length, $color, $half_widths, $side);
-
-    switch ($side) {
-
-    case "top":
-      $x += $left / 2;
-      $y += $top / 2;
-      $length -= $left / 2 + $right / 2;
-      break;
-
-    case "bottom":
-      $x += $left / 2;
-      $y -= $bottom / 2;
-      $length -= $left / 2 + $right / 2;
-      break;
-
-    case "left":
-      $x += $left / 2;
-      $y += $top / 2;
-      $length -= $top / 2 + $bottom / 2;
-      break;
-
-    case "right":
-      $x -= $right / 2;
-      $y += $top / 2;
-      $length -= $top / 2 + $bottom / 2;
-      break;
-
-    default:
-      return;
-
-    }
-
-    $this->_border_inset($x, $y, $length, $color, $half_widths, $side);
-
-  }
-
-  protected function _tint($c) {
-    if ( !is_numeric($c) )
-      return $c;
-    
-    return min(1, $c + 0.66);
-  }
-
-  protected function _shade($c) {
-    if ( !is_numeric($c) )
-      return $c;
-    
-    return max(0, $c - 0.66);
-  }
-
-  protected function _border_inset($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    list($top, $right, $bottom, $left) = $widths;
-    
-    switch ($side) {
-
-    case "top":
-    case "left":
-      $shade = array_map(array($this, "_shade"), $color);
-      $this->_border_solid($x, $y, $length, $shade, $widths, $side);
-      break;
-
-    case "bottom":
-    case "right":
-      $tint = array_map(array($this, "_tint"), $color);
-      $this->_border_solid($x, $y, $length, $tint, $widths, $side);
-      break;
-
-    default:
-      return;
-    }
-  }
-  
-  protected function _border_outset($x, $y, $length, $color, $widths, $side, $corner_style = "bevel") {
-    list($top, $right, $bottom, $left) = $widths;
-    
-    switch ($side) {
-    case "top":
-    case "left":
-      $tint = array_map(array($this, "_tint"), $color);
-      $this->_border_solid($x, $y, $length, $tint, $widths, $side);
-      break;
-
-    case "bottom":
-    case "right":
-      $shade = array_map(array($this, "_shade"), $color);
-      $this->_border_solid($x, $y, $length, $shade, $widths, $side);
-      break;
-
-    default:
-      return;
-
-    }
-  }
-
-  //........................................................................
-  
-
-}

+ 0 - 490
main/inc/lib/phpdocx/pdf/include/attribute_translator.cls.php

@@ -1,490 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: attribute_translator.cls.php,v $
- * Created on: 2004-09-13
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: attribute_translator.cls.php 219 2010-03-11 23:18:31Z ryan.masten $ */
-
-/**
- * Translates HTML 4.0 attributes into CSS rules
- *
- * @access private
- * @package dompdf
- */
-class Attribute_Translator {
-  
-  // Munged data originally from
-  // http://www.w3.org/TR/REC-html40/index/attributes.html
-  //
-  // thank you var_export() :D
-  static private $__ATTRIBUTE_LOOKUP =
-    array (//'caption' => array ( 'align' => '', ),
-           'img_inner' =>  // img tags actually end up wrapping img_inner elements
-           array ('align' => array('bottom' => 'vertical-align: baseline;',
-                                   'middle' => 'vertical-align: middle;',
-                                   'top' => 'vertical-align: top;',
-                                   'left' => 'float: left;',
-                                   'right' => 'float: right;'),
-                  'border' => 'border-width: %0.2f px;',
-                  'height' => 'height: %s px;',
-                  'hspace' => 'padding-left: %1$0.2f px; padding-right: %1$0.2f px;',
-                  'vspace' => 'padding-top: %1$0.2f px; padding-bottom: %1$0.2f px;',
-                  'width' => 'width: %s px;',
-                  ),
-           'table' =>
-           array ("align" => array('left' => 'margin-left: 0; margin-right: auto;',
-                        'center' => 'margin-left: auto; margin-right: auto;',
-                        'right' => 'margin-left: auto; margin-right: 0;'
-                        ),
-                  'bgcolor' => 'background-color: %s;',
-                  'border' => '!set_table_border',
-                  'cellpadding' => '!set_table_cellpadding',
-                  'cellspacing' => 'border-spacing: %0.2f; border-collapse: separate;',
-                  'frame' => array('void' => 'border-style: none;',
-                                   'above' => 'border-top-style: solid;',
-                                   'below' => 'border-bottom-style: solid;',
-                                   'hsides' => 'border-left-style: solid; border-right-style: solid;',
-                                   'vsides' => 'border-top-style: solid; border-bottom-style: solid;',
-                                   'lhs' => 'border-left-style: solid;',
-                                   'rhs' => 'border-right-style: solid;',
-                                   'box' => 'border-style: solid;',
-                                   'border' => 'border-style: solid;'),
-                  'rules' => '!set_table_rules',
-                  'width' => 'width: %s;',
-                  ),
-           'hr' =>
-           array (
-                  'align' => '!set_hr_align', // Need to grab width to set 'left' & 'right' correctly
-                  'noshade' => 'border-style: solid;',
-                  'size' => 'border-width: %0.2f px;',
-                  'width' => 'width: %s;',
-                  ),
-           'div' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  ),
-           'h1' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  ),
-           'h2' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  ),
-           'h3' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  ),
-           'h4' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  ),
-           'h5' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  ),
-           'h6' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  ),
-           'p' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  ),
-//            'col' =>
-//            array (
-//                   'align' => '',
-//                   'valign' => '',
-//                   ),
-//            'colgroup' =>
-//            array (
-//                   'align' => '',
-//                   'valign' => '',
-//                   ),
-           'tbody' =>
-           array (
-                  'align' => '!set_table_row_align',
-                  'valign' => '!set_table_row_valign',
-                  ),
-           'td' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  'bgcolor' => 'background-color: %s;',
-                  'height' => 'height: %s;',
-                  'nowrap' => 'white-space: nowrap;',
-                  'valign' => 'vertical-align: %s;',
-                  'width' => 'width: %s;',
-                  ),
-           'tfoot' =>
-           array (
-                  'align' => '!set_table_row_align',
-                  'valign' => '!set_table_row_valign',
-                  ),
-           'th' =>
-           array (
-                  'align' => 'text-align: %s;',
-                  'bgcolor' => 'background-color: %s;',
-                  'height' => 'height: %s;',
-                  'nowrap' => 'white-space: nowrap;',
-                  'valign' => 'vertical-align: %s;',
-                  'width' => 'width: %s;',
-                  ),
-           'thead' =>
-           array (
-                  'align' => '!set_table_row_align',
-                  'valign' => '!set_table_row_valign',
-                  ),
-           'tr' =>
-           array (
-                  'align' => '!set_table_row_align',
-                  'bgcolor' => '!set_table_row_bgcolor',
-                  'valign' => '!set_table_row_valign',
-                  ),
-           'body' =>
-           array (
-                  'background' => 'background-image: url(%s);',
-                  'bgcolor' => 'background-color: %s;',
-                  'link' => '!set_body_link',
-                  'text' => 'color: %s;',
-                  ),
-           'br' =>
-           array (
-                  'clear' => 'clear: %s;',
-                  ),
-           'basefont' =>
-           array (
-                  'color' => 'color: %s;',
-                  'face' => 'font-family: %s;',
-                  'size' => '!set_basefont_size',
-                  ),
-           'font' =>
-           array (
-                  'color' => 'color: %s;',
-                  'face' => 'font-family: %s;',
-                  'size' => '!set_font_size',
-                  ),
-           'dir' =>
-           array (
-                  'compact' => 'margin: 0.5em 0;',
-                  ),
-           'dl' =>
-           array (
-                  'compact' => 'margin: 0.5em 0;',
-                  ),
-           'menu' =>
-           array (
-                  'compact' => 'margin: 0.5em 0;',
-                  ),
-           'ol' =>
-           array (
-                  'compact' => 'margin: 0.5em 0;',
-                  'start' => 'counter-reset: -dompdf-default-counter %d;',
-                  'type' => 'list-style-type: %s;',
-                  ),
-           'ul' =>
-           array (
-                  'compact' => 'margin: 0.5em 0;',
-                  'type' => 'list-style-type: %s;',
-                  ),
-           'li' =>
-           array (
-                  'type' => 'list-style-type: %s;',
-                  'value' => 'counter-reset: -dompdf-default-counter %d;',
-                  ),
-           'pre' =>
-           array (
-                  'width' => 'width: %s;',
-                  ),
-           );
-
-  
-  static protected $_last_basefont_size = 3;
-  static protected $_font_size_lookup = array(1=>"xx-small",
-                                              2=>"x-small",
-                                              3=>"medium",
-                                              4=>"large",
-                                              5=>"x-large",
-                                              6=>"xx-large",
-                                              7=>"300%");
-  
-  
-  static function translate_attributes($frame) {
-    $node = $frame->get_node();
-    $tag = $node->tagName;
-
-    if ( !isset(self::$__ATTRIBUTE_LOOKUP[$tag]) )
-      return;
-
-    $valid_attrs = self::$__ATTRIBUTE_LOOKUP[$tag];
-    $attrs = $node->attributes;
-    $style = rtrim($node->getAttribute("style"), "; ");
-    if ( $style != "" )
-      $style .= ";";
-
-    foreach ($attrs as $attr => $attr_node ) {
-      if ( !isset($valid_attrs[$attr]) )
-        continue;
-
-      $value = $attr_node->value;
-
-      $target = $valid_attrs[$attr];
-      
-      // Look up $value in $target, if $target is an array:
-      if ( is_array($target) ) {
-
-        if ( isset($target[$value]) )
-          $style .= " " . self::_resolve_target($node, $target[$value], $value);
-
-      } else {
-        // otherwise use target directly
-        $style .= " " . self::_resolve_target($node, $target, $value);
-      }
-    }
-    if ( !is_null($style) ) {
-      $style = ltrim($style);
-      $node->setAttribute("style", $style);
-    }
-    
-  }
-
-  static protected function _resolve_target($node, $target, $value) {
-    if ( $target[0] === "!" ) {
-      // Function call
-      $func = "_" . mb_substr($target, 1);
-      return self::$func($node, $value);
-    }
-    
-    return $value ? sprintf($target, $value) : "";
-  }
-
-  //.....................................................................
-
-  static protected function _set_table_cellpadding($node, $value) {
-
-    $td_list = $node->getElementsByTagName("td");
-    foreach ($td_list as $td) {
-      $style = rtrim($td->getAttribute("style"), ";");
-      $style .= "; padding: $value" . "px;";
-      $style = ltrim($style, ";");
-      $td->setAttribute("style", $style);
-    }
-    return null;
-  }
-
-  static protected function _set_table_border($node, $value) {
-    $td_list = $node->getElementsByTagName("td");
-    foreach ($td_list as $td) {
-      $style = $td->getAttribute("style");
-      if ( strpos($style, "border") !== false )
-        continue;
-      $style = rtrim($style, ";");
-      $style .= "; border-width: $value" . "px; border-style: ridge;";
-      $style = ltrim($style, ";");
-      $td->setAttribute("style", $style);
-    }
-    $th_list = $node->getElementsByTagName("th");
-    foreach ($th_list as $th) {
-      $style = $th->getAttribute("style");
-      if ( strpos($style, "border") !== false )
-        continue;
-      $style = rtrim($style, ";");
-      $style .= "; border-width: $value" . "px; border-style: ridge;";
-      $style = ltrim($style, ";");
-      $th->setAttribute("style", $style);
-    }
-    
-    return null;
-  }
-
-  static protected function _set_table_cellspacing($node, $value) {
-    $style = rtrim($td->getAttribute($style), ";");
-
-    if ( $value == 0 )
-      $style .= "; border-collapse: collapse;";
-      
-    else
-      $style = "; border-collapse: separate;";
-      
-    return ltrim($style, ";");
-  }
-  
-  static protected function _set_table_rules($node, $value) {
-    $new_style = "; border-collapse: collapse;";
-    switch ($value) {
-    case "none":
-      $new_style .= "border-style: none;";
-      break;
-
-    case "groups":
-      // FIXME: unsupported
-      return;
-
-    case "rows":
-      $new_style .= "border-style: solid none solid none; border-width: 1px; ";
-      break;
-
-    case "cols":
-      $new_style .= "border-style: none solid none solid; border-width: 1px; ";
-      break;
-
-    case "all":
-      $new_style .= "border-style: solid; border-width: 1px; ";
-      break;
-      
-    default:
-      // Invalid value
-      return null;
-    }
-
-    $td_list = $node->getElementsByTagName("td");
-    
-    foreach ($td_list as $td) {
-      $style = $td->getAttribute("style");
-      $style .= $new_style;
-      $td->setAttribute("style", $style);
-    }
-    return null;
-  }
-
-  static protected function _set_hr_align($node, $value) {
-
-    $style = rtrim($node->getAttribute("style"),";");
-    $width = $node->getAttribute("width");
-    if ( $width == "" )
-      $width = "100%";
-
-    $remainder = 100 - (double)rtrim($width, "% ");
-    
-    switch ($value) {
-    case "left":
-      $style .= "; margin-right: $remainder %;";
-      break;
-
-    case "right":
-      $style .= "; margin-left: $remainder %;";
-      break;
-
-    case "center":
-      $style .= "; margin-left: auto; margin-right: auto;";
-      break;
-
-    default:
-      return null;
-    }
-    return ltrim($style, "; ");
-    
-  }
-
-  static protected function _set_table_row_align($node, $value) {
-
-    $td_list = $node->getElementsByTagName("td");
-
-    foreach ($td_list as $td) {
-      $style = rtrim($td->getAttribute("style"), ";");
-      $style .= "; text-align: $value;";
-      $style = ltrim($style, "; ");
-      $td->setAttribute("style", $style);
-    }
-
-    return null;
-  }
-
-  static protected function _set_table_row_valign($node, $value) {
-
-    $td_list = $node->getElementsByTagName("td");
-
-    foreach ($td_list as $td) {
-      $style = rtrim($td->getAttribute("style"), ";");
-      $style .= "; vertical-align: $value;";
-      $style = ltrim($style, "; ");
-      $td->setAttribute("style", $style);
-    }
-
-    return null;
-  }
-
-  static protected function _set_table_row_bgcolor($node, $value) {
-
-    $td_list = $node->getElementsByTagName("td");
-
-    foreach ($td_list as $td) {
-      $style = rtrim($td->getAttribute("style"), ";");
-      $style .= "; background-color: $value;";
-      $style = ltrim($style, "; ");
-      $td->setAttribute("style", $style);
-    }
-
-    return null;
-  }
-
-  static protected function _set_body_link($node, $value) {
-
-    $a_list = $node->getElementsByTagName("a");
-
-    foreach ($a_list as $a) {
-      $style = rtrim($a->getAttribute("style"), ";");
-      $style .= "; color: $value;";
-      $style = ltrim($style, "; ");
-      $a->setAttribute("style", $style);
-    }
-
-    return null;
-  }
-
-  static protected function _set_basefont_size($node, $value) {
-    // FIXME: ? we don't actually set the font size of anything here, just
-    // the base size for later modification by <font> tags.
-    self::$_last_basefont_size = $value;
-    return null;
-  }
-  
-  static protected function _set_font_size($node, $value) {
-    $style = $node->getAttribute("style");
-
-    if ( $value[0] === "-" || $value[0] === "+" )
-      $value = self::$_last_basefont_size + (int)$value;
-
-    if ( isset(self::$_font_size_lookup[$value]) )
-      $style .= "; font-size: " . self::$_font_size_lookup[$value] . ";";
-    else
-      $style .= "; font-size: $value;";
-
-    return ltrim($style, "; ");
-    
-  }
-
-}

+ 0 - 297
main/inc/lib/phpdocx/pdf/include/block_frame_decorator.cls.php

@@ -1,297 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: block_frame_decorator.cls.php,v $
- * Created on: 2004-06-02
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: block_frame_decorator.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Decorates frames for block layout
- *
- * @access private
- * @package dompdf
- */
-class Block_Frame_Decorator extends Frame_Decorator {
-
-  const DEFAULT_COUNTER = "-dompdf-default-counter";
-
-  protected $_lines; // array( [num] => array([frames] => array(<frame list>),
-                     //                 y, w, h) )
-  protected $_counters; // array([id] => counter_value) (for generated content)
-  protected $_cl;    // current line index
-
-  //........................................................................
-
-  function __construct(Frame $frame, DOMPDF $dompdf) {
-    parent::__construct($frame, $dompdf);
-    $this->_lines = array(array("frames" => array(),
-                                "wc" => 0,
-                                "y" => null,
-                                "w" => 0,
-                                "h" => 0));
-    $this->_counters = array(self::DEFAULT_COUNTER => 0);
-    $this->_cl = 0;
-
-  }
-
-  //........................................................................
-
-  function reset() {
-    parent::reset();
-    $this->_lines = array(array("frames" => array(),
-                                "wc" => 0,
-                                "y" => null,
-                                "w" => 0,
-                                "h" => 0));
-    $this->_counters = array(self::DEFAULT_COUNTER => 0);
-    $this->_cl = 0;
-  }
-
-  //........................................................................
-
-  // Accessor methods
-
-  function get_current_line($i = null) {
-    $cl = $this->_lines[$this->_cl];
-    if ( isset($i) )
-      return $cl[$i];
-    return $cl;
-  }
-
-  function get_lines() { return $this->_lines; }
-
-  //........................................................................
-
-  // Set methods
-  function set_current_line($y = null, $w = null, $h = null) {
-    $this->set_line($this->_cl, $y, $w, $h);
-  }
-
-  function clear_line($i) {
-    if ( isset($this->_lines[$i]) )
-      unset($this->_lines[$i]);
-  }
-
-  function set_line($lineno, $y = null, $w = null, $h = null) {
-
-    if ( is_array($y) )
-      extract($y);
-
-    if (is_numeric($y))
-      $this->_lines[$lineno]["y"] = $y;
-
-    if (is_numeric($w))
-      $this->_lines[$lineno]["w"] = $w;
-
-    if (is_numeric($h))
-      $this->_lines[$lineno]["h"] = $h;
-
-  }
-
-
-  function add_frame_to_line(Frame $frame) {
-
-    // Handle inline frames (which are effectively wrappers)
-    if ( $frame instanceof Inline_Frame_Decorator ) {
-
-      // Handle line breaks
-      if ( $frame->get_node()->nodeName === "br" ) {
-        $this->maximize_line_height( $frame->get_style()->length_in_pt($frame->get_style()->line_height) );
-        $this->add_line();
-        return;
-      }
-
-      // Add each child of the inline frame to the line individually
-      foreach ($frame->get_children() as $child)
-        $this->add_frame_to_line( $child );
-
-      return;
-    }
-
-    // Trim leading text if this is an empty line.  Kinda a hack to put it here,
-    // but what can you do...
-    if ( $this->_lines[$this->_cl]["w"] == 0 &&
-         $frame->get_node()->nodeName === "#text" &&
-         ($frame->get_style()->white_space !== "pre" ||
-          $frame->get_style()->white_space !== "pre-wrap") ) {
-
-      $frame->set_text( ltrim($frame->get_text()) );
-      $frame->recalculate_width();
-
-    }
-
-    $w = $frame->get_margin_width();
-
-    if ( $w == 0 )
-      return;
-
-    // Debugging code:
-    /*
-    pre_r("\nAdding frame to line:");
-
-    //    pre_r("Me: " . $this->get_node()->nodeName . " (" . spl_object_hash($this->get_node()) . ")");
-    //    pre_r("Node: " . $frame->get_node()->nodeName . " (" . spl_object_hash($frame->get_node()) . ")");
-    if ( $frame->get_node()->nodeName === "#text" )
-      pre_r($frame->get_node()->nodeValue);
-
-    pre_r("Line width: " . $this->_lines[$this->_cl]["w"]);
-    pre_r("Frame: " . get_class($frame));
-    pre_r("Frame width: "  . $w);
-    pre_r("Frame height: " . $frame->get_margin_height());
-    pre_r("Containing block width: " . $this->get_containing_block("w"));
-    */
-    // End debugging
-
-    if ($this->_lines[$this->_cl]["w"] + $w > $this->get_containing_block("w"))
-      $this->add_line();
-
-    $frame->position();
-
-
-    $this->_lines[$this->_cl]["frames"][] = $frame;
-
-    if ( $frame->get_node()->nodeName === "#text")
-      $this->_lines[$this->_cl]["wc"] += count(preg_split("/\s+/", $frame->get_text()));
-
-    $this->_lines[$this->_cl]["w"] += $w;
-    $this->_lines[$this->_cl]["h"] = max($this->_lines[$this->_cl]["h"], $frame->get_margin_height());
-
-  }
-
-  function remove_frames_from_line(Frame $frame) {
-    // Search backwards through the lines for $frame
-    $i = $this->_cl;
-
-    while ($i >= 0) {
-      if ( ($j = in_array($frame, $this->_lines[$i]["frames"], true)) !== false )
-        break;
-      $i--;
-    }
-
-    if ( $j === false )
-      return;
-
-    // Remove $frame and all frames that follow
-    while ($j < count($this->_lines[$i]["frames"])) {
-      $f = $this->_lines[$i]["frames"][$j];
-      unset($this->_lines[$i]["frames"][$j++]);
-      $this->_lines[$i]["w"] -= $f->get_margin_width();
-    }
-
-    // Recalculate the height of the line
-    $h = 0;
-    foreach ($this->_lines[$i]["frames"] as $f)
-      $h = max( $h, $f->get_margin_height() );
-
-    $this->_lines[$i]["h"] = $h;
-
-    // Remove all lines that follow
-    while ($this->_cl > $i)
-      unset($this->_lines[ $this->_cl-- ]);
-
-  }
-
-  function increase_line_width($w) {
-    $this->_lines[ $this->_cl ]["w"] += $w;
-  }
-
-  function maximize_line_height($val) {
-    $this->_lines[ $this->_cl ]["h"] = max($this->_lines[ $this->_cl ]["h"], $val);
-  }
-
-  function add_line() {
-
-//     if ( $this->_lines[$this->_cl]["h"] == 0 ) //count($this->_lines[$i]["frames"]) == 0 ||
-//       return;
-
-    $y = $this->_lines[$this->_cl]["y"] + $this->_lines[$this->_cl]["h"];
-
-    $this->_lines[ ++$this->_cl ] = array("frames" => array(),
-                                          "wc" => 0,
-                                          "y" => $y, "w" => 0, "h" => 0);
-  }
-
-  //........................................................................
-
-  function reset_counter($id = self::DEFAULT_COUNTER, $value = 0) {
-    $this->_counters[$id] = $value;
-  }
-
-  function increment_counter($id = self::DEFAULT_COUNTER, $increment = 1) {
-    if ( !isset($this->_counters[$id]) )
-      $this->_counters[$id] = $increment;
-    else
-      $this->_counters[$id] += $increment;
-
-  }
-
-  function counter_value($id = self::DEFAULT_COUNTER, $type = "decimal") {
-    $type = mb_strtolower($type);
-    if ( !isset($this->_counters[$id]) )
-      $this->_counters[$id] = 0;
-
-    switch ($type) {
-
-    default:
-    case "decimal":
-      return $this->_counters[$id];
-
-    case "decimal-leading-zero":
-      return str_pad($this->_counters[$id], 2, "0");
-
-    case "lower-roman":
-      return dec2roman($this->_counters[$id]);
-
-    case "upper-roman":
-      return mb_strtoupper(dec2roman($this->_counters[$id]));
-
-    case "lower-latin":
-    case "lower-alpha":
-      return chr( ($this->_counters[$id] % 26) + ord('a') - 1);
-
-    case "upper-latin":
-    case "upper-alpha":
-      return chr( ($this->_counters[$id] % 26) + ord('A') - 1);
-
-    case "lower-greek":
-      return chr($this->_counters[$id] + 944);
-
-    case "upper-greek":
-      return chr($this->_counters[$id] + 912);
-    }
-  }
-}

+ 0 - 611
main/inc/lib/phpdocx/pdf/include/block_frame_reflower.cls.php

@@ -1,611 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: block_frame_reflower.cls.php,v $
- * Created on: 2004-06-17
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: block_frame_reflower.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Reflows block frames
- *
- * @access private
- * @package dompdf
- */
-class Block_Frame_Reflower extends Frame_Reflower {
-  const MIN_JUSTIFY_WIDTH = 0.80;  // (Minimum line width to justify, as
-                                   // fraction of available width)
-
-  function __construct(Block_Frame_Decorator $frame) { parent::__construct($frame); }
-
-  //........................................................................
-
-  // Calculate the ideal used value for the width property as per:
-  // http://www.w3.org/TR/CSS21/visudet.html#Computing_widths_and_margins
-
-  protected function _calculate_width($width) {
-    $style = $this->_frame->get_style();
-    $w = $this->_frame->get_containing_block("w");
-
-    $rm = $style->length_in_pt($style->margin_right, $w);
-    $lm = $style->length_in_pt($style->margin_left, $w);
-
-    $left = $style->length_in_pt($style->left, $w);
-    $right = $style->length_in_pt($style->right, $w);
-    
-    // Handle 'auto' values
-    $dims = array($style->border_left_width,
-                  $style->border_right_width,
-                  $style->padding_left,
-                  $style->padding_right,
-                  $width !== "auto" ? $width : 0,
-                  $rm !== "auto" ? $rm : 0,
-                  $lm !== "auto" ? $lm : 0);
-
-    // absolutely positioned boxes take the 'left' and 'right' properties into account
-    if ( $style->position === "absolute" || $style->position === "fixed" ) {
-      $absolute = true;
-      $dims[] = $left !== "auto" ? $left : 0;
-      $dims[] = $right !== "auto" ? $right : 0;
-    } else {
-      $absolute = false;
-    }
-
-    $sum = $style->length_in_pt($dims, $w);
-
-    // Compare to the containing block
-    $diff = $w - $sum;
-
-    if ( $diff > 0 ) {
-
-      if ( $absolute ) {
-
-        // resolve auto properties: see
-        // http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width
-
-        if ( $width === "auto" && $left === "auto" && $right === "auto" ) {
-
-          if ( $lm === "auto" )
-            $lm = 0;
-          if ( $rm === "auto" )
-            $rm = 0;
-
-          // Technically, the width should be "shrink-to-fit" i.e. based on the
-          // preferred width of the content...  a little too costly here as a
-          // special case.  Just get the width to take up the slack:
-          $left = 0;
-          $right = 0;
-          $width = $diff;
-
-        } else if ( $width === "auto" ) {
-
-          if ( $lm === "auto" )
-            $lm = 0;
-          if ( $rm === "auto" )
-            $rm = 0;
-          if ( $left === "auto" )
-            $left = 0;
-          if ( $right === "auto" )
-            $right = 0;
-
-          $width = $diff;
-
-        } else if ( $left === "auto" ) {
-          if ( $lm === "auto" )
-            $lm = 0;
-          if ( $rm === "auto" )
-            $rm = 0;
-          if ( $right === "auto" )
-            $right = 0;
-
-          $left = $diff;
-
-        } else if ( $right === "auto" ) {
-
-          if ( $lm === "auto" )
-            $lm = 0;
-          if ( $rm === "auto" )
-            $rm = 0;
-
-          $right = $diff;
-        }
-
-      } else {
-
-        // Find auto properties and get them to take up the slack
-        if ( $width === "auto" )
-          $width = $diff;
-
-        else if ( $lm === "auto" && $rm === "auto" )
-          $lm = $rm = round($diff / 2);
-
-        else if ( $lm === "auto" )
-          $lm = $diff;
-
-        else if ( $rm === "auto" )
-          $rm = $diff;
-      }
-
-    } else if ($diff < 0) {
-
-      // We are over constrained--set margin-right to the difference
-      $rm = $diff;
-
-    }
-
-    $ret = array("width"=> $width, "margin_left" => $lm, "margin_right" => $rm, "left" => $left, "right" => $right);
-
-    return $ret;
-  }
-
-  // Call the above function, but resolve max/min widths
-  protected function _calculate_restricted_width() {
-    $style = $this->_frame->get_style();
-    $cb = $this->_frame->get_containing_block();
-
-    if ( !isset($cb["w"]) )
-      throw new DOMPDF_Exception("Box property calculation requires containing block width");
-
-    // Treat width 100% as auto
-    if ( $style->width === "100%" )
-      $width = "auto";
-    else
-      $width = $style->length_in_pt($style->width, $cb["w"]);
-
-    extract($this->_calculate_width($width));
-
-    // Handle min/max width
-    $min_width = $style->length_in_pt($style->min_width, $cb["w"]);
-    $max_width = $style->length_in_pt($style->max_width, $cb["w"]);
-
-    if ( $max_width !== "none" && $min_width > $max_width)
-      // Swap 'em
-      list($max_width, $min_width) = array($min_width, $max_width);
-
-    if ( $max_width !== "none" && $width > $max_width )
-      extract($this->_calculate_width($max_width));
-
-    if ( $width < $min_width )
-      extract($this->_calculate_width($min_width));
-
-    return array($width, $margin_left, $margin_right, $left, $right);
-
-  }
-
-  //........................................................................
-
-  // Determine the unrestricted height of content within the block
-  protected function _calculate_content_height() {
-
-    // Calculate the actual height
-    $height = 0;
-    
-    // Add the height of all lines
-    foreach ($this->_frame->get_lines() as $line)
-      $height += $line["h"];
-
-    return $height;
-
-  }
-
-  // Determine the frame's restricted height
-  protected function _calculate_restricted_height() {
-    $style = $this->_frame->get_style();
-    $content_height = $this->_calculate_content_height();
-    $cb = $this->_frame->get_containing_block();
-
-    $height = $style->length_in_pt($style->height, $cb["h"]);
-
-    $top = $style->length_in_pt($style->top, $cb["h"]);
-    $bottom = $style->length_in_pt($style->bottom, $cb["h"]);
-
-    $margin_top = $style->length_in_pt($style->margin_top, $cb["h"]);
-    $margin_bottom = $style->length_in_pt($style->margin_bottom, $cb["h"]);
-
-    if ( $style->position === "absolute" || $style->position === "fixed" ) {
-
-      // see http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height
-
-      $dims = array($top !== "auto" ? $top : 0,
-                    $style->margin_top !== "auto" ? $style->margin_top : 0,
-                    $style->padding_top,
-                    $style->border_top_width,
-                    $height !== "height" ? $height : 0,
-                    $style->border_bottom_width,
-                    $style->padding_bottom,
-                    $style->margin_bottom !== "auto" ? $style->margin_bottom : 0,
-                    $bottom !== "auto" ? $bottom : 0);
-
-      $sum = $style->length_in_pt($dims, $cb["h"]);
-
-      $diff = $cb["h"] - $sum; 
-
-      if ( $diff > 0 ) {
-
-        if ( $height === "auto" && $top === "auto" && $bottom === "auto" ) {
-
-          if ( $margin_top === "auto" ) 
-            $margin_top = 0;
-          if ( $margin_bottom === "auto" )
-            $margin_bottom = 0;
-
-          $height = $diff;
-
-        } else if ( $height === "auto" && $top === "auto" ) {
-
-          if ( $margin_top === "auto" ) 
-            $margin_top = 0;
-          if ( $margin_bottom === "auto" )
-            $margin_bottom = 0;
-
-          $height = $content_height;
-          $top = $diff - $content_height;
-
-        } else if ( $height === "auto" && $bottom === "auto" ) {
-
-          if ( $margin_top === "auto" ) 
-            $margin_top = 0;
-          if ( $margin_bottom === "auto" )
-            $margin_bottom = 0;
-
-          $height = $content_height;
-          $bottom = $diff - $content_height;
-
-        } else if ( $top === "auto" && $bottom === "auto" ) {
-
-          if ( $margin_top === "auto" ) 
-            $margin_top = 0;
-          if ( $margin_bottom === "auto" )
-            $margin_bottom = 0;
-
-          $bottom = $diff;
-
-        } else if ( $top === "auto" ) {
-
-          if ( $margin_top === "auto" ) 
-            $margin_top = 0;
-          if ( $margin_bottom === "auto" )
-            $margin_bottom = 0;
-
-          $top = $diff;
-
-        } else if ( $height === "auto" ) {
-
-          if ( $margin_top === "auto" ) 
-            $margin_top = 0;
-          if ( $margin_bottom === "auto" )
-            $margin_bottom = 0;
-
-          $height = $diff;
-
-        } else if ( $bottom === "auto" ) {
-
-          if ( $margin_top === "auto" ) 
-            $margin_top = 0;
-          if ( $margin_bottom === "auto" )
-            $margin_bottom = 0;
-
-          $bottom = $diff;
-
-        } else {
-
-          if ( $style->overflow === "visible" ) {
-
-            // set all autos to zero
-            if ( $margin_top === "auto" ) 
-              $margin_top = 0;
-            if ( $margin_bottom === "auto" )
-              $margin_bottom = 0;
-            if ( $top === "auto" )
-              $top = 0;
-            if ( $bottom === "auto" )
-              $bottom = 0;
-            if ( $height === "auto" )
-              $height = $content_height;
-
-          }
-
-          // FIXME: overflow hidden
-        }
-
-      }
-
-    } else {
-
-      // Expand the height if overflow is visible
-      if ( $height == "auto" && $content_height > $height && $style->overflow === "visible" )
-        $height = $content_height;
-
-      // FIXME: this should probably be moved to a seperate function as per
-      // _calculate_restricted_width
-      
-      // Only handle min/max height if the height is independent of the frame's content
-      if ( !($style->overflow === "visible" ||
-             ($style->overflow === "hidden" && $height === "auto")) ) {
-
-        $min_height = $style->min_height;
-        $max_height = $style->max_height;
-
-        if ( isset($cb["h"]) ) {
-          $min_height = $style->length_in_pt($min_height, $cb["h"]);
-          $max_height = $style->length_in_pt($max_height, $cb["h"]);
-
-        } else if ( isset($cb["w"]) ) {
-
-          if ( mb_strpos($min_height, "%") !== false )
-            $min_height = 0;
-          else
-            $min_height = $style->length_in_pt($min_height, $cb["w"]);
-
-          if ( mb_strpos($max_height, "%") !== false )
-            $max_height = "none";
-          else
-            $max_height = $style->length_in_pt($max_height, $cb["w"]);
-        }
-
-        if ( $max_height !== "none" && $min_height > $max_height )
-          // Swap 'em
-          list($max_height, $min_height) = array($min_height, $max_height);
-
-        if ( $max_height !== "none" && $height > $max_height )
-          $height = $max_height;
-
-        if ( $height < $min_height )
-          $height = $min_height;
-      }
-
-    }
-
-    return array($height, $margin_top, $margin_bottom, $top, $bottom);
-
-  }
-
-  //........................................................................
-
-  protected function _text_align() {
-    $style = $this->_frame->get_style();
-    $w = $this->_frame->get_containing_block("w");
-    $width = $style->length_in_pt($style->width, $w);
-
-    // Adjust the justification of each of our lines.
-    // http://www.w3.org/TR/CSS21/text.html#propdef-text-align
-    switch ($style->text_align) {
-
-    default:
-    case "left":
-      return;
-
-    case "right":
-      foreach ($this->_frame->get_lines() as $line) {
-
-        // Move each child over by $dx
-        $dx = $width - $line["w"];
-        foreach($line["frames"] as $frame)
-          $frame->set_position( $frame->get_position("x") + $dx );
-
-      }
-      break;
-
-
-    case "justify":
-      foreach ($this->_frame->get_lines() as $i => $line) {
-
-        // Only set the spacing if the line is long enough.  This is really
-        // just an aesthetic choice ;)
-        if ( $line["w"] > self::MIN_JUSTIFY_WIDTH * $width ) {
-          // Set the spacing for each child
-          if ( $line["wc"] > 1 )
-            $spacing = ($width - $line["w"]) / ($line["wc"] - 1);
-          else
-            $spacing = 0;
-
-          $dx = 0;
-          foreach($line["frames"] as $frame) {
-            if ( !$frame instanceof Text_Frame_Decorator )
-              continue;
-
-            $frame->set_position( $frame->get_position("x") + $dx );
-            $frame->set_text_spacing($spacing);
-            $dx += mb_substr_count($frame->get_text(), " ") * $spacing;
-          }
-
-          // The line (should) now occupy the entire width
-          $this->_frame->set_line($i, null, $width);
-
-        }
-      }
-      break;
-
-    case "center":
-    case "centre":
-      foreach ($this->_frame->get_lines() as $i => $line) {
-        // Centre each line by moving each frame in the line by:
-        $dx = ($width - $line["w"]) / 2;
-        foreach ($line["frames"] as $frame)
-          $frame->set_position( $frame->get_position("x") + $dx );
-      }
-      break;
-    }
-
-  }
-  /**
-   * Align inline children vertically
-   */
-  function vertical_align() {
-    // Align each child vertically after each line is reflowed
-    foreach ( $this->_frame->get_lines() as $i => $line ) {
-
-      foreach ( $line["frames"] as $frame ) {
-        $style = $frame->get_style();
-
-        if ( $style->display !== "inline" && $style->display !== "text" )
-          continue;
-
-        $align = $style->vertical_align;
-
-        $frame_h = $frame->get_margin_height();
-
-        switch ($align) {
-
-        case "baseline":
-          $y = $line["y"] + $line["h"] - $frame_h;
-          break;
-
-        case "middle":
-          $y = $line["y"] + ($line["h"] + $frame_h) / 2;
-          break;
-
-        case "sub":
-          $y = $line["y"] + 0.9 * $line["h"];
-          break;
-
-        case "super":
-          $y = $line["y"] + 0.1 * $line["h"];
-          break;
-
-        case  "text-top":
-        case "top": // Not strictly accurate, but good enough for now
-          $y = $line["y"];
-          break;
-
-        case "text-bottom":
-        case "bottom":
-          $y = $line["y"] + $line["h"] - $frame_h;
-          break;
-        }
-
-        $x = $frame->get_position("x");
-        $frame->set_position($x, $y);
-
-      }
-    }
-  }
-
-  //........................................................................
-
-  function reflow() {
-
-    // Check if a page break is forced
-    $page = $this->_frame->get_root();
-    $page->check_forced_page_break($this->_frame);
-
-    // Bail if the page is full
-    if ( $page->is_full() )
-      return;
-
-    // Collapse margins if required
-    $this->_collapse_margins();
-
-    $style = $this->_frame->get_style();
-    $cb = $this->_frame->get_containing_block();
-
-    // Determine the constraints imposed by this frame: calculate the width
-    // of the content area:
-    list($w, $left_margin, $right_margin, $left, $right) = $this->_calculate_restricted_width();
-
-    // Store the calculated properties
-    $style->width = $w;
-    $style->margin_left = $left_margin."pt";
-    $style->margin_right = $right_margin."pt";
-    $style->left = $left ."pt";
-    $style->right = $right . "pt";
-    
-    // Update the position
-    $this->_frame->position();
-    list($x, $y) = $this->_frame->get_position();
-
-    // Adjust the first line based on the text-indent property
-    $indent = $style->length_in_pt($style->text_indent, $cb["w"]);
-    $this->_frame->increase_line_width($indent);
-
-    // Determine the content edge
-    $top = $style->length_in_pt(array($style->margin_top,
-                                      $style->padding_top,
-                                      $style->border_top_width), $cb["h"]);
-
-    $bottom = $style->length_in_pt(array($style->border_bottom_width,
-                                         $style->margin_bottom,
-                                         $style->padding_bottom), $cb["h"]);
-
-    $cb_x = $x + $left_margin +
-      $style->length_in_pt($style->border_left_width, $cb["w"]) +
-      $style->length_in_pt($style->padding_left, $cb["w"]);
-
-    $cb_y = $line_y = $y + $top;
-
-    $cb_h = ($cb["h"] + $cb["y"]) - $bottom - $cb_y;
-
-    // Set the y position of the first line in this block
-    $this->_frame->set_current_line($line_y);
-
-    // Set the containing blocks and reflow each child
-    foreach ( $this->_frame->get_children() as $child ) {
-
-      // Bail out if the page is full
-      if ( $page->is_full() )
-        break;
-      
-      $child->set_containing_block($cb_x, $cb_y, $w, $cb_h);
-      $child->reflow();
-
-      // Don't add the child to the line if a page break has occurred
-      if ( $page->check_page_break($child) )
-        break;
-
-      // If the frame is not absolutely positioned, It's okay to add the frame
-      // to the line
-      if ( $child->get_style()->position !== "absolute" &&
-           $child->get_style()->position !== "fixed" ) {
-        $this->_frame->add_frame_to_line( $child );
-      }
-    }
-
-    // Determine our height
-    list($height, $margin_top, $margin_bottom, $top, $bottom) = $this->_calculate_restricted_height();
-    $style->height = $height;
-    $style->margin_top = $margin_top;
-    $style->margin_bottom = $margin_bottom;
-    $style->top = $top;
-    $style->bottom = $bottom;
-
-    $this->_text_align();
-
-    $this->vertical_align();
-  }
-
-  //........................................................................
-
-}

+ 0 - 71
main/inc/lib/phpdocx/pdf/include/block_positioner.cls.php

@@ -1,71 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: block_positioner.cls.php,v $
- * Created on: 2004-06-08
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: block_positioner.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Positions block frames
- *
- * @access private
- * @package dompdf
- */
-class Block_Positioner extends Positioner {
-
-
-  function __construct(Frame_Decorator $frame) { parent::__construct($frame); }
-  
-  //........................................................................
-
-  function position() {
-    $cb = $this->_frame->get_containing_block();
-
-    $p = $this->_frame->find_block_parent();
-    
-    if ( $p ) {
-      $p->add_line();
-      $y = $p->get_current_line("y");
-      
-    } else
-      $y = $cb["y"];
-
-    $x = $cb["x"];
-    
-    $this->_frame->set_position($x, $y);
-  }
-}

+ 0 - 114
main/inc/lib/phpdocx/pdf/include/block_renderer.cls.php

@@ -1,114 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: block_renderer.cls.php,v $
- * Created on: 2004-06-03
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: block_renderer.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Renders block frames
- *
- * @access private
- * @package dompdf
- */
-class Block_Renderer extends Abstract_Renderer {
-
-  //........................................................................
-
-  function render(Frame $frame) {
-    $style = $frame->get_style();
-    list($x, $y, $w, $h) = $frame->get_padding_box();
-
-    // Draw our background, border and content
-    if ( ($bg = $style->background_color) !== "transparent" ) {
-      $this->_canvas->filled_rectangle( $x, $y, $w, $h, $style->background_color );
-    }
-
-    if ( ($url = $style->background_image) && $url !== "none" )
-      $this->_background_image($url, $x, $y, $w, $h, $style);
-
-
-    $this->_render_border($frame);
-
-  }
-
-  protected function _render_border(Frame_Decorator $frame, $corner_style = "bevel") {
-    $cb = $frame->get_containing_block();
-    $style = $frame->get_style();
-
-    $bbox = $frame->get_border_box();
-    $bp = $frame->get_style()->get_border_properties();
-
-    $widths = array($style->length_in_pt($bp["top"]["width"]),
-                    $style->length_in_pt($bp["right"]["width"]),
-                    $style->length_in_pt($bp["bottom"]["width"]),
-                    $style->length_in_pt($bp["left"]["width"]));
-
-    foreach ($bp as $side => $props) {
-      list($x, $y, $w, $h) = $bbox;
-
-      if ( !$props["style"] || $props["style"] === "none" || $props["width"] <= 0 )
-        continue;
-
-
-      switch($side) {
-      case "top":
-        $length = $w;
-        break;
-
-      case "bottom":
-        $length = $w;
-        $y += $h;
-        break;
-
-      case "left":
-        $length = $h;
-        break;
-
-      case "right":
-        $length = $h;
-        $x += $w;
-        break;
-      default:
-        break;
-      }
-      $method = "_border_" . $props["style"];
-
-      $this->$method($x, $y, $length, $props["color"], $widths, $side, $corner_style);
-    }
-  }
-}

+ 0 - 186
main/inc/lib/phpdocx/pdf/include/cached_pdf_decorator.cls.php

@@ -1,186 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: cached_pdf_decorator.cls.php,v $
- * Created on: 2004-07-23
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: cached_pdf_decorator.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Caching canvas implementation
- *
- * Each rendered page is serialized and stored in the {@link Page_Cache}.
- * This is useful for static forms/pages that do not need to be re-rendered
- * all the time.
- *
- * This class decorates normal CPDF_Adapters.  It is currently completely
- * experimental.
- *
- * @access private
- * @package dompdf
- */
-class Cached_PDF_Decorator extends CPDF_Adapter implements Canvas {
-  protected $_pdf;
-  protected $_cache_id;
-  protected $_current_page_id;
-  protected $_fonts;  // fonts used in this document
-  
-  function __construct($cache_id, CPDF_Adapter $pdf) {
-    $this->_pdf = $pdf;
-    $this->_cache_id = $cache_id;
-    $this->_fonts = array();
-    
-    $this->_current_page_id = $this->_pdf->open_object();
-  }
-
-  //........................................................................
-
-  function get_cpdf() { return $this->_pdf->get_cpdf(); }
-
-  function open_object() { $this->_pdf->open_object(); }
-  function reopen_object() { return $this->_pdf->reopen_object(); }
-  
-  function close_object() { $this->_pdf->close_object(); }
-
-  function add_object($object, $where = 'all') { $this->_pdf->add_object($object, $where); }
-
-  function serialize_object($id) { $this->_pdf->serialize_object($id); }
-
-  function reopen_serialized_object($obj) { $this->_pdf->reopen_serialized_object($obj); }
-    
-  //........................................................................
-
-  function get_width() { return $this->_pdf->get_width(); }
-  function get_height() {  return $this->_pdf->get_height(); }
-  function get_page_number() { return $this->_pdf->get_page_number(); }
-  function get_page_count() { return $this->_pdf->get_page_count(); }
-
-  function set_page_number($num) { $this->_pdf->set_page_number($num); }
-  function set_page_count($count) { $this->_pdf->set_page_count($count); }
-
-  function line($x1, $y1, $x2, $y2, $color, $width, $style = array()) {
-    $this->_pdf->line($x1, $y1, $x2, $y2, $color, $width, $style);
-  }
-                              
-  function rectangle($x1, $y1, $w, $h, $color, $width, $style = array()) {
-    $this->_pdf->rectangle($x1, $y1, $w, $h, $color, $width, $style);
-  }
- 
-  function filled_rectangle($x1, $y1, $w, $h, $color) {
-    $this->_pdf->filled_rectangle($x1, $y1, $w, $h, $color);
-  }
-    
-  function polygon($points, $color, $width = null, $style = array(), $fill = false) {
-    $this->_pdf->polygon($points, $color, $width, $style, $fill);
-  }
-
-  function circle($x, $y, $r1, $color, $width = null, $style = null, $fill = false) {
-    $this->_pdf->circle($x, $y, $r1, $color, $width, $style, $fill);
-  }
-
-  function image($img_url, $x, $y, $w = null, $h = null) {
-    $this->_pdf->image($img_url, $x, $y, $w, $h);
-  }
-  
-  function text($x, $y, $text, $font, $size, $color = array(0,0,0), $adjust = 0, $angle = 0) {
-    $this->_fonts[$font] = true;
-    $this->_pdf->text($x, $y, $text, $font, $size, $color, $adjust, $angle);
-  }
-
-  function page_text($x, $y, $text, $font, $size, $color = array(0,0,0), $adjust = 0, $angle = 0) {
-    
-    // We want to remove this from cached pages since it may not be correct
-    $this->_pdf->close_object();
-    $this->_pdf->page_text($x, $y, $text, $font, $size, $color, $adjust, $angle);
-    $this->_pdf->reopen_object($this->_current_page_id);
-  }
-  
-  function page_script($script, $type = 'text/php') {
-    
-    // We want to remove this from cached pages since it may not be correct
-    $this->_pdf->close_object();
-    $this->_pdf->page_script($script, $type);
-    $this->_pdf->reopen_object($this->_current_page_id);
-  }
-  
-  function new_page() {
-    $this->_pdf->close_object();
-
-    // Add the object to the current page
-    $this->_pdf->add_object($this->_current_page_id, "add");
-    $this->_pdf->new_page();    
-
-    Page_Cache::store_page($this->_cache_id,
-                           $this->_pdf->get_page_number() - 1,
-                           $this->_pdf->serialize_object($this->_current_page_id));
-
-    $this->_current_page_id = $this->_pdf->open_object();
-    return $this->_current_page_id;
-  }
-  
-  function stream($filename) {
-    // Store the last page in the page cache
-    if ( !is_null($this->_current_page_id) ) {
-      $this->_pdf->close_object();
-      $this->_pdf->add_object($this->_current_page_id, "add");
-      Page_Cache::store_page($this->_cache_id,
-                             $this->_pdf->get_page_number(),
-                             $this->_pdf->serialize_object($this->_current_page_id));
-      Page_Cache::store_fonts($this->_cache_id, $this->_fonts);
-      $this->_current_page_id = null;
-    }
-    
-    $this->_pdf->stream($filename);
-    
-  }
-  
-  function &output() {
-    // Store the last page in the page cache
-    if ( !is_null($this->_current_page_id) ) {
-      $this->_pdf->close_object();
-      $this->_pdf->add_object($this->_current_page_id, "add");
-      Page_Cache::store_page($this->_cache_id,
-                             $this->_pdf->get_page_number(),
-                             $this->_pdf->serialize_object($this->_current_page_id));
-      $this->_current_page_id = null;
-    }
-    
-    return $this->_pdf->output();
-  }
-  
-  function get_messages() { return $this->_pdf->get_messages(); }
-  
-}

+ 0 - 260
main/inc/lib/phpdocx/pdf/include/canvas.cls.php

@@ -1,260 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: canvas.cls.php,v $
- * Created on: 2004-06-06
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: canvas.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Main rendering interface
- *
- * Currently {@link CPDF_Adapter}, {@link PDFLib_Adapter}, {@link TCPDF_Adapter}, and {@link GD_Adapter}
- * implement this interface.
- *
- * Implementations should measure x and y increasing to the left and down,
- * respectively, with the origin in the top left corner.  Implementations
- * are free to use a unit other than points for length, but I can't
- * guarantee that the results will look any good.
- *
- * @package dompdf
- */
-interface Canvas {
-
-  /**
-   * Returns the current page number
-   *
-   * @return int
-   */
-  function get_page_number();
-
-  /**
-   * Returns the total number of pages
-   *
-   * @return int
-   */
-  function get_page_count();
-
-  /**
-   * Sets the total number of pages
-   *
-   * @param int $count
-   */
-  function set_page_count($count);
-
-  /**
-   * Draws a line from x1,y1 to x2,y2
-   *
-   * See {@link Style::munge_colour()} for the format of the colour array.
-   * See {@link Cpdf::setLineStyle()} for a description of the format of the
-   * $style parameter (aka dash).
-   *
-   * @param float $x1
-   * @param float $y1
-   * @param float $x2
-   * @param float $y2
-   * @param array $color
-   * @param float $width
-   * @param array $style
-   */
-  function line($x1, $y1, $x2, $y2, $color, $width, $style = null);
-
-  /**
-   * Draws a rectangle at x1,y1 with width w and height h
-   *
-   * See {@link Style::munge_colour()} for the format of the colour array.
-   * See {@link Cpdf::setLineStyle()} for a description of the $style
-   * parameter (aka dash)
-   *
-   * @param float $x1
-   * @param float $y1
-   * @param float $w
-   * @param float $h
-   * @param array $color
-   * @param float $width
-   * @param array $style
-   */   
-  function rectangle($x1, $y1, $w, $h, $color, $width, $style = null);
-
-  /**
-   * Draws a filled rectangle at x1,y1 with width w and height h
-   *
-   * See {@link Style::munge_colour()} for the format of the colour array.
-   *
-   * @param float $x1
-   * @param float $y1
-   * @param float $w
-   * @param float $h
-   * @param array $color
-   */   
-  function filled_rectangle($x1, $y1, $w, $h, $color);
-
-  /**
-   * Draws a polygon
-   *
-   * The polygon is formed by joining all the points stored in the $points
-   * array.  $points has the following structure:
-   * <code>
-   * array(0 => x1,
-   *       1 => y1,
-   *       2 => x2,
-   *       3 => y2,
-   *       ...
-   *       );
-   * </code>
-   *
-   * See {@link Style::munge_colour()} for the format of the colour array.
-   * See {@link Cpdf::setLineStyle()} for a description of the $style
-   * parameter (aka dash)   
-   *
-   * @param array $points
-   * @param array $color
-   * @param float $width
-   * @param array $style
-   * @param bool  $fill  Fills the polygon if true
-   */
-  function polygon($points, $color, $width = null, $style = null, $fill = false);
-
-  /**
-   * Draws a circle at $x,$y with radius $r
-   *
-   * See {@link Style::munge_colour()} for the format of the colour array.
-   * See {@link Cpdf::setLineStyle()} for a description of the $style
-   * parameter (aka dash)
-   *
-   * @param float $x
-   * @param float $y
-   * @param float $r
-   * @param array $color
-   * @param float $width
-   * @param array $style
-   * @param bool $fill Fills the circle if true   
-   */   
-  function circle($x, $y, $r, $color, $width = null, $style = null, $fill = false);
-
-  /**
-   * Add an image to the pdf.
-   *
-   * The image is placed at the specified x and y coordinates with the
-   * given width and height.
-   *
-   * @param string $img_url the path to the image
-   * @param string $img_type the type (e.g. extension) of the image
-   * @param float $x x position
-   * @param float $y y position
-   * @param int $w width (in pixels)
-   * @param int $h height (in pixels)
-   */
-  function image($img_url, $img_type, $x, $y, $w, $h);
-
-  /**
-   * Writes text at the specified x and y coordinates
-   *
-   * See {@link Style::munge_colour()} for the format of the colour array.
-   *
-   * @param float $x
-   * @param float $y
-   * @param string $text the text to write
-   * @param string $font the font file to use
-   * @param float $size the font size, in points
-   * @param array $color
-   * @param float $adjust word spacing adjustment
-   */
-  function text($x, $y, $text, $font, $size, $color = array(0,0,0), $adjust = 0);
-
-  /**
-   * Add a named destination (similar to <a name="foo">...</a> in html)
-   *
-   * @param string $anchorname The name of the named destination
-   */
-  function add_named_dest($anchorname);
-
-  /**
-   * Add a link to the pdf
-   *
-   * @param string $url The url to link to
-   * @param float  $x   The x position of the link
-   * @param float  $y   The y position of the link
-   * @param float  $width   The width of the link
-   * @param float  $height   The height of the link
-   */
-  function add_link($url, $x, $y, $width, $height);
-  
-  /**
-   * Calculates text size, in points
-   *
-   * @param string $text the text to be sized
-   * @param string $font the desired font
-   * @param float  $size the desired font size
-   * @param float  $spacing word spacing, if any
-   * @return float
-   */
-  function get_text_width($text, $font, $size, $spacing = 0);
-
-  /**
-   * Calculates font height, in points
-   *
-   * @param string $font
-   * @param float $size
-   * @return float
-   */
-  function get_font_height($font, $size);
-
-  
-  /**
-   * Starts a new page
-   *
-   * Subsequent drawing operations will appear on the new page.
-   */
-  function new_page();
-
-  /**
-   * Streams the PDF directly to the browser
-   *
-   * @param string $filename the name of the PDF file
-   * @param array  $options associative array, 'Attachment' => 0 or 1, 'compress' => 1 or 0
-   */
-  function stream($filename, $options = null);
-
-  /**
-   * Returns the PDF as a string
-   *
-   * @param array  $options associative array: 'compress' => 1 or 0
-   * @return string
-   */
-  function output($options = null);
-  
-}

+ 0 - 83
main/inc/lib/phpdocx/pdf/include/canvas_factory.cls.php

@@ -1,83 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: canvas_factory.cls.php,v $
- * Created on: 2004-06-02
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: canvas_factory.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Create canvas instances
- *
- * The canvas factory creates canvas instances based on the
- * availability of rendering backends and config options.
- *
- * @package dompdf
- */
-class Canvas_Factory {
-
-  /**
-   * Constructor is private: this is a static class
-   */
-  private function __construct() { }
-
-  static function get_instance($paper = null, $orientation = null,  $class = null) {
-
-    $backend = strtolower(DOMPDF_PDF_BACKEND);
-    
-    if ( isset($class) && class_exists($class, false) )
-      $class .= "_Adapter";
-    
-    else if ( (DOMPDF_PDF_BACKEND === "auto" || $backend === "pdflib" ) &&
-              class_exists("PDFLib", false) )
-      $class = "PDFLib_Adapter";
-
-    else if ( (DOMPDF_PDF_BACKEND === "auto" || $backend === "cpdf") )
-      $class = "CPDF_Adapter";
-
-    else if ( ( $backend === "tcpdf") )
-      $class = "TCPDF_Adapter";
-      
-    else if ( $backend === "gd" )
-      $class = "GD_Adapter";
-    
-    else
-      $class = "CPDF_Adapter";
-
-    return new $class($paper, $orientation);
-        
-  }
-}

+ 0 - 713
main/inc/lib/phpdocx/pdf/include/cellmap.cls.php

@@ -1,713 +0,0 @@
-<?php
-/**
- * DOMPDF - PHP5 HTML to PDF renderer
- *
- * File: $RCSfile: cellmap.cls.php,v $
- * Created on: 2004-07-28
- *
- * Copyright (c) 2004 - Benj Carson <benjcarson@digitaljunkies.ca>
- *
- * This library 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library in the file LICENSE.LGPL; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * Alternatively, you may distribute this software under the terms of the
- * PHP License, version 3.0 or later.  A copy of this license should have
- * been distributed with this file in the file LICENSE.PHP .  If this is not
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
- *
- * The latest version of DOMPDF might be available at:
- * http://www.dompdf.com/
- *
- * @link http://www.dompdf.com/
- * @copyright 2004 Benj Carson
- * @author Benj Carson <benjcarson@digitaljunkies.ca>
- * @package dompdf
-
- */
-
-/* $Id: cellmap.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
-
-/**
- * Maps table cells to the table grid.
- *
- * This class resolves borders in tables with collapsed borders and helps
- * place row & column spanned table cells.
- *
- * @access private
- * @package dompdf
- */
-class Cellmap {
-
-  /**
-   * Border style weight lookup for collapsed border resolution.
-   *
-   * @var array
-   */
-  static protected $_BORDER_STYLE_SCORE = array("inset"  => 1,
-                                                "groove" => 2,
-                                                "outset" => 3,
-                                                "ridge"  => 4,
-                                                "dotted" => 5,
-                                                "dashed" => 6,
-                                                "solid"  => 7,
-                                                "double" => 8,
-                                                "none"   => 0);
-
-  /**
-   * The table object this cellmap is attached to.
-   *
-   * @var Table_Frame_Decorator
-   */
-  protected $_table;
-
-  /**
-   * The total number of rows in the table
-   *
-   * @var int
-   */
-  protected $_num_rows;
-
-  /**
-   * The total number of columns in the table
-   *
-   * @var int
-   */
-  protected $_num_cols;
-
-  /**
-   * 2D array mapping <row,column> to frames
-   *
-   * @var array
-   */
-  protected $_cells;
-
-  /**
-   * 1D array of column dimensions
-   *
-   * @var array
-   */
-  protected $_columns;
-
-  /**
-   * 1D array of row dimensions
-   *
-   * @var array
-   */
-  protected $_rows;
-
-  /**
-   * 2D array of border specs
-   *
-   * @var array
-   */
-  protected $_borders;
-
-  /**
-   * 1D Array mapping frames to (multiple) <row, col> pairs, keyed on
-   * frame_id.
-   *
-   * @var array
-   */
-  protected $_frames;
-
-  /**
-   * Current column when adding cells, 0-based
-   *
-   * @var int
-   */
-  private $__col;
-
-  /**
-   * Current row when adding cells, 0-based
-   *
-   * @var int
-   */
-  private $__row;
-
-  //........................................................................
-
-  function __construct(Table_Frame_Decorator $table) {
-    $this->_table = $table;
-    $this->reset();
-  }
-
-  //........................................................................
-
-  function reset() {
-    $this->_num_rows = 0;
-    $this->_num_cols = 0;
-
-    $this->_cells  = array();
-    $this->_frames = array();
-
-    $this->_columns = array();
-    $this->_rows = array();
-
-    $this->_borders = array();
-
-    $this->__col = $this->__row = 0;
-  }
-
-  //........................................................................
-
-  function get_num_rows() { return $this->_num_rows; }
-  function get_num_cols() { return $this->_num_cols; }
-
-  function &get_columns() {
-    return $this->_columns;
-  }
-
-  function &get_column($i) {
-    if ( !isset($this->_columns[$i]) )
-      $this->_columns[$i] = array("x" => 0,
-                                  "min-width" => 0,
-                                  "max-width" => 0,
-                                  "used-width" => null,
-                                  "absolute" => 0,
-                                  "percent" => 0,
-                                  "auto" => true);
-
-    return $this->_columns[$i];
-  }
-
-  function &get_rows() {
-    return $this->_rows;
-  }
-
-  function &get_row($j) {
-    if ( !isset($this->_rows[$j]) )
-      $this->_rows[$j] = array("y" => 0,
-                               "first-column" => 0,
-                               "height" => null);
-    return $this->_rows[$j];
-  }
-
-  function get_border($i, $j, $h_v, $prop = null) {
-    if ( !isset($this->_borders[$i][$j][$h_v]) )
-      $this->_borders[$i][$j][$h_v] = array("width" => 0,
-                                           "style" => "solid",
-                                           "color" => "black");
-    if ( isset($prop) )
-      return $this->_borders[$i][$j][$h_v][$prop];
-
-    return $this->_borders[$i][$j][$h_v];
-  }
-
-  function get_border_properties($i, $j) {
-
-    $left = $this->get_border($i, $j, "vertical");
-    $right = $this->get_border($i, $j+1, "vertical");
-    $top = $this->get_border($i, $j, "horizontal");
-    $bottom = $this->get_border($i+1, $j, "horizontal");
-
-    return compact("top", "bottom", "left", "right");
-  }
-
-  //........................................................................
-
-  function get_spanned_cells($frame) {
-    $key = $frame->get_id();
-
-    if ( !isset($this->_frames[$key]) ) {
-      throw new DOMPDF_Internal_Exception("Frame not found in cellmap");
-    }
-
-    return $this->_frames[$key];
-
-  }
-
-  function frame_exists_in_cellmap($frame) {
-    $key = $frame->get_id();
-    return isset($this->_frames[$key]);
-  }
-  
-  function get_frame_position($frame) {
-    global $_dompdf_warnings;
-
-    $key = $frame->get_id();
-
-    if ( !isset($this->_frames[$key]) ) {
-      throw new DOMPDF_Internal_Exception("Frame not found in cellmap");
-    }
-
-    $col = $this->_frames[$key]["columns"][0];
-    $row = $this->_frames[$key]["rows"][0];
-
-    if ( !isset($this->_columns[$col])) {
-      $_dompdf_warnings[] = "Frame not found in columns array.  Check your table layout for missing or extra TDs.";
-      $x = 0;
-    } else
-      $x = $this->_columns[$col]["x"];
-
-    if ( !isset($this->_rows[$row])) {
-      $_dompdf_warnings[] = "Frame not found in row array.  Check your table layout for missing or extra TDs.";
-      $y = 0;
-    } else
-      $y = $this->_rows[$row]["y"];
-
-    return array($x, $y, "x" => $x, "y" => $y);
-  }
-
-  function get_frame_width($frame) {
-    $key = $frame->get_id();
-
-    if ( !isset($this->_frames[$key]) ) {
-      throw new DOMPDF_Internal_Exception("Frame not found in cellmap");
-    }
-
-    $cols = $this->_frames[$key]["columns"];
-    $w = 0;
-    foreach ($cols as $i)
-      $w += $this->_columns[$i]["used-width"];
-
-    return $w;
-
-  }
-
-  function get_frame_height($frame) {
-    $key = $frame->get_id();
-
-    if ( !isset($this->_frames[$key]) )
-      throw new DOMPDF_Internal_Exception("Frame not found in cellmap");
-
-    $rows = $this->_frames[$key]["rows"];
-    $h = 0;
-    foreach ($rows as $i) {
-      if ( !isset($this->_rows[$i]) )  {
-        throw new Exception("foo");
-      }
-      $h += $this->_rows[$i]["height"];
-    }
-    return $h;
-
-  }
-
-
-  //........................................................................
-
-  function set_column_width($j, $width) {
-    $col =& $this->get_column($j);
-    $col["used-width"] = $width;
-    $next_col =& $this->get_column($j+1);
-    $next_col["x"] = $next_col["x"] + $width;
-  }
-
-  function set_row_height($i, $height) {
-    $row =& $this->get_row($i);
-    if ( $height <= $row["height"] )
-      return;
-
-    $row["height"] = $height;
-    $next_row =& $this->get_row($i+1);
-    $next_row["y"] = $row["y"] + $height;
-
-  }
-
-  //........................................................................
-
-
-  protected function _resolve_border($i, $j, $h_v, $border_spec) {
-    $n_width = $border_spec["width"];
-    $n_style = $border_spec["style"];
-    $n_color = $border_spec["color"];
-
-    if ( !isset($this->_borders[$i][$j][$h_v]) ) {
-      $this->_borders[$i][$j][$h_v] = $border_spec;
-      return $this->_borders[$i][$j][$h_v]["width"];
-    }
-
-    $o_width = $this->_borders[$i][$j][$h_v]["width"];
-    $o_style = $this->_borders[$i][$j][$h_v]["style"];
-    $o_color = $this->_borders[$i][$j][$h_v]["color"];
-
-    if ( ($n_style === "hidden" ||
-          $n_width  >  $o_width ||
-          $o_style === "none")
-
-         or
-
-         ($o_width == $n_width &&
-          in_array($n_style, self::$_BORDER_STYLE_SCORE) &&
-          self::$_BORDER_STYLE_SCORE[ $n_style ] > self::$_BORDER_STYLE_SCORE[ $o_style ]) )
-      $this->_borders[$i][$j][$h_v] = $border_spec;
-
-    return $this->_borders[$i][$j][$h_v]["width"];
-  }
-
-  //........................................................................
-
-  function add_frame(Frame $frame) {
-    
-    $style = $frame->get_style();
-    $display = $style->display;
-
-    $collapse = $this->_table->get_style()->border_collapse == "collapse";
-
-    // Recursively add the frames within tables, table-row-groups and table-rows
-    if ( $display == "table-row" ||
-         $display == "table" ||
-         $display == "inline-table" ||
-         in_array($display, Table_Frame_Decorator::$ROW_GROUPS) ) {
-
-      $start_row = $this->__row;
-      foreach ( $frame->get_children() as $child )
-        $this->add_frame( $child );
-
-      if ( $display == "table-row" )
-        $this->add_row();
-
-      $num_rows = $this->__row - $start_row - 1;
-      $key = $frame->get_id();
-
-      // Row groups always span across the entire table
-      $this->_frames[ $key ]["columns"] = range(0,max(0,$this->_num_cols-1));
-      $this->_frames[ $key ]["rows"] = range($start_row, max(0, $this->__row - 1));
-      $this->_frames[ $key ]["frame"] = $frame;
-
-      if ( $display != "table-row" && $collapse ) {
-
-        $bp = $style->get_border_properties();
-
-        // Resolve the borders
-        for ( $i = 0; $i < $num_rows+1; $i++) {
-          $this->_resolve_border($start_row + $i, 0, "vertical", $bp["left"]);
-          $this->_resolve_border($start_row + $i, $this->_num_cols, "vertical", $bp["right"]);
-        }
-
-        for ( $j = 0; $j < $this->_num_cols; $j++) {
-          $this->_resolve_border($start_row, $j, "horizontal", $bp["top"]);
-          $this->_resolve_border($this->__row, $j, "horizontal", $bp["bottom"]);
-        }
-      }
-
-
-      return;
-    }
-
-    // Determine where this cell is going
-    $colspan = $frame->get_node()->getAttribute("colspan");
-    $rowspan = $frame->get_node()->getAttribute("rowspan");
-
-    if ( !$colspan ) {
-      $colspan = 1;
-      $frame->get_node()->setAttribute("colspan",1);
-    }
-
-    if ( !$rowspan ) {
-      $rowspan = 1;
-      $frame->get_node()->setAttribute("rowspan",1);
-    }
-    $key = $frame->get_id();
-
-    $bp = $style->get_border_properties();
-
-
-    // Add the frame to the cellmap
-    $max_left = $max_right = 0;
-
-    // Find the next available column (fix by Ciro Mondueri)
-    $ac = $this->__col;
-    while ( isset($this->_cells[$this->__row][$ac]) )
-       $ac++;
-    $this->__col = $ac;
-
-    // Rows:
-    for ( $i = 0; $i < $rowspan; $i++ ) {
-      $row = $this->__row + $i;
-
-      $this->_frames[ $key ]["rows"][] = $row;
-
-      for ( $j = 0; $j < $colspan; $j++)
-        $this->_cells[$row][$this->__col + $j] = $frame;
-
-      if ( $collapse ) {
-        // Resolve vertical borders
-        $max_left = max($max_left, $this->_resolve_border($row, $this->__col, "vertical", $bp["left"]));
-        $max_right = max($max_right, $this->_resolve_border($row, $this->__col + $colspan, "vertical", $bp["right"]));
-      }
-    }
-
-    $max_top = $max_bottom = 0;
-
-    // Columns:
-    for ( $j = 0; $j < $colspan; $j++ ) {
-      $col = $this->__col + $j;
-      $this->_frames[ $key ]["columns"][] = $col;
-
-      if ( $collapse ) {
-        // Resolve horizontal borders
-        $max_top = max($max_top, $this->_resolve_border($this->__row, $col, "horizontal", $bp["top"]));
-        $max_bottom = max($max_bottom, $this->_resolve_border($this->__row + $rowspan, $col, "horizontal", $bp["bottom"]));
-      }
-    }
-
-    $this->_frames[ $key ]["frame"] = $frame;
-
-    // Handle seperated border model
-    if ( !$collapse ) {
-      list($h, $v) = $this->_table->get_style()->border_spacing;
-
-      // Border spacing is effectively a margin between cells
-      $v = $style->length_in_pt($v) / 2;
-      $h = $style->length_in_pt($h) / 2;
-      $style->margin = "$v $h";
-
-      // The additional 1/2 width gets added to the table proper
-
-    } else {
-
-      // Drop the frame's actual border
-      $style->border_left_width = $max_left / 2;
-      $style->border_right_width = $max_right / 2;
-      $style->border_top_width = $max_top / 2;
-      $style->border_bottom_width = $max_bottom / 2;
-      $style->margin = "none";
-    }
-
-    // Resolve the frame's width
-    list($frame_min, $frame_max) = $frame->get_min_max_width();
-
-    $width = $style->width;
-
-    if ( is_percent($width) ) {
-      $var = "percent";
-      $val = (float)rtrim($width, "% ") / $colspan;
-
-    } else if ( $width !== "auto" ) {
-      $var = "absolute";
-      $val = $style->length_in_pt($frame_min) / $colspan;
-    }
-
-    $min = 0;
-    $max = 0;
-    for ( $cs = 0; $cs < $colspan; $cs++ ) {
-
-      // Resolve the frame's width(s) with other cells
-      $col =& $this->get_column( $this->__col + $cs );
-
-      // Note: $var is either 'percent' or 'absolute'.  We compare the
-      // requested percentage or absolute values with the existing widths
-      // and adjust accordingly.
-      if ( isset($var) && $val > $col[$var] ) {
-        $col[$var] = $val;
-        $col["auto"] = false;
-      }
-
-      $min += $col["min-width"];
-      $max += $col["max-width"];
-    }
-
-
-    if ( $frame_min > $min ) {
-      // The frame needs more space.  Expand each sub-column
-      $inc = ($frame_min - $min) / $colspan;
-      for ($c = 0; $c < $colspan; $c++) {
-        $col =& $this->get_column($this->__col + $c);
-        $col["min-width"] += $inc;
-      }
-    }
-
-    if ( $frame_max > $max ) {
-      $inc = ($frame_max - $max) / $colspan;
-      for ($c = 0; $c < $colspan; $c++) {
-        $col =& $this->get_column($this->__col + $c);
-        $col["max-width"] += $inc;
-      }
-    }
-
-    $this->__col += $colspan;
-    if ( $this->__col > $this->_num_cols )
-      $this->_num_cols = $this->__col;
-
-  }
-
-  //........................................................................
-
-  function add_row() {
-
-    $this->__row++;
-    $this->_num_rows++;
-
-    // Find the next available column
-    $i = 0;
-    while ( isset($this->_cells[$this->__row][$i]) )
-      $i++;
-
-    $this->__col = $i;
-
-  }
-
-  //........................................................................
-
-  /**
-   * Remove a row from the cellmap.
-   *
-   * @param Frame
-   */
-  function remove_row(Frame $row) {
-
-    $key = $row->get_id();
-    if ( !isset($this->_frames[$key]) )
-      return;  // Presumably this row has alredy been removed
-
-    $this->_row = $this->_num_rows--;
-
-    $rows = $this->_frames[$key]["rows"];
-    $columns = $this->_frames[$key]["columns"];
-
-    // Remove all frames from this row
-    foreach ( $rows as $r ) {
-      foreach ( $columns as $c ) {
-        if ( isset($this->_cells[$r][$c]) ) {
-          $frame = $this->_cells[$r][$c];
-          unset($this->_frames[ $frame->get_id() ]);
-          unset($this->_cells[$r][$c]);
-        }
-      }
-      unset($this->_rows[$r]);
-    }
-
-    unset($this->_frames[$key]);
-
-  }
-
-  /**
-   * Remove a row group from the cellmap.
-   *
-   * @param Frame $group  The group to remove
-   */
-  function remove_row_group(Frame $group) {
-
-    $key = $group->get_id();
-    if ( !isset($this->_frames[$key]) )
-      return;  // Presumably this row has alredy been removed
-
-    $iter = $group->get_first_child();
-    while ($iter) {
-      $this->remove_row($iter);
-      $iter = $iter->get_next_sibling();
-    }
-
-    unset($this->_frames[$key]);
-  }
-
-  /**
-   * Update a row group after rows have been removed
-   *
-   * @param Frame $group    The group to update
-   * @param Frame $last_row The last row in the row group
-   */
-  function update_row_group(Frame $group, Frame $last_row) {
-
-    $g_key = $group->get_id();
-    $r_key = $last_row->get_id();
-
-    $r_rows = $this->_frames[$r_key]["rows"];
-    $this->_frames[$g_key]["rows"] = range( $this->_frames[$g_key]["rows"][0], end($r_rows) );
-
-  }
-
-  //........................................................................
-
-  function assign_x_positions() {
-    // Pre-condition: widths must be resolved and assigned to columns and
-    // column[0]["x"] must be set.
-
-    $x = $this->_columns[0]["x"];
-    foreach ( array_keys($this->_columns) as $j ) {
-      $this->_columns[$j]["x"] = $x;
-      $x += $this->_columns[$j]["used-width"];
-
-    }
-
-  }
-
-  function assign_frame_heights() {
-    // Pre-condition: widths and heights of each column & row must be
-    // calcluated
-
-    foreach ( $this->_frames as $arr ) {
-      $frame = $arr["frame"];
-
-      $h = 0;
-      foreach( $arr["rows"] as $row ) {
-        if ( !isset($this->_rows[$row]) )
-          // The row has been removed because of a page split, so skip it.
-          continue;
-        $h += $this->_rows[$row]["height"];
-      }
-
-      if ( $frame instanceof Table_Cell_Frame_Decorator )
-        $frame->set_cell_height($h);
-      else
-        $frame->get_style()->height = $h;
-    }
-
-  }
-
-  //........................................................................
-
-  /**
-   * Re-adjust frame height if the table height is larger than its content
-   */
-  function set_frame_heights($table_height, $content_height) {
-
-
-    // Distribute the increased height proportionally amongst each row
-    foreach ( $this->_frames as $arr ) {
-      $frame = $arr["frame"];
-
-      $h = 0;
-      foreach ($arr["rows"] as $row ) {
-        if ( !isset($this->_rows[$row]) )
-          continue;
-
-        $h += $this->_rows[$row]["height"];
-      }
-
-      $new_height = ($h / $content_height) * $table_height;
-
-      if ( $frame instanceof Table_Cell_Frame_Decorator )
-        $frame->set_cell_height($new_height);
-      else
-        $frame->get_style()->height = $new_height;
-    }
-
-  }
-
-  //........................................................................
-
-  // Used for debugging:
-  function __toString() {
-    $str = "";
-    $str .= "Columns:<br/>";
-    $str .= pre_r($this->_columns, true);
-    $str .=  "Rows:<br/>";
-    $str .= pre_r($this->_rows, true);
-
-    $str .=  "Frames:<br/>";
-    $arr = array();
-    foreach ( $this->_frames as $key => $val )
-      $arr[$key] = array("columns" => $val["columns"], "rows" => $val["rows"]);
-
-    $str .= pre_r($arr, true);
-
-    if ( php_sapi_name() == "cli" )
-      $str = strip_tags(str_replace(array("<br/>","<b>","</b>"),
-                                    array("\n",chr(27)."[01;33m", chr(27)."[0m"),
-                                    $str));
-    return $str;
-  }
-}

Некоторые файлы не были показаны из-за большого количества измененных файлов