Overview

Packages

  • JAMA
  • None
  • PHP
  • PHPExcel
    • CachedObjectStorage
    • Calculation
    • Cell
    • Chart
      • Renderer
    • Reader
      • Excel2007
      • Excel5
    • RichText
    • Settings
    • Shared
      • Escher
      • OLE
      • Trend
      • ZipArchive
    • Style
    • Worksheet
      • Drawing
    • Writer
      • 2007
      • CSV
      • Excel2007
      • Excel5
      • HTML
      • PDF

Classes

  • CholeskyDecomposition
  • Dao
  • DateTime
  • DateTimeZone
  • DOMNode
  • EigenvalueDecomposition
  • Elemento
  • Historial
  • Irradiacion
  • Latitud
  • MotorPhp
  • Panel
  • PclZip
  • Periodo
  • PHPExcel
  • PHPExcel_Autoloader
  • PHPExcel_Best_Fit
  • PHPExcel_CachedObjectStorage_APC
  • PHPExcel_CachedObjectStorage_CacheBase
  • PHPExcel_CachedObjectStorage_DiscISAM
  • PHPExcel_CachedObjectStorage_Igbinary
  • PHPExcel_CachedObjectStorage_Memcache
  • PHPExcel_CachedObjectStorage_Memory
  • PHPExcel_CachedObjectStorage_MemoryGZip
  • PHPExcel_CachedObjectStorage_MemorySerialized
  • PHPExcel_CachedObjectStorage_PHPTemp
  • PHPExcel_CachedObjectStorage_SQLite
  • PHPExcel_CachedObjectStorage_SQLite3
  • PHPExcel_CachedObjectStorage_Wincache
  • PHPExcel_CachedObjectStorageFactory
  • PHPExcel_CalcEngine_CyclicReferenceStack
  • PHPExcel_CalcEngine_Logger
  • PHPExcel_Calculation
  • PHPExcel_Calculation_Database
  • PHPExcel_Calculation_DateTime
  • PHPExcel_Calculation_Engineering
  • PHPExcel_Calculation_ExceptionHandler
  • PHPExcel_Calculation_Financial
  • PHPExcel_Calculation_FormulaParser
  • PHPExcel_Calculation_FormulaToken
  • PHPExcel_Calculation_Function
  • PHPExcel_Calculation_Functions
  • PHPExcel_Calculation_Logical
  • PHPExcel_Calculation_LookupRef
  • PHPExcel_Calculation_MathTrig
  • PHPExcel_Calculation_Statistical
  • PHPExcel_Calculation_TextData
  • PHPExcel_Calculation_Token_Stack
  • PHPExcel_Cell
  • PHPExcel_Cell_AdvancedValueBinder
  • PHPExcel_Cell_DataType
  • PHPExcel_Cell_DataValidation
  • PHPExcel_Cell_DefaultValueBinder
  • PHPExcel_Cell_Hyperlink
  • PHPExcel_Chart
  • PHPExcel_Chart_DataSeries
  • PHPExcel_Chart_DataSeriesValues
  • PHPExcel_Chart_Layout
  • PHPExcel_Chart_Legend
  • PHPExcel_Chart_PlotArea
  • PHPExcel_Chart_Renderer_jpgraph
  • PHPExcel_Chart_Title
  • PHPExcel_Comment
  • PHPExcel_DocumentProperties
  • PHPExcel_DocumentSecurity
  • PHPExcel_Exponential_Best_Fit
  • PHPExcel_HashTable
  • PHPExcel_IOFactory
  • PHPExcel_Linear_Best_Fit
  • PHPExcel_Logarithmic_Best_Fit
  • PHPExcel_NamedRange
  • PHPExcel_Polynomial_Best_Fit
  • PHPExcel_Power_Best_Fit
  • PHPExcel_Reader_Abstract
  • PHPExcel_Reader_CSV
  • PHPExcel_Reader_DefaultReadFilter
  • PHPExcel_Reader_Excel2003XML
  • PHPExcel_Reader_Excel2007
  • PHPExcel_Reader_Excel2007_Chart
  • PHPExcel_Reader_Excel2007_Theme
  • PHPExcel_Reader_Excel5
  • PHPExcel_Reader_Excel5_Escher
  • PHPExcel_Reader_Excel5_MD5
  • PHPExcel_Reader_Excel5_RC4
  • PHPExcel_Reader_Gnumeric
  • PHPExcel_Reader_HTML
  • PHPExcel_Reader_OOCalc
  • PHPExcel_Reader_SYLK
  • PHPExcel_ReferenceHelper
  • PHPExcel_RichText
  • PHPExcel_RichText_Run
  • PHPExcel_RichText_TextElement
  • PHPExcel_Settings
  • PHPExcel_Shared_CodePage
  • PHPExcel_Shared_Date
  • PHPExcel_Shared_Drawing
  • PHPExcel_Shared_Escher
  • PHPExcel_Shared_Escher_DgContainer
  • PHPExcel_Shared_Escher_DgContainer_SpgrContainer
  • PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
  • PHPExcel_Shared_Escher_DggContainer
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
  • PHPExcel_Shared_Excel5
  • PHPExcel_Shared_File
  • PHPExcel_Shared_Font
  • PHPExcel_Shared_JAMA_LUDecomposition
  • PHPExcel_Shared_JAMA_Matrix
  • PHPExcel_Shared_JAMA_QRDecomposition
  • PHPExcel_Shared_OLE
  • PHPExcel_Shared_OLE_ChainedBlockStream
  • PHPExcel_Shared_OLE_PPS
  • PHPExcel_Shared_OLE_PPS_File
  • PHPExcel_Shared_OLE_PPS_Root
  • PHPExcel_Shared_OLERead
  • PHPExcel_Shared_PasswordHasher
  • PHPExcel_Shared_String
  • PHPExcel_Shared_TimeZone
  • PHPExcel_Shared_XMLWriter
  • PHPExcel_Shared_ZipArchive
  • PHPExcel_Shared_ZipStreamWrapper
  • PHPExcel_Style
  • PHPExcel_Style_Alignment
  • PHPExcel_Style_Border
  • PHPExcel_Style_Borders
  • PHPExcel_Style_Color
  • PHPExcel_Style_Conditional
  • PHPExcel_Style_Fill
  • PHPExcel_Style_Font
  • PHPExcel_Style_NumberFormat
  • PHPExcel_Style_Protection
  • PHPExcel_Style_Supervisor
  • PHPExcel_Worksheet
  • PHPExcel_Worksheet_AutoFilter
  • PHPExcel_Worksheet_AutoFilter_Column
  • PHPExcel_Worksheet_AutoFilter_Column_Rule
  • PHPExcel_Worksheet_BaseDrawing
  • PHPExcel_Worksheet_CellIterator
  • PHPExcel_Worksheet_ColumnDimension
  • PHPExcel_Worksheet_Drawing
  • PHPExcel_Worksheet_Drawing_Shadow
  • PHPExcel_Worksheet_HeaderFooter
  • PHPExcel_Worksheet_HeaderFooterDrawing
  • PHPExcel_Worksheet_MemoryDrawing
  • PHPExcel_Worksheet_PageMargins
  • PHPExcel_Worksheet_PageSetup
  • PHPExcel_Worksheet_Protection
  • PHPExcel_Worksheet_Row
  • PHPExcel_Worksheet_RowDimension
  • PHPExcel_Worksheet_RowIterator
  • PHPExcel_Worksheet_SheetView
  • PHPExcel_WorksheetIterator
  • PHPExcel_Writer_Abstract
  • PHPExcel_Writer_CSV
  • PHPExcel_Writer_Excel2007
  • PHPExcel_Writer_Excel2007_Chart
  • PHPExcel_Writer_Excel2007_Comments
  • PHPExcel_Writer_Excel2007_ContentTypes
  • PHPExcel_Writer_Excel2007_DocProps
  • PHPExcel_Writer_Excel2007_Drawing
  • PHPExcel_Writer_Excel2007_Rels
  • PHPExcel_Writer_Excel2007_RelsRibbon
  • PHPExcel_Writer_Excel2007_RelsVBA
  • PHPExcel_Writer_Excel2007_StringTable
  • PHPExcel_Writer_Excel2007_Style
  • PHPExcel_Writer_Excel2007_Theme
  • PHPExcel_Writer_Excel2007_Workbook
  • PHPExcel_Writer_Excel2007_Worksheet
  • PHPExcel_Writer_Excel2007_WriterPart
  • PHPExcel_Writer_Excel5
  • PHPExcel_Writer_Excel5_BIFFwriter
  • PHPExcel_Writer_Excel5_Escher
  • PHPExcel_Writer_Excel5_Font
  • PHPExcel_Writer_Excel5_Parser
  • PHPExcel_Writer_Excel5_Workbook
  • PHPExcel_Writer_Excel5_Worksheet
  • PHPExcel_Writer_Excel5_Xf
  • PHPExcel_Writer_HTML
  • PHPExcel_Writer_PDF
  • PHPExcel_Writer_PDF_Core
  • PHPExcel_Writer_PDF_DomPDF
  • PHPExcel_Writer_PDF_mPDF
  • PHPExcel_Writer_PDF_tcPDF
  • Provincia
  • Radiacion
  • SingularValueDecomposition
  • Sistema
  • trendClass
  • xajax
  • xajaxArgumentManager
  • xajaxCallableObject
  • xajaxCallableObjectPlugin
  • xajaxControl
  • xajaxControlContainer
  • xajaxCustomRequest
  • xajaxCustomResponse
  • xajaxEvent
  • xajaxEventPlugin
  • xajaxFunctionPlugin
  • xajaxIncludeClientScriptPlugin
  • xajaxLanguageManager
  • xajaxPlugin
  • xajaxPluginManager
  • xajaxRequest
  • xajaxRequestPlugin
  • xajaxResponse
  • xajaxResponseManager
  • xajaxResponsePlugin
  • xajaxScriptPlugin
  • xajaxUserFunction
  • XMLWriter

Interfaces

  • DateTimeInterface
  • Iterator
  • PHPExcel_CachedObjectStorage_ICache
  • PHPExcel_Cell_IValueBinder
  • PHPExcel_IComparable
  • PHPExcel_Reader_IReader
  • PHPExcel_Reader_IReadFilter
  • PHPExcel_RichText_ITextElement
  • PHPExcel_Writer_IWriter
  • Throwable
  • Traversable

Exceptions

  • Exception
  • PHPExcel_Calculation_Exception
  • PHPExcel_Chart_Exception
  • PHPExcel_Exception
  • PHPExcel_Reader_Exception
  • PHPExcel_Writer_Exception

Functions

  • acosh
  • agregar_elemento
  • asinh
  • atanh
  • borrar_elementos
  • borrar_gdm_ab
  • borrar_irradiacion
  • borrar_latitud
  • borrar_panel
  • borrar_periodo
  • borrar_pmp_min_pmp_max
  • borrar_radiacion
  • borrar_resumen
  • borrar_sistema
  • borrar_sombra
  • gdm_ab
  • grabar_resumen
  • historial
  • hypo
  • irradiacion
  • JAMAError
  • latitud
  • limpiar_historial
  • login
  • mb_str_replace
  • mostrar_energia_total_ch
  • mostrar_panel_md_th
  • mostrar_panel_th
  • mostrar_radiacion_md_th
  • mostrar_radiacion_th
  • mostrar_resumen_th
  • panel
  • PclZipUtilCopyBlock
  • PclZipUtilOptionText
  • PclZipUtilPathInclusion
  • PclZipUtilPathReduction
  • PclZipUtilRename
  • PclZipUtilTranslateWinPath
  • periodo
  • pmp_min_pmp_max
  • preparar_panel
  • preparar_radiacion
  • preparar_radiacion_media
  • radiacion
  • resumen
  • sistema
  • sombra
  • xajaxCompressFile
  • xajaxErrorHandler
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
  1: <?php
  2: /**
  3:  * PHPExcel
  4:  *
  5:  * Copyright (c) 2006 - 2014 PHPExcel
  6:  *
  7:  * This library is free software; you can redistribute it and/or
  8:  * modify it under the terms of the GNU Lesser General Public
  9:  * License as published by the Free Software Foundation; either
 10:  * version 2.1 of the License, or (at your option) any later version.
 11:  *
 12:  * This library is distributed in the hope that it will be useful,
 13:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 15:  * Lesser General Public License for more details.
 16:  *
 17:  * You should have received a copy of the GNU Lesser General Public
 18:  * License along with this library; if not, write to the Free Software
 19:  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 20:  *
 21:  * @category   PHPExcel
 22:  * @package    PHPExcel_Writer_Excel2007
 23:  * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
 24:  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
 25:  * @version    1.8.0, 2014-03-02
 26:  */
 27: 
 28: 
 29: /**
 30:  * PHPExcel_Writer_Excel2007_Rels
 31:  *
 32:  * @category   PHPExcel
 33:  * @package    PHPExcel_Writer_Excel2007
 34:  * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
 35:  */
 36: class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPart
 37: {
 38:     /**
 39:      * Write relationships to XML format
 40:      *
 41:      * @param   PHPExcel    $pPHPExcel
 42:      * @return  string      XML Output
 43:      * @throws  PHPExcel_Writer_Exception
 44:      */
 45:     public function writeRelationships(PHPExcel $pPHPExcel = null)
 46:     {
 47:         // Create XML writer
 48:         $objWriter = null;
 49:         if ($this->getParentWriter()->getUseDiskCaching()) {
 50:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
 51:         } else {
 52:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
 53:         }
 54: 
 55:         // XML header
 56:         $objWriter->startDocument('1.0','UTF-8','yes');
 57: 
 58:         // Relationships
 59:         $objWriter->startElement('Relationships');
 60:         $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
 61: 
 62:             $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties();
 63:             if (!empty($customPropertyList)) {
 64:                 // Relationship docProps/app.xml
 65:                 $this->_writeRelationship(
 66:                     $objWriter,
 67:                     4,
 68:                     'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties',
 69:                     'docProps/custom.xml'
 70:                 );
 71: 
 72:             }
 73: 
 74:             // Relationship docProps/app.xml
 75:             $this->_writeRelationship(
 76:                 $objWriter,
 77:                 3,
 78:                 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties',
 79:                 'docProps/app.xml'
 80:             );
 81: 
 82:             // Relationship docProps/core.xml
 83:             $this->_writeRelationship(
 84:                 $objWriter,
 85:                 2,
 86:                 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties',
 87:                 'docProps/core.xml'
 88:             );
 89: 
 90:             // Relationship xl/workbook.xml
 91:             $this->_writeRelationship(
 92:                 $objWriter,
 93:                 1,
 94:                 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument',
 95:                 'xl/workbook.xml'
 96:             );
 97:             // a custom UI in workbook ?
 98:             if($pPHPExcel->hasRibbon()){
 99:                 $this->_writeRelationShip(
100:                     $objWriter,
101:                     5,
102:                     'http://schemas.microsoft.com/office/2006/relationships/ui/extensibility',
103:                     $pPHPExcel->getRibbonXMLData('target')
104:                 );
105:             }
106: 
107:         $objWriter->endElement();
108: 
109:         // Return
110:         return $objWriter->getData();
111:     }
112: 
113:     /**
114:      * Write workbook relationships to XML format
115:      *
116:      * @param   PHPExcel    $pPHPExcel
117:      * @return  string      XML Output
118:      * @throws  PHPExcel_Writer_Exception
119:      */
120:     public function writeWorkbookRelationships(PHPExcel $pPHPExcel = null)
121:     {
122:         // Create XML writer
123:         $objWriter = null;
124:         if ($this->getParentWriter()->getUseDiskCaching()) {
125:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
126:         } else {
127:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
128:         }
129: 
130:         // XML header
131:         $objWriter->startDocument('1.0','UTF-8','yes');
132: 
133:         // Relationships
134:         $objWriter->startElement('Relationships');
135:         $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
136: 
137:             // Relationship styles.xml
138:             $this->_writeRelationship(
139:                 $objWriter,
140:                 1,
141:                 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',
142:                 'styles.xml'
143:             );
144: 
145:             // Relationship theme/theme1.xml
146:             $this->_writeRelationship(
147:                 $objWriter,
148:                 2,
149:                 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',
150:                 'theme/theme1.xml'
151:             );
152: 
153:             // Relationship sharedStrings.xml
154:             $this->_writeRelationship(
155:                 $objWriter,
156:                 3,
157:                 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',
158:                 'sharedStrings.xml'
159:             );
160: 
161:             // Relationships with sheets
162:             $sheetCount = $pPHPExcel->getSheetCount();
163:             for ($i = 0; $i < $sheetCount; ++$i) {
164:                 $this->_writeRelationship(
165:                     $objWriter,
166:                     ($i + 1 + 3),
167:                     'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',
168:                     'worksheets/sheet' . ($i + 1) . '.xml'
169:                 );
170:             }
171:             // Relationships for vbaProject if needed
172:             // id : just after the last sheet
173:             if($pPHPExcel->hasMacros()){
174:                 $this->_writeRelationShip(
175:                     $objWriter,
176:                     ($i + 1 + 3),
177:                     'http://schemas.microsoft.com/office/2006/relationships/vbaProject',
178:                     'vbaProject.bin'
179:                 );
180:                 ++$i;//increment i if needed for an another relation
181:             }
182: 
183:         $objWriter->endElement();
184: 
185:         // Return
186:         return $objWriter->getData();
187:     }
188: 
189:     /**
190:      * Write worksheet relationships to XML format
191:      *
192:      * Numbering is as follows:
193:      *  rId1                - Drawings
194:      *  rId_hyperlink_x     - Hyperlinks
195:      *
196:      * @param   PHPExcel_Worksheet  $pWorksheet
197:      * @param   int                 $pWorksheetId
198:      * @param   boolean             $includeCharts  Flag indicating if we should write charts
199:      * @return  string              XML Output
200:      * @throws  PHPExcel_Writer_Exception
201:      */
202:     public function writeWorksheetRelationships(PHPExcel_Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = FALSE)
203:     {
204:         // Create XML writer
205:         $objWriter = null;
206:         if ($this->getParentWriter()->getUseDiskCaching()) {
207:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
208:         } else {
209:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
210:         }
211: 
212:         // XML header
213:         $objWriter->startDocument('1.0','UTF-8','yes');
214: 
215:         // Relationships
216:         $objWriter->startElement('Relationships');
217:         $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
218: 
219:             // Write drawing relationships?
220:             $d = 0;
221:             if ($includeCharts) {
222:                 $charts = $pWorksheet->getChartCollection();
223:             } else {
224:                 $charts = array();
225:             }
226:             if (($pWorksheet->getDrawingCollection()->count() > 0) ||
227:                 (count($charts) > 0)) {
228:                 $this->_writeRelationship(
229:                     $objWriter,
230:                     ++$d,
231:                     'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing',
232:                     '../drawings/drawing' . $pWorksheetId . '.xml'
233:                 );
234:             }
235: 
236:             // Write chart relationships?
237: //          $chartCount = 0;
238: //          $charts = $pWorksheet->getChartCollection();
239: //          echo 'Chart Rels: ' , count($charts) , '<br />';
240: //          if (count($charts) > 0) {
241: //              foreach($charts as $chart) {
242: //                  $this->_writeRelationship(
243: //                      $objWriter,
244: //                      ++$d,
245: //                      'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
246: //                      '../charts/chart' . ++$chartCount . '.xml'
247: //                  );
248: //              }
249: //          }
250: //
251:             // Write hyperlink relationships?
252:             $i = 1;
253:             foreach ($pWorksheet->getHyperlinkCollection() as $hyperlink) {
254:                 if (!$hyperlink->isInternal()) {
255:                     $this->_writeRelationship(
256:                         $objWriter,
257:                         '_hyperlink_' . $i,
258:                         'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink',
259:                         $hyperlink->getUrl(),
260:                         'External'
261:                     );
262: 
263:                     ++$i;
264:                 }
265:             }
266: 
267:             // Write comments relationship?
268:             $i = 1;
269:             if (count($pWorksheet->getComments()) > 0) {
270:                 $this->_writeRelationship(
271:                     $objWriter,
272:                     '_comments_vml' . $i,
273:                     'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing',
274:                     '../drawings/vmlDrawing' . $pWorksheetId . '.vml'
275:                 );
276: 
277:                 $this->_writeRelationship(
278:                     $objWriter,
279:                     '_comments' . $i,
280:                     'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments',
281:                     '../comments' . $pWorksheetId . '.xml'
282:                 );
283:             }
284: 
285:             // Write header/footer relationship?
286:             $i = 1;
287:             if (count($pWorksheet->getHeaderFooter()->getImages()) > 0) {
288:                 $this->_writeRelationship(
289:                     $objWriter,
290:                     '_headerfooter_vml' . $i,
291:                     'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing',
292:                     '../drawings/vmlDrawingHF' . $pWorksheetId . '.vml'
293:                 );
294:             }
295: 
296:         $objWriter->endElement();
297: 
298:         // Return
299:         return $objWriter->getData();
300:     }
301: 
302:     /**
303:      * Write drawing relationships to XML format
304:      *
305:      * @param   PHPExcel_Worksheet  $pWorksheet
306:      * @param   int                 &$chartRef      Chart ID
307:      * @param   boolean             $includeCharts  Flag indicating if we should write charts
308:      * @return  string              XML Output
309:      * @throws  PHPExcel_Writer_Exception
310:      */
311:     public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = FALSE)
312:     {
313:         // Create XML writer
314:         $objWriter = null;
315:         if ($this->getParentWriter()->getUseDiskCaching()) {
316:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
317:         } else {
318:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
319:         }
320: 
321:         // XML header
322:         $objWriter->startDocument('1.0','UTF-8','yes');
323: 
324:         // Relationships
325:         $objWriter->startElement('Relationships');
326:         $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
327: 
328:             // Loop through images and write relationships
329:             $i = 1;
330:             $iterator = $pWorksheet->getDrawingCollection()->getIterator();
331:             while ($iterator->valid()) {
332:                 if ($iterator->current() instanceof PHPExcel_Worksheet_Drawing
333:                     || $iterator->current() instanceof PHPExcel_Worksheet_MemoryDrawing) {
334:                     // Write relationship for image drawing
335:                     $this->_writeRelationship(
336:                         $objWriter,
337:                         $i,
338:                         'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
339:                         '../media/' . str_replace(' ', '', $iterator->current()->getIndexedFilename())
340:                     );
341:                 }
342: 
343:                 $iterator->next();
344:                 ++$i;
345:             }
346: 
347:             if ($includeCharts) {
348:                 // Loop through charts and write relationships
349:                 $chartCount = $pWorksheet->getChartCount();
350:                 if ($chartCount > 0) {
351:                     for ($c = 0; $c < $chartCount; ++$c) {
352:                         $this->_writeRelationship(
353:                             $objWriter,
354:                             $i++,
355:                             'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
356:                             '../charts/chart' . ++$chartRef . '.xml'
357:                         );
358:                     }
359:                 }
360:             }
361: 
362:         $objWriter->endElement();
363: 
364:         // Return
365:         return $objWriter->getData();
366:     }
367: 
368:     /**
369:      * Write header/footer drawing relationships to XML format
370:      *
371:      * @param   PHPExcel_Worksheet          $pWorksheet
372:      * @return  string                      XML Output
373:      * @throws  PHPExcel_Writer_Exception
374:      */
375:     public function writeHeaderFooterDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null)
376:     {
377:         // Create XML writer
378:         $objWriter = null;
379:         if ($this->getParentWriter()->getUseDiskCaching()) {
380:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
381:         } else {
382:             $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
383:         }
384: 
385:         // XML header
386:         $objWriter->startDocument('1.0','UTF-8','yes');
387: 
388:         // Relationships
389:         $objWriter->startElement('Relationships');
390:         $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
391: 
392:             // Loop through images and write relationships
393:             foreach ($pWorksheet->getHeaderFooter()->getImages() as $key => $value) {
394:                 // Write relationship for image drawing
395:                 $this->_writeRelationship(
396:                     $objWriter,
397:                     $key,
398:                     'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
399:                     '../media/' . $value->getIndexedFilename()
400:                 );
401:             }
402: 
403:         $objWriter->endElement();
404: 
405:         // Return
406:         return $objWriter->getData();
407:     }
408: 
409:     /**
410:      * Write Override content type
411:      *
412:      * @param   PHPExcel_Shared_XMLWriter   $objWriter      XML Writer
413:      * @param   int                         $pId            Relationship ID. rId will be prepended!
414:      * @param   string                      $pType          Relationship type
415:      * @param   string                      $pTarget        Relationship target
416:      * @param   string                      $pTargetMode    Relationship target mode
417:      * @throws  PHPExcel_Writer_Exception
418:      */
419:     private function _writeRelationship(PHPExcel_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '')
420:     {
421:         if ($pType != '' && $pTarget != '') {
422:             // Write relationship
423:             $objWriter->startElement('Relationship');
424:             $objWriter->writeAttribute('Id',        'rId' . $pId);
425:             $objWriter->writeAttribute('Type',      $pType);
426:             $objWriter->writeAttribute('Target',    $pTarget);
427: 
428:             if ($pTargetMode != '') {
429:                 $objWriter->writeAttribute('TargetMode',    $pTargetMode);
430:             }
431: 
432:             $objWriter->endElement();
433:         } else {
434:             throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
435:         }
436:     }
437: }
438: 
Autene API documentation generated by ApiGen