1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
27:
28: 29: 30:
31: class extends PHPWord_Writer_Word2007_Base
32: {
33:
34: public function (PHPWord_Section_Footer $footer)
35: {
36:
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:
45: $objWriter->startDocument('1.0', 'UTF-8', 'yes');
46:
47: $objWriter->startElement('w:ftr');
48: $objWriter->writeAttribute('xmlns:ve', 'http://schemas.openxmlformats.org/markup-compatibility/2006');
49: $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office');
50: $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
51: $objWriter->writeAttribute('xmlns:m', 'http://schemas.openxmlformats.org/officeDocument/2006/math');
52: $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml');
53: $objWriter->writeAttribute('xmlns:wp', 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing');
54: $objWriter->writeAttribute('xmlns:w10', 'urn:schemas-microsoft-com:office:word');
55: $objWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main');
56: $objWriter->writeAttribute('xmlns:wne', 'http://schemas.microsoft.com/office/word/2006/wordml');
57:
58: $_elements = $footer->getElements();
59:
60: foreach ($_elements as $element) {
61: if ($element instanceof PHPWord_Section_Text) {
62: $this->_writeText($objWriter, $element);
63: } elseif ($element instanceof PHPWord_Section_TextRun) {
64: $this->_writeTextRun($objWriter, $element);
65: } elseif ($element instanceof PHPWord_Section_TextBreak) {
66: $this->_writeTextBreak($objWriter);
67: } elseif ($element instanceof PHPWord_Section_Table) {
68: $this->_writeTable($objWriter, $element);
69: } elseif ($element instanceof PHPWord_Section_Image ||
70: $element instanceof PHPWord_Section_MemoryImage
71: ) {
72: $this->_writeImage($objWriter, $element);
73: } elseif ($element instanceof PHPWord_Section_Footer_PreserveText) {
74: $this->_writePreserveText($objWriter, $element);
75: }
76: }
77:
78: $objWriter->endElement();
79:
80:
81: return $objWriter->getData();
82: }
83: }
84: