visualizer
/
vendor
/
phpoffice
/
phpexcel
/
Classes
/
PHPExcel
/
Writer
/
OpenDocument
/
Settings.php
Settings.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.0.3, at vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/OpenDocument/Settings.php
| 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_OpenDocument |
| 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 ##VERSION##, ##DATE## |
| 26 | */ |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | * PHPExcel_Writer_OpenDocument_Settings |
| 31 | * |
| 32 | * @category PHPExcel |
| 33 | * @package PHPExcel_Writer_OpenDocument |
| 34 | * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) |
| 35 | * @author Alexander Pervakov <frost-nzcr4@jagmort.com> |
| 36 | */ |
| 37 | class PHPExcel_Writer_OpenDocument_Settings extends PHPExcel_Writer_OpenDocument_WriterPart |
| 38 | { |
| 39 | /** |
| 40 | * Write settings.xml to XML format |
| 41 | * |
| 42 | * @param PHPExcel $pPHPExcel |
| 43 | * @return string XML Output |
| 44 | * @throws PHPExcel_Writer_Exception |
| 45 | */ |
| 46 | public function write(PHPExcel $pPHPExcel = null) |
| 47 | { |
| 48 | if (!$pPHPExcel) { |
| 49 | $pPHPExcel = $this->getParentWriter()->getPHPExcel(); |
| 50 | } |
| 51 | |
| 52 | $objWriter = null; |
| 53 | if ($this->getParentWriter()->getUseDiskCaching()) { |
| 54 | $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); |
| 55 | } else { |
| 56 | $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); |
| 57 | } |
| 58 | |
| 59 | // XML header |
| 60 | $objWriter->startDocument('1.0', 'UTF-8'); |
| 61 | |
| 62 | // Settings |
| 63 | $objWriter->startElement('office:document-settings'); |
| 64 | $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); |
| 65 | $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); |
| 66 | $objWriter->writeAttribute('xmlns:config', 'urn:oasis:names:tc:opendocument:xmlns:config:1.0'); |
| 67 | $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); |
| 68 | $objWriter->writeAttribute('office:version', '1.2'); |
| 69 | |
| 70 | $objWriter->startElement('office:settings'); |
| 71 | $objWriter->startElement('config:config-item-set'); |
| 72 | $objWriter->writeAttribute('config:name', 'ooo:view-settings'); |
| 73 | $objWriter->startElement('config:config-item-map-indexed'); |
| 74 | $objWriter->writeAttribute('config:name', 'Views'); |
| 75 | $objWriter->endElement(); |
| 76 | $objWriter->endElement(); |
| 77 | $objWriter->startElement('config:config-item-set'); |
| 78 | $objWriter->writeAttribute('config:name', 'ooo:configuration-settings'); |
| 79 | $objWriter->endElement(); |
| 80 | $objWriter->endElement(); |
| 81 | $objWriter->endElement(); |
| 82 | |
| 83 | return $objWriter->getData(); |
| 84 | } |
| 85 | } |
| 86 |