Overview

Packages

  • PHP
  • PHPWord

Classes

  • PHPWord
  • PHPWord_Autoloader
  • PHPWord_DocumentProperties
  • PHPWord_HashTable
  • PHPWord_IOFactory
  • PHPWord_Media
  • PHPWord_Section
  • PHPWord_Section_Footer
  • PHPWord_Section_Footer_PreserveText
  • PHPWord_Section_Header
  • PHPWord_Section_Image
  • PHPWord_Section_Link
  • PHPWord_Section_ListItem
  • PHPWord_Section_MemoryImage
  • PHPWord_Section_Object
  • PHPWord_Section_PageBreak
  • PHPWord_Section_Settings
  • PHPWord_Section_Table
  • PHPWord_Section_Table_Cell
  • PHPWord_Section_Table_Row
  • PHPWord_Section_Text
  • PHPWord_Section_TextBreak
  • PHPWord_Section_TextRun
  • PHPWord_Section_Title
  • PHPWord_Shared_Drawing
  • PHPWord_Shared_File
  • PHPWord_Shared_Font
  • PHPWord_Shared_String
  • PHPWord_Shared_XMLWriter
  • PHPWord_Shared_ZipStreamWrapper
  • PHPWord_Style
  • PHPWord_Style_Cell
  • PHPWord_Style_Font
  • PHPWord_Style_Image
  • PHPWord_Style_ListItem
  • PHPWord_Style_Paragraph
  • PHPWord_Style_Row
  • PHPWord_Style_Tab
  • PHPWord_Style_Table
  • PHPWord_Style_TableFull
  • PHPWord_Style_Tabs
  • PHPWord_Style_TOC
  • PHPWord_Template
  • PHPWord_TOC
  • PHPWord_Writer_ODText
  • PHPWord_Writer_ODText_Content
  • PHPWord_Writer_ODText_Manifest
  • PHPWord_Writer_ODText_Meta
  • PHPWord_Writer_ODText_Mimetype
  • PHPWord_Writer_ODText_Styles
  • PHPWord_Writer_ODText_WriterPart
  • PHPWord_Writer_RTF
  • PHPWord_Writer_Word2007
  • PHPWord_Writer_Word2007_Base
  • PHPWord_Writer_Word2007_ContentTypes
  • PHPWord_Writer_Word2007_DocProps
  • PHPWord_Writer_Word2007_Document
  • PHPWord_Writer_Word2007_DocumentRels
  • PHPWord_Writer_Word2007_Footer
  • PHPWord_Writer_Word2007_Header
  • PHPWord_Writer_Word2007_Rels
  • PHPWord_Writer_Word2007_Styles
  • PHPWord_Writer_Word2007_WriterPart

Interfaces

  • PHPWord_Writer_IWriter

Exceptions

  • PHPWord_Exception
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * PHPWord
  4:  *
  5:  * Copyright (c) 2013 PHPWord
  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   PHPWord
 22:  * @package    PHPWord
 23:  * @copyright  Copyright (c) 2013 PHPWord
 24:  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
 25:  * @version    0.7.0
 26:  */
 27: 
 28: /**
 29:  * Class PHPWord_Writer_Word2007_DocProps
 30:  */
 31: class PHPWord_Writer_Word2007_DocProps extends PHPWord_Writer_Word2007_WriterPart
 32: {
 33: 
 34:     public function writeDocPropsApp(PHPWord $pPHPWord = null)
 35:     {
 36:         // Create XML writer
 37:         $objWriter = null;
 38:         if ($this->getParentWriter()->getUseDiskCaching()) {
 39:             $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
 40:         } else {
 41:             $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY);
 42:         }
 43: 
 44:         // XML header
 45:         $objWriter->startDocument('1.0', 'UTF-8', 'yes');
 46: 
 47:         // Properties
 48:         $objWriter->startElement('Properties');
 49:         $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties');
 50:         $objWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes');
 51: 
 52:         // Application
 53:         $objWriter->writeElement('Application', 'Microsoft Office Word');
 54: 
 55:         // ScaleCrop
 56:         $objWriter->writeElement('ScaleCrop', 'false');
 57: 
 58:         // HeadingPairs
 59:         $objWriter->startElement('HeadingPairs');
 60: 
 61:         // Vector
 62:         $objWriter->startElement('vt:vector');
 63:         $objWriter->writeAttribute('size', '4');
 64:         $objWriter->writeAttribute('baseType', 'variant');
 65: 
 66:         // Variant
 67:         $objWriter->startElement('vt:variant');
 68:         $objWriter->writeElement('vt:lpstr', 'Theme');
 69:         $objWriter->endElement();
 70: 
 71:         // Variant
 72:         $objWriter->startElement('vt:variant');
 73:         $objWriter->writeElement('vt:i4', '1');
 74:         $objWriter->endElement();
 75: 
 76:         // Variant
 77:         $objWriter->startElement('vt:variant');
 78:         $objWriter->writeElement('vt:lpstr', 'Slide Titles');
 79:         $objWriter->endElement();
 80: 
 81:         // Variant
 82:         $objWriter->startElement('vt:variant');
 83:         $objWriter->writeElement('vt:i4', '1');
 84:         $objWriter->endElement();
 85: 
 86:         $objWriter->endElement();
 87: 
 88:         $objWriter->endElement();
 89: 
 90:         // TitlesOfParts
 91:         $objWriter->startElement('TitlesOfParts');
 92: 
 93:         // Vector
 94:         $objWriter->startElement('vt:vector');
 95:         $objWriter->writeAttribute('size', '1');
 96:         $objWriter->writeAttribute('baseType', 'lpstr');
 97: 
 98:         $objWriter->writeElement('vt:lpstr', 'Office Theme');
 99: 
100:         $objWriter->endElement();
101: 
102:         $objWriter->endElement();
103: 
104:         // Company
105:         $objWriter->writeElement('Company', $pPHPWord->getProperties()->getCompany());
106: 
107:         // LinksUpToDate
108:         $objWriter->writeElement('LinksUpToDate', 'false');
109: 
110:         // SharedDoc
111:         $objWriter->writeElement('SharedDoc', 'false');
112: 
113:         // HyperlinksChanged
114:         $objWriter->writeElement('HyperlinksChanged', 'false');
115: 
116:         // AppVersion
117:         $objWriter->writeElement('AppVersion', '12.0000');
118: 
119:         $objWriter->endElement();
120: 
121:         // Return
122:         return $objWriter->getData();
123:     }
124: 
125: 
126:     public function writeDocPropsCore(PHPWord $pPHPWord = null)
127:     {
128:         // Create XML writer
129:         $objWriter = null;
130:         if ($this->getParentWriter()->getUseDiskCaching()) {
131:             $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
132:         } else {
133:             $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY);
134:         }
135: 
136:         // XML header
137:         $objWriter->startDocument('1.0', 'UTF-8', 'yes');
138: 
139:         // cp:coreProperties
140:         $objWriter->startElement('cp:coreProperties');
141:         $objWriter->writeAttribute('xmlns:cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties');
142:         $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
143:         $objWriter->writeAttribute('xmlns:dcterms', 'http://purl.org/dc/terms/');
144:         $objWriter->writeAttribute('xmlns:dcmitype', 'http://purl.org/dc/dcmitype/');
145:         $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
146: 
147:         // dc:creator
148:         $objWriter->writeElement('dc:creator', $pPHPWord->getProperties()->getCreator());
149: 
150:         // cp:lastModifiedBy
151:         $objWriter->writeElement('cp:lastModifiedBy', $pPHPWord->getProperties()->getLastModifiedBy());
152: 
153:         // dcterms:created
154:         $objWriter->startElement('dcterms:created');
155:         $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF');
156:         $objWriter->writeRaw(date(DATE_W3C, $pPHPWord->getProperties()->getCreated()));
157:         $objWriter->endElement();
158: 
159:         // dcterms:modified
160:         $objWriter->startElement('dcterms:modified');
161:         $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF');
162:         $objWriter->writeRaw(date(DATE_W3C, $pPHPWord->getProperties()->getModified()));
163:         $objWriter->endElement();
164: 
165:         // dc:title
166:         $objWriter->writeElement('dc:title', $pPHPWord->getProperties()->getTitle());
167: 
168:         // dc:description
169:         $objWriter->writeElement('dc:description', $pPHPWord->getProperties()->getDescription());
170: 
171:         // dc:subject
172:         $objWriter->writeElement('dc:subject', $pPHPWord->getProperties()->getSubject());
173: 
174:         // cp:keywords
175:         $objWriter->writeElement('cp:keywords', $pPHPWord->getProperties()->getKeywords());
176: 
177:         // cp:category
178:         $objWriter->writeElement('cp:category', $pPHPWord->getProperties()->getCategory());
179: 
180:         $objWriter->endElement();
181: 
182:         // Return
183:         return $objWriter->getData();
184:     }
185: }
186: 
PHPWord API Docs API documentation generated by ApiGen 2.8.0