ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Writer_OpenDocument_Meta Class Reference
+ Inheritance diagram for PHPExcel_Writer_OpenDocument_Meta:
+ Collaboration diagram for PHPExcel_Writer_OpenDocument_Meta:

Public Member Functions

 write (PHPExcel $pPHPExcel=null)
 Write meta.xml to XML format. More...
 
- Public Member Functions inherited from PHPExcel_Writer_Excel2007_WriterPart
 setParentWriter (PHPExcel_Writer_IWriter $pWriter=null)
 Set parent IWriter object. More...
 
 getParentWriter ()
 Get parent IWriter object. More...
 
 __construct (PHPExcel_Writer_IWriter $pWriter=null)
 Set parent IWriter object. More...
 

Detailed Description

Definition at line 37 of file Meta.php.

Member Function Documentation

◆ write()

PHPExcel_Writer_OpenDocument_Meta::write ( PHPExcel  $pPHPExcel = null)

Write meta.xml to XML format.

Parameters
PHPExcel$pPHPExcel
Returns
string XML Output
Exceptions
PHPExcel_Writer_Exception

Definition at line 46 of file Meta.php.

References $objWriter, date, PHPExcel_Writer_Excel2007_WriterPart\getParentWriter(), PHPExcel_Shared_XMLWriter\STORAGE_DISK, and PHPExcel_Shared_XMLWriter\STORAGE_MEMORY.

47  {
48  if (!$pPHPExcel) {
49  $pPHPExcel = $this->getParentWriter()->getPHPExcel();
50  }
51 
52  $objWriter = null;
53  if ($this->getParentWriter()->getUseDiskCaching()) {
55  } else {
57  }
58 
59  // XML header
60  $objWriter->startDocument('1.0', 'UTF-8');
61 
62  // Meta
63  $objWriter->startElement('office:document-meta');
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:dc', 'http://purl.org/dc/elements/1.1/');
67  $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
68  $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
69  $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
70  $objWriter->writeAttribute('office:version', '1.2');
71 
72  $objWriter->startElement('office:meta');
73  $objWriter->writeElement('meta:initial-creator', $pPHPExcel->getProperties()->getCreator());
74  $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator());
75  $objWriter->writeElement('meta:creation-date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
76  $objWriter->writeElement('dc:date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
77  $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle());
78  $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription());
79  $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject());
80  $keywords = explode(' ', $pPHPExcel->getProperties()->getKeywords());
81  foreach ($keywords as $keyword) {
82  $objWriter->writeElement('meta:keyword', $keyword);
83  }
84  //<meta:document-statistic meta:table-count="XXX" meta:cell-count="XXX" meta:object-count="XXX"/>
85  $objWriter->startElement('meta:user-defined');
86  $objWriter->writeAttribute('meta:name', 'Company');
87  $objWriter->writeRaw($pPHPExcel->getProperties()->getCompany());
88  $objWriter->endElement();
89  $objWriter->startElement('meta:user-defined');
90  $objWriter->writeAttribute('meta:name', 'category');
91  $objWriter->writeRaw($pPHPExcel->getProperties()->getCategory());
92  $objWriter->endElement();
93  $objWriter->endElement();
94  $objWriter->endElement();
95 
96  return $objWriter->getData();
97  }
getProperties()
Get properties.
Definition: PHPExcel.php:425
getParentWriter()
Get parent IWriter object.
Definition: WriterPart.php:61
$objWriter
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
const STORAGE_MEMORY
Temporary storage method.
Definition: XMLWriter.php:46
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: