See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]
1 <?php 2 3 namespace PhpOffice\PhpSpreadsheet\Writer\Ods; 4 5 use PhpOffice\PhpSpreadsheet\Shared\XMLWriter; 6 use PhpOffice\PhpSpreadsheet\Spreadsheet; 7 8 class Settings extends WriterPart 9 { 10 /** 11 * Write settings.xml to XML format. 12 * 13 * @param Spreadsheet $spreadsheet 14 * 15 * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception 16 * 17 * @return string XML Output 18 */ 19 public function write(Spreadsheet $spreadsheet = null) 20 { 21 $objWriter = null; 22 if ($this->getParentWriter()->getUseDiskCaching()) { 23 $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); 24 } else { 25 $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY); 26 } 27 28 // XML header 29 $objWriter->startDocument('1.0', 'UTF-8'); 30 31 // Settings 32 $objWriter->startElement('office:document-settings'); 33 $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); 34 $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); 35 $objWriter->writeAttribute('xmlns:config', 'urn:oasis:names:tc:opendocument:xmlns:config:1.0'); 36 $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); 37 $objWriter->writeAttribute('office:version', '1.2'); 38 39 $objWriter->startElement('office:settings'); 40 $objWriter->startElement('config:config-item-set'); 41 $objWriter->writeAttribute('config:name', 'ooo:view-settings'); 42 $objWriter->startElement('config:config-item-map-indexed'); 43 $objWriter->writeAttribute('config:name', 'Views'); 44 $objWriter->endElement(); 45 $objWriter->endElement(); 46 $objWriter->startElement('config:config-item-set'); 47 $objWriter->writeAttribute('config:name', 'ooo:configuration-settings'); 48 $objWriter->endElement(); 49 $objWriter->endElement(); 50 $objWriter->endElement(); 51 52 return $objWriter->getData(); 53 } 54 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body