|
1
|
|
|
<?php |
|
2
|
|
|
namespace PhpOffice\PhpPresentation\Writer\PowerPoint2007; |
|
3
|
|
|
|
|
4
|
|
|
use PhpOffice\Common\XMLWriter; |
|
5
|
|
|
|
|
6
|
|
|
class PptPresProps extends AbstractDecoratorWriter |
|
7
|
|
|
{ |
|
8
|
|
|
/** |
|
9
|
|
|
* @return \PhpOffice\Common\Adapter\Zip\ZipInterface |
|
10
|
|
|
* @throws \Exception |
|
11
|
|
|
*/ |
|
12
|
112 |
|
public function render() |
|
13
|
|
|
{ |
|
14
|
112 |
|
$presentationPpts = $this->oPresentation->getPresentationProperties(); |
|
15
|
|
|
|
|
16
|
|
|
// Create XML writer |
|
17
|
112 |
|
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY); |
|
18
|
|
|
|
|
19
|
|
|
// XML header |
|
20
|
112 |
|
$objWriter->startDocument('1.0', 'UTF-8', 'yes'); |
|
21
|
|
|
|
|
22
|
|
|
// p:presentationPr |
|
23
|
112 |
|
$objWriter->startElement('p:presentationPr'); |
|
24
|
112 |
|
$objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main'); |
|
25
|
112 |
|
$objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); |
|
26
|
112 |
|
$objWriter->writeAttribute('xmlns:p', 'http://schemas.openxmlformats.org/presentationml/2006/main'); |
|
27
|
|
|
|
|
28
|
|
|
// p:presentationPr > p:showPr |
|
29
|
112 |
|
if ($presentationPpts->isLoopContinuouslyUntilEsc()) { |
|
30
|
|
|
$objWriter->startElement('p:showPr'); |
|
31
|
|
|
$objWriter->writeAttribute('loop', '1'); |
|
32
|
|
|
$objWriter->endElement(); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
// p:extLst |
|
36
|
112 |
|
$objWriter->startElement('p:extLst'); |
|
37
|
|
|
|
|
38
|
|
|
// p:ext |
|
39
|
112 |
|
$objWriter->startElement('p:ext'); |
|
40
|
112 |
|
$objWriter->writeAttribute('uri', '{E76CE94A-603C-4142-B9EB-6D1370010A27}'); |
|
41
|
|
|
|
|
42
|
|
|
// p14:discardImageEditData |
|
43
|
112 |
|
$objWriter->startElement('p14:discardImageEditData'); |
|
44
|
112 |
|
$objWriter->writeAttribute('xmlns:p14', 'http://schemas.microsoft.com/office/powerpoint/2010/main'); |
|
45
|
112 |
|
$objWriter->writeAttribute('val', '0'); |
|
46
|
112 |
|
$objWriter->endElement(); |
|
47
|
|
|
|
|
48
|
|
|
// > p:ext |
|
49
|
112 |
|
$objWriter->endElement(); |
|
50
|
|
|
|
|
51
|
|
|
// p:ext |
|
52
|
112 |
|
$objWriter->startElement('p:ext'); |
|
53
|
112 |
|
$objWriter->writeAttribute('uri', '{D31A062A-798A-4329-ABDD-BBA856620510}'); |
|
54
|
|
|
|
|
55
|
|
|
// p14:defaultImageDpi |
|
56
|
112 |
|
$objWriter->startElement('p14:defaultImageDpi'); |
|
57
|
112 |
|
$objWriter->writeAttribute('xmlns:p14', 'http://schemas.microsoft.com/office/powerpoint/2010/main'); |
|
58
|
112 |
|
$objWriter->writeAttribute('val', '220'); |
|
59
|
112 |
|
$objWriter->endElement(); |
|
60
|
|
|
|
|
61
|
|
|
// > p:ext |
|
62
|
112 |
|
$objWriter->endElement(); |
|
63
|
|
|
// > p:extLst |
|
64
|
112 |
|
$objWriter->endElement(); |
|
65
|
|
|
// > p:presentationPr |
|
66
|
112 |
|
$objWriter->endElement(); |
|
67
|
|
|
|
|
68
|
112 |
|
$this->getZip()->addFromString('ppt/presProps.xml', $objWriter->getData()); |
|
69
|
|
|
|
|
70
|
112 |
|
return $this->getZip(); |
|
71
|
|
|
} |
|
72
|
|
|
} |
|
73
|
|
|
|