From cd3f74e572e8536db6a1530167432b32a162b4f3 Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Fri, 14 Mar 2014 04:26:50 +0700 Subject: [PATCH] Footnote fix --- .../PHPWord/Writer/Word2007/ContentTypes.php | 7 ++++ .../PHPWord/Writer/Word2007/FootnotesTest.php | 34 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Tests/PHPWord/Writer/Word2007/FootnotesTest.php diff --git a/Classes/PHPWord/Writer/Word2007/ContentTypes.php b/Classes/PHPWord/Writer/Word2007/ContentTypes.php index 56a33d69..1d81038f 100755 --- a/Classes/PHPWord/Writer/Word2007/ContentTypes.php +++ b/Classes/PHPWord/Writer/Word2007/ContentTypes.php @@ -138,6 +138,13 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write 'application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml' ); + // Footnotes + $this->_writeOverrideContentType( + $objWriter, + '/word/footnotes.xml', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml' + ); + for ($i = 1; $i <= $_cHdrs; $i++) { $this->_writeOverrideContentType( $objWriter, diff --git a/Tests/PHPWord/Writer/Word2007/FootnotesTest.php b/Tests/PHPWord/Writer/Word2007/FootnotesTest.php new file mode 100644 index 00000000..70083de7 --- /dev/null +++ b/Tests/PHPWord/Writer/Word2007/FootnotesTest.php @@ -0,0 +1,34 @@ +createSection(); + $section->addText('Text'); + $footnote = $section->createFootnote(); + $footnote->addText('Footnote'); + $footnote->addLink('http://google.com'); + $doc = TestHelperDOCX::getDocument($PHPWord); + + $this->assertEquals(1, 1); + } +}