|
1
|
|
|
<?php
|
|
|
|
|
|
|
2
|
|
|
|
|
3
|
|
|
namespace PhpOffice\PhpPresentation\Writer\PowerPoint2007;
|
|
4
|
|
|
|
|
5
|
|
|
use PhpOffice\Common\Drawing as CommonDrawing;
|
|
6
|
|
|
use PhpOffice\Common\XMLWriter;
|
|
7
|
|
|
use PhpOffice\PhpPresentation\Shape\Chart as ShapeChart;
|
|
8
|
|
|
use PhpOffice\PhpPresentation\Shape\Comment;
|
|
9
|
|
|
use PhpOffice\PhpPresentation\Shape\Drawing as ShapeDrawing;
|
|
10
|
|
|
use PhpOffice\PhpPresentation\Shape\Group;
|
|
11
|
|
|
use PhpOffice\PhpPresentation\Shape\Video;
|
|
12
|
|
|
use PhpOffice\PhpPresentation\Shape\Audio;
|
|
13
|
|
|
use PhpOffice\PhpPresentation\Shape\RichText;
|
|
14
|
|
|
use PhpOffice\PhpPresentation\Shape\RichText\Run;
|
|
15
|
|
|
use PhpOffice\PhpPresentation\Shape\RichText\TextElement;
|
|
16
|
|
|
use PhpOffice\PhpPresentation\Shape\Table as ShapeTable;
|
|
17
|
|
|
use PhpOffice\PhpPresentation\Slide;
|
|
18
|
|
|
use PhpOffice\PhpPresentation\Slide\Background\Image;
|
|
19
|
|
|
use PhpOffice\PhpPresentation\Slide\Note;
|
|
20
|
|
|
|
|
21
|
|
|
class PptSlides extends AbstractSlide {
|
|
22
|
|
|
/**
|
|
23
|
|
|
* Add slides (drawings, ...) and slide relationships (drawings, ...)
|
|
24
|
|
|
*
|
|
25
|
|
|
* @return \PhpOffice\Common\Adapter\Zip\ZipInterface
|
|
26
|
|
|
*/
|
|
27
|
111 |
|
public function render() {
|
|
28
|
111 |
|
foreach ( $this->oPresentation->getAllSlides () as $idx => $oSlide ) {
|
|
|
|
|
|
|
29
|
111 |
|
$this->oZip->addFromString ( 'ppt/slides/_rels/slide' . ($idx + 1) . '.xml.rels', $this->writeSlideRelationships ( $oSlide ) );
|
|
|
|
|
|
|
30
|
111 |
|
$this->oZip->addFromString ( 'ppt/slides/slide' . ($idx + 1) . '.xml', $this->writeSlide ( $oSlide ) );
|
|
|
|
|
|
|
31
|
|
|
|
|
32
|
|
|
// Add note slide
|
|
33
|
111 |
|
if ($oSlide->getNote () instanceof Note) {
|
|
|
|
|
|
|
34
|
111 |
|
if ($oSlide->getNote ()->getShapeCollection ()->count () > 0) {
|
|
|
|
|
|
|
35
|
1 |
|
$this->oZip->addFromString ( 'ppt/notesSlides/notesSlide' . ($idx + 1) . '.xml', $this->writeNote ( $oSlide->getNote () ) );
|
|
|
|
|
|
|
36
|
|
|
}
|
|
37
|
|
|
}
|
|
38
|
|
|
|
|
39
|
|
|
// Add background image slide
|
|
40
|
111 |
|
$oBkgImage = $oSlide->getBackground ();
|
|
|
|
|
|
|
41
|
111 |
|
if ($oBkgImage instanceof Image) {
|
|
42
|
111 |
|
$this->oZip->addFromString ( 'ppt/media/' . $oBkgImage->getIndexedFilename ( $idx ), file_get_contents ( $oBkgImage->getPath () ) );
|
|
|
|
|
|
|
43
|
|
|
}
|
|
44
|
|
|
}
|
|
45
|
|
|
|
|
46
|
111 |
|
return $this->oZip;
|
|
47
|
|
|
}
|
|
48
|
|
|
|
|
49
|
|
|
/**
|
|
50
|
|
|
* Write slide relationships to XML format
|
|
51
|
|
|
*
|
|
52
|
|
|
* @param \PhpOffice\PhpPresentation\Slide $pSlide
|
|
53
|
|
|
* @return string XML Output
|
|
54
|
|
|
* @throws \Exception
|
|
55
|
|
|
*/
|
|
56
|
111 |
|
protected function writeSlideRelationships(Slide $pSlide) {
|
|
57
|
|
|
// @todo Group all getShapeCollection()->getIterator
|
|
58
|
|
|
|
|
59
|
|
|
// Create XML writer
|
|
60
|
111 |
|
$objWriter = new XMLWriter ( XMLWriter::STORAGE_MEMORY );
|
|
|
|
|
|
|
61
|
|
|
|
|
62
|
|
|
// XML header
|
|
63
|
111 |
|
$objWriter->startDocument ( '1.0', 'UTF-8', 'yes' );
|
|
|
|
|
|
|
64
|
|
|
|
|
65
|
|
|
// Relationships
|
|
66
|
111 |
|
$objWriter->startElement ( 'Relationships' );
|
|
|
|
|
|
|
67
|
111 |
|
$objWriter->writeAttribute ( 'xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships' );
|
|
|
|
|
|
|
68
|
|
|
|
|
69
|
|
|
// Starting relation id
|
|
70
|
111 |
|
$relId = 1;
|
|
71
|
111 |
|
$idxSlide = $pSlide->getParent ()->getIndex ( $pSlide );
|
|
|
|
|
|
|
72
|
|
|
|
|
73
|
|
|
// Write slideLayout relationship
|
|
74
|
111 |
|
$layoutId = 1;
|
|
75
|
111 |
|
if ($pSlide->getSlideLayout ()) {
|
|
|
|
|
|
|
76
|
111 |
|
$layoutId = $pSlide->getSlideLayout ()->layoutNr;
|
|
|
|
|
|
|
77
|
|
|
}
|
|
78
|
111 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout', '../slideLayouts/slideLayout' . $layoutId . '.xml' );
|
|
|
|
|
|
|
79
|
111 |
|
++ $relId;
|
|
80
|
|
|
|
|
81
|
|
|
// Write drawing relationships?
|
|
82
|
111 |
|
if ($pSlide->getShapeCollection ()->count () > 0) {
|
|
|
|
|
|
|
83
|
|
|
// Loop trough images and write relationships
|
|
84
|
84 |
|
$iterator = $pSlide->getShapeCollection ()->getIterator ();
|
|
|
|
|
|
|
85
|
84 |
|
while ( $iterator->valid () ) {
|
|
|
|
|
|
|
86
|
84 |
|
if ($iterator->current () instanceof Video) {
|
|
|
|
|
|
|
87
|
|
|
// Write relationship for image drawing
|
|
88
|
|
|
$iterator->current ()->relationId = 'rId' . $relId;
|
|
|
|
|
|
|
89
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/video', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
90
|
|
|
++ $relId;
|
|
91
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.microsoft.com/office/2007/relationships/media', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
92
|
|
|
++ $relId;
|
|
93
|
|
|
$filename = str_replace ( '.', '_', $iterator->current ()->getIndexedFilename () ) . '_bg.png';
|
|
|
|
|
|
|
94
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', '../media/' . $filename );
|
|
|
|
|
|
|
95
|
|
|
++ $relId;
|
|
96
|
84 |
|
} elseif ($iterator->current () instanceof Audio) {
|
|
|
|
|
|
|
97
|
|
|
// Write relationship for image drawing
|
|
98
|
|
|
$iterator->current ()->relationId = 'rId' . $relId;
|
|
|
|
|
|
|
99
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
100
|
|
|
++ $relId;
|
|
101
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.microsoft.com/office/2007/relationships/media', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
102
|
|
|
++ $relId;
|
|
103
|
|
|
$filename = str_replace ( '.', '_', $iterator->current ()->getIndexedFilename () ) . '_bg.png';
|
|
|
|
|
|
|
104
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', '../media/' . $filename );
|
|
|
|
|
|
|
105
|
|
|
++ $relId;
|
|
106
|
84 |
|
} elseif ($iterator->current () instanceof ShapeDrawing\AbstractDrawingAdapter) {
|
|
|
|
|
|
|
107
|
|
|
// Write relationship for image drawing
|
|
108
|
8 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
109
|
8 |
|
$iterator->current ()->relationId = 'rId' . $relId;
|
|
|
|
|
|
|
110
|
8 |
|
++ $relId;
|
|
111
|
76 |
|
} elseif ($iterator->current () instanceof ShapeChart) {
|
|
|
|
|
|
|
112
|
|
|
// Write relationship for chart drawing
|
|
113
|
34 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart', '../charts/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
114
|
|
|
|
|
115
|
34 |
|
$iterator->current ()->relationId = 'rId' . $relId;
|
|
|
|
|
|
|
116
|
|
|
|
|
117
|
34 |
|
++ $relId;
|
|
118
|
42 |
|
} elseif ($iterator->current () instanceof Group) {
|
|
|
|
|
|
|
119
|
1 |
|
$iterator2 = $iterator->current ()->getShapeCollection ()->getIterator ();
|
|
|
|
|
|
|
120
|
1 |
|
while ( $iterator2->valid () ) {
|
|
|
|
|
|
|
121
|
1 |
|
if ($iterator2->current () instanceof Video) {
|
|
|
|
|
|
|
122
|
|
|
// Write relationship for image drawing
|
|
123
|
|
|
$iterator2->current ()->relationId = 'rId' . $relId;
|
|
|
|
|
|
|
124
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/video', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
125
|
|
|
++ $relId;
|
|
126
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.microsoft.com/office/2007/relationships/media', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
127
|
|
|
++ $relId;
|
|
128
|
|
|
$filename = str_replace ( '.', '_', $iterator->current ()->getIndexedFilename () ) . '_bg.png';
|
|
|
|
|
|
|
129
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', '../media/' . $filename );
|
|
|
|
|
|
|
130
|
|
|
++ $relId;
|
|
131
|
1 |
|
} elseif ($iterator->current () instanceof Audio) {
|
|
|
|
|
|
|
132
|
|
|
// Write relationship for image drawing
|
|
133
|
|
|
$iterator->current ()->relationId = 'rId' . $relId;
|
|
|
|
|
|
|
134
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
135
|
|
|
++ $relId;
|
|
136
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.microsoft.com/office/2007/relationships/media', '../media/' . $iterator->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
137
|
|
|
++ $relId;
|
|
138
|
|
|
$filename = str_replace ( '.', '_', $iterator->current ()->getIndexedFilename () ) . '_bg.png';
|
|
|
|
|
|
|
139
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', '../media/' . $filename );
|
|
|
|
|
|
|
140
|
|
|
++ $relId;
|
|
141
|
1 |
|
} elseif ($iterator2->current () instanceof ShapeDrawing\AbstractDrawingAdapter) {
|
|
|
|
|
|
|
142
|
|
|
// Write relationship for image drawing
|
|
143
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', '../media/' . $iterator2->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
144
|
|
|
$iterator2->current ()->relationId = 'rId' . $relId;
|
|
|
|
|
|
|
145
|
|
|
|
|
146
|
|
|
++ $relId;
|
|
147
|
1 |
|
} elseif ($iterator2->current () instanceof ShapeChart) {
|
|
|
|
|
|
|
148
|
|
|
// Write relationship for chart drawing
|
|
149
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart', '../charts/' . $iterator2->current ()->getIndexedFilename () );
|
|
|
|
|
|
|
150
|
|
|
$iterator2->current ()->relationId = 'rId' . $relId;
|
|
|
|
|
|
|
151
|
|
|
|
|
152
|
|
|
++ $relId;
|
|
153
|
|
|
}
|
|
154
|
1 |
|
$iterator2->next ();
|
|
|
|
|
|
|
155
|
|
|
}
|
|
156
|
|
|
}
|
|
157
|
|
|
|
|
158
|
84 |
|
$iterator->next ();
|
|
|
|
|
|
|
159
|
|
|
}
|
|
160
|
|
|
}
|
|
161
|
|
|
|
|
162
|
|
|
// Write background relationships?
|
|
163
|
111 |
|
$oBackground = $pSlide->getBackground ();
|
|
|
|
|
|
|
164
|
111 |
|
if ($oBackground instanceof Image) {
|
|
165
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', '../media/' . $oBackground->getIndexedFilename ( $idxSlide ) );
|
|
|
|
|
|
|
166
|
|
|
$oBackground->relationId = 'rId' . $relId;
|
|
167
|
|
|
++ $relId;
|
|
168
|
|
|
}
|
|
169
|
|
|
|
|
170
|
|
|
// Write hyperlink relationships?
|
|
171
|
111 |
|
if ($pSlide->getShapeCollection ()->count () > 0) {
|
|
|
|
|
|
|
172
|
|
|
// Loop trough hyperlinks and write relationships
|
|
173
|
84 |
|
$iterator = $pSlide->getShapeCollection ()->getIterator ();
|
|
|
|
|
|
|
174
|
84 |
|
while ( $iterator->valid () ) {
|
|
|
|
|
|
|
175
|
|
|
// Hyperlink on shape
|
|
176
|
84 |
|
if ($iterator->current ()->hasHyperlink ()) {
|
|
|
|
|
|
|
177
|
|
|
// Write relationship for hyperlink
|
|
178
|
2 |
|
$hyperlink = $iterator->current ()->getHyperlink ();
|
|
|
|
|
|
|
179
|
2 |
|
$hyperlink->relationId = 'rId' . $relId;
|
|
180
|
|
|
|
|
181
|
2 |
|
if (! $hyperlink->isInternal ()) {
|
|
|
|
|
|
|
182
|
2 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', $hyperlink->getUrl (), 'External' );
|
|
|
|
|
|
|
183
|
|
|
} else {
|
|
184
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide', 'slide' . $hyperlink->getSlideNumber () . '.xml' );
|
|
|
|
|
|
|
185
|
|
|
}
|
|
186
|
|
|
|
|
187
|
2 |
|
++ $relId;
|
|
188
|
|
|
}
|
|
189
|
|
|
|
|
190
|
|
|
// Hyperlink on rich text run
|
|
191
|
84 |
|
if ($iterator->current () instanceof RichText) {
|
|
|
|
|
|
|
192
|
24 |
|
foreach ( $iterator->current ()->getParagraphs () as $paragraph ) {
|
|
|
|
|
|
|
193
|
24 |
|
foreach ( $paragraph->getRichTextElements () as $element ) {
|
|
|
|
|
|
|
194
|
19 |
|
if ($element instanceof Run || $element instanceof TextElement) {
|
|
195
|
18 |
|
if ($element->hasHyperlink ()) {
|
|
|
|
|
|
|
196
|
|
|
// Write relationship for hyperlink
|
|
197
|
2 |
|
$hyperlink = $element->getHyperlink ();
|
|
|
|
|
|
|
198
|
2 |
|
$hyperlink->relationId = 'rId' . $relId;
|
|
199
|
|
|
|
|
200
|
2 |
|
if (! $hyperlink->isInternal ()) {
|
|
|
|
|
|
|
201
|
1 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', $hyperlink->getUrl (), 'External' );
|
|
|
|
|
|
|
202
|
|
|
} else {
|
|
203
|
1 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide', 'slide' . $hyperlink->getSlideNumber () . '.xml' );
|
|
|
|
|
|
|
204
|
|
|
}
|
|
205
|
|
|
|
|
206
|
24 |
|
++ $relId;
|
|
207
|
|
|
}
|
|
208
|
|
|
}
|
|
209
|
|
|
}
|
|
210
|
|
|
}
|
|
211
|
|
|
}
|
|
212
|
|
|
|
|
213
|
|
|
// Hyperlink in table
|
|
214
|
84 |
|
if ($iterator->current () instanceof ShapeTable) {
|
|
|
|
|
|
|
215
|
|
|
// Rows
|
|
216
|
10 |
|
$countRows = count ( $iterator->current ()->getRows () );
|
|
|
|
|
|
|
217
|
10 |
|
for($row = 0; $row < $countRows; $row ++) {
|
|
|
|
|
|
|
218
|
|
|
// Cells in rows
|
|
219
|
10 |
|
$countCells = count ( $iterator->current ()->getRow ( $row )->getCells () );
|
|
|
|
|
|
|
220
|
10 |
|
for($cell = 0; $cell < $countCells; $cell ++) {
|
|
|
|
|
|
|
221
|
10 |
|
$currentCell = $iterator->current ()->getRow ( $row )->getCell ( $cell );
|
|
|
|
|
|
|
222
|
|
|
// Paragraphs in cell
|
|
223
|
10 |
|
foreach ( $currentCell->getParagraphs () as $paragraph ) {
|
|
|
|
|
|
|
224
|
|
|
// RichText in paragraph
|
|
225
|
10 |
|
foreach ( $paragraph->getRichTextElements () as $element ) {
|
|
|
|
|
|
|
226
|
|
|
// Run or Text in RichText
|
|
227
|
10 |
|
if ($element instanceof Run || $element instanceof TextElement) {
|
|
228
|
10 |
|
if ($element->hasHyperlink ()) {
|
|
|
|
|
|
|
229
|
|
|
// Write relationship for hyperlink
|
|
230
|
1 |
|
$hyperlink = $element->getHyperlink ();
|
|
|
|
|
|
|
231
|
1 |
|
$hyperlink->relationId = 'rId' . $relId;
|
|
232
|
|
|
|
|
233
|
1 |
|
if (! $hyperlink->isInternal ()) {
|
|
|
|
|
|
|
234
|
1 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', $hyperlink->getUrl (), 'External' );
|
|
|
|
|
|
|
235
|
|
|
} else {
|
|
236
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide', 'slide' . $hyperlink->getSlideNumber () . '.xml' );
|
|
|
|
|
|
|
237
|
|
|
}
|
|
238
|
|
|
|
|
239
|
10 |
|
++ $relId;
|
|
240
|
|
|
}
|
|
241
|
|
|
}
|
|
242
|
|
|
}
|
|
243
|
|
|
}
|
|
244
|
|
|
}
|
|
245
|
|
|
}
|
|
246
|
|
|
}
|
|
247
|
|
|
|
|
248
|
84 |
|
if ($iterator->current () instanceof Group) {
|
|
|
|
|
|
|
249
|
1 |
|
$iterator2 = $pSlide->getShapeCollection ()->getIterator ();
|
|
|
|
|
|
|
250
|
1 |
|
while ( $iterator2->valid () ) {
|
|
|
|
|
|
|
251
|
|
|
// Hyperlink on shape
|
|
252
|
1 |
|
if ($iterator2->current ()->hasHyperlink ()) {
|
|
|
|
|
|
|
253
|
|
|
// Write relationship for hyperlink
|
|
254
|
|
|
$hyperlink = $iterator2->current ()->getHyperlink ();
|
|
|
|
|
|
|
255
|
|
|
$hyperlink->relationId = 'rId' . $relId;
|
|
256
|
|
|
|
|
257
|
|
|
if (! $hyperlink->isInternal ()) {
|
|
|
|
|
|
|
258
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', $hyperlink->getUrl (), 'External' );
|
|
|
|
|
|
|
259
|
|
|
} else {
|
|
260
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide', 'slide' . $hyperlink->getSlideNumber () . '.xml' );
|
|
|
|
|
|
|
261
|
|
|
}
|
|
262
|
|
|
|
|
263
|
|
|
++ $relId;
|
|
264
|
|
|
}
|
|
265
|
|
|
|
|
266
|
|
|
// Hyperlink on rich text run
|
|
267
|
1 |
|
if ($iterator2->current () instanceof RichText) {
|
|
|
|
|
|
|
268
|
|
|
foreach ( $iterator2->current ()->getParagraphs () as $paragraph ) {
|
|
|
|
|
|
|
269
|
|
|
foreach ( $paragraph->getRichTextElements () as $element ) {
|
|
|
|
|
|
|
270
|
|
|
if ($element instanceof Run || $element instanceof TextElement) {
|
|
271
|
|
|
if ($element->hasHyperlink ()) {
|
|
|
|
|
|
|
272
|
|
|
// Write relationship for hyperlink
|
|
273
|
|
|
$hyperlink = $element->getHyperlink ();
|
|
|
|
|
|
|
274
|
|
|
$hyperlink->relationId = 'rId' . $relId;
|
|
275
|
|
|
|
|
276
|
|
|
if (! $hyperlink->isInternal ()) {
|
|
|
|
|
|
|
277
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', $hyperlink->getUrl (), 'External' );
|
|
|
|
|
|
|
278
|
|
|
} else {
|
|
279
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide', 'slide' . $hyperlink->getSlideNumber () . '.xml' );
|
|
|
|
|
|
|
280
|
|
|
}
|
|
281
|
|
|
|
|
282
|
|
|
++ $relId;
|
|
283
|
|
|
}
|
|
284
|
|
|
}
|
|
285
|
|
|
}
|
|
286
|
|
|
}
|
|
287
|
|
|
}
|
|
288
|
|
|
|
|
289
|
|
|
// Hyperlink in table
|
|
290
|
1 |
|
if ($iterator2->current () instanceof ShapeTable) {
|
|
|
|
|
|
|
291
|
|
|
// Rows
|
|
292
|
|
|
$countRows = count ( $iterator2->current ()->getRows () );
|
|
|
|
|
|
|
293
|
|
|
for($row = 0; $row < $countRows; $row ++) {
|
|
|
|
|
|
|
294
|
|
|
// Cells in rows
|
|
295
|
|
|
$countCells = count ( $iterator2->current ()->getRow ( $row )->getCells () );
|
|
|
|
|
|
|
296
|
|
|
for($cell = 0; $cell < $countCells; $cell ++) {
|
|
|
|
|
|
|
297
|
|
|
$currentCell = $iterator2->current ()->getRow ( $row )->getCell ( $cell );
|
|
|
|
|
|
|
298
|
|
|
// Paragraphs in cell
|
|
299
|
|
|
foreach ( $currentCell->getParagraphs () as $paragraph ) {
|
|
|
|
|
|
|
300
|
|
|
// RichText in paragraph
|
|
301
|
|
|
foreach ( $paragraph->getRichTextElements () as $element ) {
|
|
|
|
|
|
|
302
|
|
|
// Run or Text in RichText
|
|
303
|
|
|
if ($element instanceof Run || $element instanceof TextElement) {
|
|
304
|
|
|
if ($element->hasHyperlink ()) {
|
|
|
|
|
|
|
305
|
|
|
// Write relationship for hyperlink
|
|
306
|
|
|
$hyperlink = $element->getHyperlink ();
|
|
|
|
|
|
|
307
|
|
|
$hyperlink->relationId = 'rId' . $relId;
|
|
308
|
|
|
|
|
309
|
|
|
if (! $hyperlink->isInternal ()) {
|
|
|
|
|
|
|
310
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', $hyperlink->getUrl (), 'External' );
|
|
|
|
|
|
|
311
|
|
|
} else {
|
|
312
|
|
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide', 'slide' . $hyperlink->getSlideNumber () . '.xml' );
|
|
|
|
|
|
|
313
|
|
|
}
|
|
314
|
|
|
|
|
315
|
|
|
++ $relId;
|
|
316
|
|
|
}
|
|
317
|
|
|
}
|
|
318
|
|
|
}
|
|
319
|
|
|
}
|
|
320
|
|
|
}
|
|
321
|
|
|
}
|
|
322
|
|
|
}
|
|
323
|
|
|
|
|
324
|
1 |
|
$iterator2->next ();
|
|
|
|
|
|
|
325
|
|
|
}
|
|
326
|
|
|
}
|
|
327
|
|
|
|
|
328
|
84 |
|
$iterator->next ();
|
|
|
|
|
|
|
329
|
|
|
}
|
|
330
|
|
|
}
|
|
331
|
|
|
|
|
332
|
|
|
// Write comment relationships
|
|
333
|
111 |
|
if ($pSlide->getShapeCollection ()->count () > 0) {
|
|
|
|
|
|
|
334
|
84 |
|
$hasSlideComment = false;
|
|
335
|
|
|
|
|
336
|
|
|
// Loop trough images and write relationships
|
|
337
|
84 |
|
$iterator = $pSlide->getShapeCollection ()->getIterator ();
|
|
|
|
|
|
|
338
|
84 |
|
while ( $iterator->valid () ) {
|
|
|
|
|
|
|
339
|
84 |
|
if ($iterator->current () instanceof Comment) {
|
|
|
|
|
|
|
340
|
6 |
|
$hasSlideComment = true;
|
|
341
|
6 |
|
break;
|
|
342
|
78 |
|
} elseif ($iterator->current () instanceof Group) {
|
|
|
|
|
|
|
343
|
1 |
|
$iterator2 = $iterator->current ()->getShapeCollection ()->getIterator ();
|
|
|
|
|
|
|
344
|
1 |
|
while ( $iterator2->valid () ) {
|
|
|
|
|
|
|
345
|
1 |
|
if ($iterator2->current () instanceof Comment) {
|
|
|
|
|
|
|
346
|
1 |
|
$hasSlideComment = true;
|
|
347
|
1 |
|
break 2;
|
|
348
|
|
|
}
|
|
349
|
|
|
$iterator2->next ();
|
|
|
|
|
|
|
350
|
|
|
}
|
|
351
|
|
|
}
|
|
352
|
|
|
|
|
353
|
77 |
|
$iterator->next ();
|
|
|
|
|
|
|
354
|
|
|
}
|
|
355
|
|
|
|
|
356
|
84 |
|
if ($hasSlideComment) {
|
|
357
|
7 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments', '../comments/comment' . ($idxSlide + 1) . '.xml' );
|
|
|
|
|
|
|
358
|
7 |
|
++ $relId;
|
|
359
|
|
|
}
|
|
360
|
|
|
}
|
|
361
|
|
|
|
|
362
|
111 |
|
if ($pSlide->getNote ()->getShapeCollection ()->count () > 0) {
|
|
|
|
|
|
|
363
|
1 |
|
$this->writeRelationship ( $objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide', '../notesSlides/notesSlide' . ($idxSlide + 1) . '.xml' );
|
|
|
|
|
|
|
364
|
|
|
}
|
|
365
|
|
|
|
|
366
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
367
|
|
|
|
|
368
|
|
|
// Return
|
|
369
|
111 |
|
return $objWriter->getData ();
|
|
|
|
|
|
|
370
|
|
|
}
|
|
371
|
|
|
|
|
372
|
|
|
/**
|
|
373
|
|
|
* Write slide to XML format
|
|
374
|
|
|
*
|
|
375
|
|
|
* @param \PhpOffice\PhpPresentation\Slide $pSlide
|
|
376
|
|
|
* @return string XML Output
|
|
377
|
|
|
* @throws \Exception
|
|
378
|
|
|
*/
|
|
379
|
111 |
|
public function writeSlide(Slide $pSlide) {
|
|
380
|
|
|
// Create XML writer
|
|
381
|
111 |
|
$objWriter = new XMLWriter ( XMLWriter::STORAGE_MEMORY );
|
|
|
|
|
|
|
382
|
|
|
|
|
383
|
|
|
// XML header
|
|
384
|
111 |
|
$objWriter->startDocument ( '1.0', 'UTF-8', 'yes' );
|
|
|
|
|
|
|
385
|
|
|
|
|
386
|
|
|
// p:sld
|
|
387
|
111 |
|
$objWriter->startElement ( 'p:sld' );
|
|
|
|
|
|
|
388
|
111 |
|
$objWriter->writeAttribute ( 'xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main' );
|
|
|
|
|
|
|
389
|
111 |
|
$objWriter->writeAttribute ( 'xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships' );
|
|
|
|
|
|
|
390
|
111 |
|
$objWriter->writeAttribute ( 'xmlns:p', 'http://schemas.openxmlformats.org/presentationml/2006/main' );
|
|
|
|
|
|
|
391
|
111 |
|
$objWriter->writeAttributeIf ( ! $pSlide->isVisible (), 'show', 0 );
|
|
|
|
|
|
|
392
|
|
|
|
|
393
|
|
|
// p:sld/p:cSld
|
|
394
|
111 |
|
$objWriter->startElement ( 'p:cSld' );
|
|
|
|
|
|
|
395
|
|
|
|
|
396
|
|
|
// Background
|
|
397
|
111 |
|
if ($pSlide->getBackground () instanceof Slide\AbstractBackground) {
|
|
|
|
|
|
|
398
|
|
|
$oBackground = $pSlide->getBackground ();
|
|
|
|
|
|
|
399
|
|
|
// p:bg
|
|
400
|
|
|
$objWriter->startElement ( 'p:bg' );
|
|
|
|
|
|
|
401
|
|
|
|
|
402
|
|
|
// p:bgPr
|
|
403
|
|
|
$objWriter->startElement ( 'p:bgPr' );
|
|
|
|
|
|
|
404
|
|
|
|
|
405
|
|
|
if ($oBackground instanceof Slide\Background\Color) {
|
|
406
|
|
|
// a:solidFill
|
|
407
|
|
|
$objWriter->startElement ( 'a:solidFill' );
|
|
|
|
|
|
|
408
|
|
|
|
|
409
|
|
|
$this->writeColor ( $objWriter, $oBackground->getColor () );
|
|
|
|
|
|
|
410
|
|
|
|
|
411
|
|
|
// > a:solidFill
|
|
412
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
413
|
|
|
}
|
|
414
|
|
|
|
|
415
|
|
|
if ($oBackground instanceof Slide\Background\Image) {
|
|
416
|
|
|
// a:blipFill
|
|
417
|
|
|
$objWriter->startElement ( 'a:blipFill' );
|
|
|
|
|
|
|
418
|
|
|
|
|
419
|
|
|
// a:blip
|
|
420
|
|
|
$objWriter->startElement ( 'a:blip' );
|
|
|
|
|
|
|
421
|
|
|
$objWriter->writeAttribute ( 'r:embed', $oBackground->relationId );
|
|
|
|
|
|
|
422
|
|
|
|
|
423
|
|
|
// > a:blipFill
|
|
424
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
425
|
|
|
|
|
426
|
|
|
// a:stretch
|
|
427
|
|
|
$objWriter->startElement ( 'a:stretch' );
|
|
|
|
|
|
|
428
|
|
|
|
|
429
|
|
|
// a:fillRect
|
|
430
|
|
|
$objWriter->writeElement ( 'a:fillRect' );
|
|
|
|
|
|
|
431
|
|
|
|
|
432
|
|
|
// > a:stretch
|
|
433
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
434
|
|
|
|
|
435
|
|
|
// > a:blipFill
|
|
436
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
437
|
|
|
}
|
|
438
|
|
|
|
|
439
|
|
|
// > p:bgPr
|
|
440
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
441
|
|
|
|
|
442
|
|
|
// > p:bg
|
|
443
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
444
|
|
|
}
|
|
445
|
|
|
|
|
446
|
|
|
// p:spTree
|
|
447
|
111 |
|
$objWriter->startElement ( 'p:spTree' );
|
|
|
|
|
|
|
448
|
|
|
|
|
449
|
|
|
// p:nvGrpSpPr
|
|
450
|
111 |
|
$objWriter->startElement ( 'p:nvGrpSpPr' );
|
|
|
|
|
|
|
451
|
|
|
|
|
452
|
|
|
// p:cNvPr
|
|
453
|
111 |
|
$objWriter->startElement ( 'p:cNvPr' );
|
|
|
|
|
|
|
454
|
111 |
|
$objWriter->writeAttribute ( 'id', '1' );
|
|
|
|
|
|
|
455
|
111 |
|
$objWriter->writeAttribute ( 'name', '' );
|
|
|
|
|
|
|
456
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
457
|
|
|
|
|
458
|
|
|
// p:cNvGrpSpPr
|
|
459
|
111 |
|
$objWriter->writeElement ( 'p:cNvGrpSpPr', null );
|
|
|
|
|
|
|
460
|
|
|
|
|
461
|
|
|
// p:nvPr
|
|
462
|
111 |
|
$objWriter->writeElement ( 'p:nvPr', null );
|
|
|
|
|
|
|
463
|
|
|
|
|
464
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
465
|
|
|
|
|
466
|
|
|
// p:grpSpPr
|
|
467
|
111 |
|
$objWriter->startElement ( 'p:grpSpPr' );
|
|
|
|
|
|
|
468
|
|
|
|
|
469
|
|
|
// a:xfrm
|
|
470
|
111 |
|
$objWriter->startElement ( 'a:xfrm' );
|
|
|
|
|
|
|
471
|
|
|
|
|
472
|
|
|
// a:off
|
|
473
|
111 |
|
$objWriter->startElement ( 'a:off' );
|
|
|
|
|
|
|
474
|
111 |
|
$objWriter->writeAttribute ( 'x', CommonDrawing::pixelsToEmu ( $pSlide->getOffsetX () ) );
|
|
|
|
|
|
|
475
|
111 |
|
$objWriter->writeAttribute ( 'y', CommonDrawing::pixelsToEmu ( $pSlide->getOffsetY () ) );
|
|
|
|
|
|
|
476
|
111 |
|
$objWriter->endElement (); // a:off
|
|
|
|
|
|
|
477
|
|
|
|
|
478
|
|
|
// a:ext
|
|
479
|
111 |
|
$objWriter->startElement ( 'a:ext' );
|
|
|
|
|
|
|
480
|
111 |
|
$objWriter->writeAttribute ( 'cx', CommonDrawing::pixelsToEmu ( $pSlide->getExtentX () ) );
|
|
|
|
|
|
|
481
|
111 |
|
$objWriter->writeAttribute ( 'cy', CommonDrawing::pixelsToEmu ( $pSlide->getExtentY () ) );
|
|
|
|
|
|
|
482
|
111 |
|
$objWriter->endElement (); // a:ext
|
|
|
|
|
|
|
483
|
|
|
|
|
484
|
|
|
// a:chOff
|
|
485
|
111 |
|
$objWriter->startElement ( 'a:chOff' );
|
|
|
|
|
|
|
486
|
111 |
|
$objWriter->writeAttribute ( 'x', CommonDrawing::pixelsToEmu ( $pSlide->getOffsetX () ) );
|
|
|
|
|
|
|
487
|
111 |
|
$objWriter->writeAttribute ( 'y', CommonDrawing::pixelsToEmu ( $pSlide->getOffsetY () ) );
|
|
|
|
|
|
|
488
|
111 |
|
$objWriter->endElement (); // a:chOff
|
|
|
|
|
|
|
489
|
|
|
|
|
490
|
|
|
// a:chExt
|
|
491
|
111 |
|
$objWriter->startElement ( 'a:chExt' );
|
|
|
|
|
|
|
492
|
111 |
|
$objWriter->writeAttribute ( 'cx', CommonDrawing::pixelsToEmu ( $pSlide->getExtentX () ) );
|
|
|
|
|
|
|
493
|
111 |
|
$objWriter->writeAttribute ( 'cy', CommonDrawing::pixelsToEmu ( $pSlide->getExtentY () ) );
|
|
|
|
|
|
|
494
|
111 |
|
$objWriter->endElement (); // a:chExt
|
|
|
|
|
|
|
495
|
|
|
|
|
496
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
497
|
|
|
|
|
498
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
499
|
|
|
|
|
500
|
|
|
// Loop shapes
|
|
501
|
111 |
|
$this->writeShapeCollection ( $objWriter, $pSlide->getShapeCollection () );
|
|
|
|
|
|
|
502
|
|
|
|
|
503
|
|
|
// TODO
|
|
504
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
505
|
|
|
|
|
506
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
507
|
|
|
|
|
508
|
|
|
// p:clrMapOvr
|
|
509
|
111 |
|
$objWriter->startElement ( 'p:clrMapOvr' );
|
|
|
|
|
|
|
510
|
|
|
// p:clrMapOvr\a:masterClrMapping
|
|
511
|
111 |
|
$objWriter->writeElement ( 'a:masterClrMapping', null );
|
|
|
|
|
|
|
512
|
|
|
// ##p:clrMapOvr
|
|
513
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
514
|
|
|
|
|
515
|
111 |
|
$this->writeSlideTransition ( $objWriter, $pSlide->getTransition () );
|
|
|
|
|
|
|
516
|
|
|
|
|
517
|
111 |
|
$this->writeSlideAnimations ( $objWriter, $pSlide );
|
|
|
|
|
|
|
518
|
|
|
|
|
519
|
111 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
520
|
|
|
|
|
521
|
|
|
// Return
|
|
522
|
111 |
|
return $objWriter->getData ();
|
|
|
|
|
|
|
523
|
|
|
}
|
|
524
|
|
|
|
|
525
|
|
|
/**
|
|
526
|
|
|
*
|
|
527
|
|
|
* @param XMLWriter $objWriter
|
|
528
|
|
|
* @param Slide $oSlide
|
|
529
|
|
|
*/
|
|
530
|
111 |
|
protected function writeSlideAnimations(XMLWriter $objWriter, Slide $oSlide) {
|
|
531
|
111 |
|
$arrayAnimations = $oSlide->getAnimations ();
|
|
|
|
|
|
|
532
|
111 |
|
if (empty ( $arrayAnimations )) {
|
|
|
|
|
|
|
533
|
110 |
|
return;
|
|
534
|
|
|
}
|
|
535
|
|
|
|
|
536
|
|
|
// Variables
|
|
537
|
1 |
|
$shapeId = 1;
|
|
538
|
1 |
|
$idCount = 1;
|
|
539
|
1 |
|
$hashToIdMap = array ();
|
|
540
|
1 |
|
$arrayAnimationIds = array ();
|
|
541
|
|
|
|
|
542
|
1 |
|
foreach ( $oSlide->getShapeCollection () as $shape ) {
|
|
|
|
|
|
|
543
|
1 |
|
$hashToIdMap [$shape->getHashCode ()] = ++ $shapeId;
|
|
|
|
|
|
|
544
|
|
|
}
|
|
545
|
1 |
|
foreach ( $arrayAnimations as $oAnimation ) {
|
|
|
|
|
|
|
546
|
1 |
|
foreach ( $oAnimation->getShapeCollection () as $oShape ) {
|
|
|
|
|
|
|
547
|
1 |
|
$arrayAnimationIds [] = $hashToIdMap [$oShape->getHashCode ()];
|
|
|
|
|
|
|
548
|
|
|
}
|
|
549
|
|
|
}
|
|
550
|
|
|
|
|
551
|
|
|
// p:timing
|
|
552
|
1 |
|
$objWriter->startElement ( 'p:timing' );
|
|
|
|
|
|
|
553
|
|
|
// p:timing/p:tnLst
|
|
554
|
1 |
|
$objWriter->startElement ( 'p:tnLst' );
|
|
|
|
|
|
|
555
|
|
|
// p:timing/p:tnLst/p:par
|
|
556
|
1 |
|
$objWriter->startElement ( 'p:par' );
|
|
|
|
|
|
|
557
|
|
|
// p:timing/p:tnLst/p:par/p:cTn
|
|
558
|
1 |
|
$objWriter->startElement ( 'p:cTn' );
|
|
|
|
|
|
|
559
|
1 |
|
$objWriter->writeAttribute ( 'id', $idCount ++ );
|
|
|
|
|
|
|
560
|
1 |
|
$objWriter->writeAttribute ( 'dur', 'indefinite' );
|
|
|
|
|
|
|
561
|
1 |
|
$objWriter->writeAttribute ( 'restart', 'never' );
|
|
|
|
|
|
|
562
|
1 |
|
$objWriter->writeAttribute ( 'nodeType', 'tmRoot' );
|
|
|
|
|
|
|
563
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst
|
|
564
|
1 |
|
$objWriter->startElement ( 'p:childTnLst' );
|
|
|
|
|
|
|
565
|
|
|
|
|
566
|
|
|
// Each animation has 1 shape
|
|
567
|
1 |
|
foreach ( $arrayAnimations as $oAnimation ) {
|
|
|
|
|
|
|
568
|
1 |
|
foreach ( $oAnimation->getShapeCollection () as $oShape ) {
|
|
|
|
|
|
|
569
|
1 |
|
$shapeId = $hashToIdMap [$oShape->getHashCode ()];
|
|
|
|
|
|
|
570
|
1 |
|
$shape = $oShape;
|
|
571
|
|
|
}
|
|
572
|
|
|
|
|
573
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq
|
|
574
|
1 |
|
$objWriter->startElement ( 'p:seq' );
|
|
|
|
|
|
|
575
|
1 |
|
$objWriter->writeAttribute ( 'concurrent', '1' );
|
|
|
|
|
|
|
576
|
1 |
|
$objWriter->writeAttribute ( 'nextAc', 'seek' );
|
|
|
|
|
|
|
577
|
|
|
|
|
578
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn
|
|
579
|
1 |
|
$objWriter->startElement ( 'p:cTn' );
|
|
|
|
|
|
|
580
|
1 |
|
$objWriter->writeAttribute ( 'id', $idCount ++ );
|
|
|
|
|
|
|
581
|
1 |
|
$objWriter->writeAttribute ( 'restart', 'whenNotActive' );
|
|
|
|
|
|
|
582
|
1 |
|
$objWriter->writeAttribute ( 'fill', 'hold' );
|
|
|
|
|
|
|
583
|
1 |
|
$objWriter->writeAttribute ( 'evtFilter', 'cancelBubble' );
|
|
|
|
|
|
|
584
|
1 |
|
$objWriter->writeAttribute ( 'nodeType', 'interactiveSeq' );
|
|
|
|
|
|
|
585
|
|
|
|
|
586
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst
|
|
587
|
1 |
|
$objWriter->startElement ( 'p:stCondLst' );
|
|
|
|
|
|
|
588
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst/p:cond
|
|
589
|
1 |
|
$objWriter->startElement ( 'p:cond' );
|
|
|
|
|
|
|
590
|
1 |
|
$objWriter->writeAttribute ( 'evt', 'onClick' );
|
|
|
|
|
|
|
591
|
1 |
|
$objWriter->writeAttribute ( 'delay', '0' );
|
|
|
|
|
|
|
592
|
|
|
|
|
593
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst/p:cond/p:tgtEl
|
|
594
|
1 |
|
$objWriter->startElement ( 'p:tgtEl' );
|
|
|
|
|
|
|
595
|
|
|
|
|
596
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst/p:cond/p:tgtEl/p:spTgt
|
|
597
|
1 |
|
$objWriter->startElement ( 'p:spTgt' );
|
|
|
|
|
|
|
598
|
1 |
|
$objWriter->writeAttribute ( 'spid', $shapeId );
|
|
|
|
|
|
|
599
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
600
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst/p:cond/p:tgtEl
|
|
601
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
602
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst/p:cond/
|
|
603
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
604
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst
|
|
605
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
606
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/
|
|
607
|
|
|
|
|
608
|
1 |
|
$objWriter->startElement ( 'p:endSync' );
|
|
|
|
|
|
|
609
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:endSync/
|
|
610
|
1 |
|
$objWriter->writeAttribute ( 'evt', 'end' );
|
|
|
|
|
|
|
611
|
1 |
|
$objWriter->writeAttribute ( 'delay', 0 );
|
|
|
|
|
|
|
612
|
|
|
|
|
613
|
1 |
|
$objWriter->startElement ( 'p:rtn' );
|
|
|
|
|
|
|
614
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:endSync/p:rtn/
|
|
615
|
1 |
|
$objWriter->writeAttribute ( 'val', 'all' );
|
|
|
|
|
|
|
616
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
617
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:endSync/
|
|
618
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
619
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/
|
|
620
|
|
|
|
|
621
|
1 |
|
$objWriter->startElement ( 'p:childTnLst' );
|
|
|
|
|
|
|
622
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par
|
|
623
|
1 |
|
$objWriter->startElement ( 'p:par' );
|
|
|
|
|
|
|
624
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn
|
|
625
|
1 |
|
$objWriter->startElement ( 'p:cTn' );
|
|
|
|
|
|
|
626
|
1 |
|
$objWriter->writeAttribute ( 'id', $idCount ++ );
|
|
|
|
|
|
|
627
|
1 |
|
$objWriter->writeAttribute ( 'fill', 'hold' );
|
|
|
|
|
|
|
628
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst
|
|
629
|
1 |
|
$objWriter->startElement ( 'p:stCondLst' );
|
|
|
|
|
|
|
630
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst/p:cond
|
|
631
|
1 |
|
$objWriter->startElement ( 'p:cond' );
|
|
|
|
|
|
|
632
|
1 |
|
$objWriter->writeAttribute ( 'delay', '0' );
|
|
|
|
|
|
|
633
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
634
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn\##p:stCondLst
|
|
635
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
636
|
|
|
|
|
637
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst
|
|
638
|
1 |
|
$objWriter->startElement ( 'p:childTnLst' );
|
|
|
|
|
|
|
639
|
|
|
|
|
640
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par
|
|
641
|
1 |
|
$objWriter->startElement ( 'p:par' );
|
|
|
|
|
|
|
642
|
|
|
|
|
643
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn
|
|
644
|
1 |
|
$objWriter->startElement ( 'p:cTn' );
|
|
|
|
|
|
|
645
|
1 |
|
$objWriter->writeAttribute ( 'id', $idCount ++ );
|
|
|
|
|
|
|
646
|
1 |
|
$objWriter->writeAttribute ( 'fill', 'hold' );
|
|
|
|
|
|
|
647
|
|
|
|
|
648
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst
|
|
649
|
1 |
|
$objWriter->startElement ( 'p:stCondLst' );
|
|
|
|
|
|
|
650
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst/p:cond
|
|
651
|
1 |
|
$objWriter->startElement ( 'p:cond' );
|
|
|
|
|
|
|
652
|
1 |
|
$objWriter->writeAttribute ( 'delay', '0' );
|
|
|
|
|
|
|
653
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
654
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst
|
|
655
|
|
|
|
|
656
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
657
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn
|
|
658
|
|
|
|
|
659
|
1 |
|
$objWriter->startElement ( 'p:childTnLst' );
|
|
|
|
|
|
|
660
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst
|
|
661
|
1 |
|
$objWriter->startElement ( 'p:par' );
|
|
|
|
|
|
|
662
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par
|
|
663
|
|
|
|
|
664
|
1 |
|
$objWriter->startElement ( 'p:cTn' );
|
|
|
|
|
|
|
665
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn
|
|
666
|
1 |
|
$objWriter->writeAttribute ( 'id', $idCount ++ );
|
|
|
|
|
|
|
667
|
1 |
|
$objWriter->writeAttribute ( 'presetID', '2' );
|
|
|
|
|
|
|
668
|
1 |
|
$objWriter->writeAttribute ( 'presetClass', 'mediacall' );
|
|
|
|
|
|
|
669
|
1 |
|
$objWriter->writeAttribute ( 'presetSubtype', '0' );
|
|
|
|
|
|
|
670
|
1 |
|
$objWriter->writeAttribute ( 'fill', 'hold' );
|
|
|
|
|
|
|
671
|
1 |
|
$objWriter->writeAttribute ( 'nodeType', 'clickEffect' );
|
|
|
|
|
|
|
672
|
|
|
|
|
673
|
1 |
|
$objWriter->startElement ( 'p:stCondLst' );
|
|
|
|
|
|
|
674
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst
|
|
675
|
1 |
|
$objWriter->startElement ( 'p:cond' );
|
|
|
|
|
|
|
676
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst/p:cond
|
|
677
|
1 |
|
$objWriter->writeAttribute ( 'delay', '0' );
|
|
|
|
|
|
|
678
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
679
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:stCondLst
|
|
680
|
|
|
|
|
681
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
682
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn
|
|
683
|
|
|
|
|
684
|
1 |
|
$objWriter->startElement ( 'p:childTnLst' );
|
|
|
|
|
|
|
685
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst
|
|
686
|
|
|
|
|
687
|
1 |
|
$objWriter->startElement ( 'p:cmd' );
|
|
|
|
|
|
|
688
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd
|
|
689
|
1 |
|
$objWriter->writeAttribute ( 'type', 'call' );
|
|
|
|
|
|
|
690
|
1 |
|
$objWriter->writeAttribute ( 'cmd', 'togglePause' );
|
|
|
|
|
|
|
691
|
|
|
|
|
692
|
1 |
|
$objWriter->startElement ( 'p:cBhvr' );
|
|
|
|
|
|
|
693
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/p:cBhvr
|
|
694
|
|
|
|
|
695
|
1 |
|
$objWriter->startElement ( 'p:cTn' );
|
|
|
|
|
|
|
696
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/p:cBhvr/p:cTn
|
|
697
|
1 |
|
$objWriter->writeAttribute ( 'id', $idCount ++ );
|
|
|
|
|
|
|
698
|
1 |
|
$objWriter->writeAttribute ( 'dur', '1' );
|
|
|
|
|
|
|
699
|
1 |
|
$objWriter->writeAttribute ( 'fill', 'hold' );
|
|
|
|
|
|
|
700
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
701
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/p:cBhvr
|
|
702
|
|
|
|
|
703
|
1 |
|
$objWriter->startElement ( 'p:tgtEl' );
|
|
|
|
|
|
|
704
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/p:cBhvr/p:tgtEl
|
|
705
|
1 |
|
$objWriter->startElement ( 'p:spTgt' );
|
|
|
|
|
|
|
706
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/p:cBhvr/p:tgtEl/p:spTgt
|
|
707
|
1 |
|
$objWriter->writeAttribute ( 'spid', $shapeId );
|
|
|
|
|
|
|
708
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
709
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/p:cBhvr/p:tgtEl
|
|
710
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
711
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/p:cBhvr
|
|
712
|
|
|
|
|
713
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
714
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd
|
|
715
|
|
|
|
|
716
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
717
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst
|
|
718
|
|
|
|
|
719
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
720
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn
|
|
721
|
|
|
|
|
722
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
723
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par
|
|
724
|
|
|
|
|
725
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
726
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst
|
|
727
|
|
|
|
|
728
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
729
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn
|
|
730
|
|
|
|
|
731
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
732
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par
|
|
733
|
|
|
|
|
734
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
735
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst
|
|
736
|
|
|
|
|
737
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
738
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn
|
|
739
|
|
|
|
|
740
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
741
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par
|
|
742
|
|
|
|
|
743
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
744
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst
|
|
745
|
|
|
|
|
746
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
747
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn
|
|
748
|
|
|
|
|
749
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
750
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par
|
|
751
|
|
|
|
|
752
|
1 |
|
$objWriter->startElement ( 'p:nextCondLst' );
|
|
|
|
|
|
|
753
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:nextCondLst
|
|
754
|
|
|
|
|
755
|
1 |
|
$objWriter->startElement ( 'p:cond' );
|
|
|
|
|
|
|
756
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:nextCondLst/p:cond
|
|
757
|
1 |
|
$objWriter->writeAttribute ( 'evt', 'onClick' );
|
|
|
|
|
|
|
758
|
1 |
|
$objWriter->writeAttribute ( 'delay', '0' );
|
|
|
|
|
|
|
759
|
|
|
|
|
760
|
1 |
|
$objWriter->startElement ( 'p:tgtEl' );
|
|
|
|
|
|
|
761
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:nextCondLst/p:cond/p:tgtEl
|
|
762
|
1 |
|
$objWriter->startElement ( 'p:spTgt' );
|
|
|
|
|
|
|
763
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:nextCondLst/p:cond/p:tgtEl/p:spTgt
|
|
764
|
1 |
|
$objWriter->writeAttribute ( 'spid', $shapeId );
|
|
|
|
|
|
|
765
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
766
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:nextCondLst/p:cond/p:tgtEl
|
|
767
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
768
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:nextCondLst/p:cond
|
|
769
|
|
|
|
|
770
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
771
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:nextCondLst
|
|
772
|
|
|
|
|
773
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
774
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq
|
|
775
|
|
|
|
|
776
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
777
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst
|
|
778
|
|
|
|
|
779
|
1 |
|
if ($shape instanceof Video) {
|
|
780
|
|
|
$objWriter->startElement ( 'p:video' );
|
|
|
|
|
|
|
781
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video
|
|
782
|
1 |
|
} elseif ($shape instanceof Audio) {
|
|
|
|
|
|
|
783
|
|
|
$objWriter->startElement ( 'p:audio' );
|
|
|
|
|
|
|
784
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:audio
|
|
785
|
|
|
}
|
|
786
|
|
|
|
|
787
|
1 |
|
$objWriter->startElement ( 'p:cMediaNode' );
|
|
|
|
|
|
|
788
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode
|
|
789
|
1 |
|
$objWriter->writeAttribute ( 'vol', 80000 );
|
|
|
|
|
|
|
790
|
|
|
|
|
791
|
1 |
|
$objWriter->startElement ( 'p:cTn' );
|
|
|
|
|
|
|
792
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode/p:cTn
|
|
793
|
1 |
|
$objWriter->writeAttribute ( 'id', $idCount ++ );
|
|
|
|
|
|
|
794
|
1 |
|
$objWriter->writeAttribute ( 'fill', 'hold' );
|
|
|
|
|
|
|
795
|
1 |
|
$objWriter->writeAttribute ( 'display', '0' );
|
|
|
|
|
|
|
796
|
|
|
|
|
797
|
1 |
|
$objWriter->startElement ( 'p:stCondLst' );
|
|
|
|
|
|
|
798
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode/p:cTn/p:stCondLst
|
|
799
|
|
|
|
|
800
|
1 |
|
$objWriter->startElement ( 'p:cond' );
|
|
|
|
|
|
|
801
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode/p:cTn/p:stCondLst/p:cond
|
|
802
|
1 |
|
$objWriter->writeAttribute ( 'delay', 'indefinite' );
|
|
|
|
|
|
|
803
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
804
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode/p:cTn/p:stCondLst
|
|
805
|
|
|
|
|
806
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
807
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode/p:cTn
|
|
808
|
|
|
|
|
809
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
810
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode
|
|
811
|
|
|
|
|
812
|
1 |
|
$objWriter->startElement ( 'p:tgtEl' );
|
|
|
|
|
|
|
813
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode/p:tgtEl
|
|
814
|
1 |
|
$objWriter->startElement ( 'p:spTgt' );
|
|
|
|
|
|
|
815
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode/p:tgtEl/p:spTgt
|
|
816
|
1 |
|
$objWriter->writeAttribute ( 'spid', $shapeId );
|
|
|
|
|
|
|
817
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
818
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode/p:tgtEl
|
|
819
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
820
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video/p:cMediaNode
|
|
821
|
|
|
|
|
822
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
823
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:video
|
|
824
|
|
|
|
|
825
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
826
|
|
|
// p:timing/p:tnLst/p:par/p:cTn/p:childTnLst
|
|
827
|
|
|
}
|
|
828
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
829
|
|
|
// p:timing/p:tnLst/p:par/p:cTn
|
|
830
|
|
|
|
|
831
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
832
|
|
|
// p:timing/p:tnLst/p:par
|
|
833
|
|
|
|
|
834
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
835
|
|
|
// p:timing/p:tnLst
|
|
836
|
|
|
|
|
837
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
838
|
|
|
// p:timing
|
|
839
|
|
|
|
|
840
|
1 |
|
$objWriter->endElement ();
|
|
|
|
|
|
|
841
|
|
|
//
|
|
842
|
1 |
|
}
|
|
843
|
|
|
|
|
844
|
|
|
/**
|
|
845
|
|
|
* Write pic
|
|
846
|
|
|
*
|
|
847
|
|
|
* @param \PhpOffice\Common\XMLWriter $objWriter
|
|
848
|
|
|
* XML Writer
|
|
849
|
|
|
* @param \PhpOffice\PhpPresentation\Shape\Drawing\AbstractDrawingAdapter $shape
|
|
850
|
|
|
* @param int $shapeId
|
|
851
|
|
|
* @throws \Exception
|
|
852
|
|
|
*/
|
|
853
|
|
|
protected function writeShapeDrawing(XMLWriter $objWriter, ShapeDrawing\AbstractDrawingAdapter $shape, $shapeId) {
|
|
854
|
|
|
// p:pic
|
|
855
|
|
|
$objWriter->startElement ( 'p:pic' );
|
|
|
|
|
|
|
856
|
|
|
|
|
857
|
|
|
// p:nvPicPr
|
|
858
|
|
|
$objWriter->startElement ( 'p:nvPicPr' );
|
|
|
|
|
|
|
859
|
|
|
|
|
860
|
|
|
// p:cNvPr
|
|
861
|
|
|
$objWriter->startElement ( 'p:cNvPr' );
|
|
|
|
|
|
|
862
|
|
|
$objWriter->writeAttribute ( 'id', $shapeId );
|
|
|
|
|
|
|
863
|
|
|
$objWriter->writeAttribute ( 'name', $shape->getName () );
|
|
|
|
|
|
|
864
|
|
|
$objWriter->writeAttribute ( 'descr', $shape->getDescription () );
|
|
|
|
|
|
|
865
|
|
|
|
|
866
|
|
|
// a:hlinkClick
|
|
867
|
|
|
if ($shape->hasHyperlink ()) {
|
|
|
|
|
|
|
868
|
|
|
$this->writeHyperlink ( $objWriter, $shape );
|
|
|
|
|
|
|
869
|
|
|
}
|
|
870
|
|
|
|
|
871
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
872
|
|
|
|
|
873
|
|
|
// p:cNvPicPr
|
|
874
|
|
|
$objWriter->startElement ( 'p:cNvPicPr' );
|
|
|
|
|
|
|
875
|
|
|
|
|
876
|
|
|
// a:picLocks
|
|
877
|
|
|
$objWriter->startElement ( 'a:picLocks' );
|
|
|
|
|
|
|
878
|
|
|
$objWriter->writeAttribute ( 'noChangeAspect', '1' );
|
|
|
|
|
|
|
879
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
880
|
|
|
|
|
881
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
882
|
|
|
|
|
883
|
|
|
// p:nvPr
|
|
884
|
|
|
$objWriter->startElement ( 'p:nvPr' );
|
|
|
|
|
|
|
885
|
|
|
// PlaceHolder
|
|
886
|
|
|
if ($shape->isPlaceholder ()) {
|
|
|
|
|
|
|
887
|
|
|
$objWriter->startElement ( 'p:ph' );
|
|
|
|
|
|
|
888
|
|
|
$objWriter->writeAttribute ( 'type', $shape->getPlaceholder ()->getType () );
|
|
|
|
|
|
|
889
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
890
|
|
|
}
|
|
891
|
|
|
/**
|
|
892
|
|
|
*
|
|
893
|
|
|
* @link : https://github.com/stefslon/exportToPPTX/blob/master/exportToPPTX.m#L2128
|
|
894
|
|
|
*/
|
|
895
|
|
|
if ($shape instanceof Video) {
|
|
896
|
|
|
// p:nvPr > a:videoFile
|
|
897
|
|
|
$objWriter->startElement ( 'a:videoFile' );
|
|
|
|
|
|
|
898
|
|
|
$objWriter->writeAttribute ( 'r:link', $shape->relationId );
|
|
|
|
|
|
|
899
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
900
|
|
|
// p:nvPr > p:extLst
|
|
901
|
|
|
$objWriter->startElement ( 'p:extLst' );
|
|
|
|
|
|
|
902
|
|
|
// p:nvPr > p:extLst > p:ext
|
|
903
|
|
|
$objWriter->startElement ( 'p:ext' );
|
|
|
|
|
|
|
904
|
|
|
$objWriter->writeAttribute ( 'uri', '{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}' );
|
|
|
|
|
|
|
905
|
|
|
// p:nvPr > p:extLst > p:ext > p14:media
|
|
906
|
|
|
$objWriter->startElement ( 'p14:media' );
|
|
|
|
|
|
|
907
|
|
|
$objWriter->writeAttribute ( 'r:embed', ($shape->relationId + 1) );
|
|
|
|
|
|
|
908
|
|
|
$objWriter->writeAttribute ( 'xmlns:p14', 'http://schemas.microsoft.com/office/powerpoint/2010/main' );
|
|
|
|
|
|
|
909
|
|
|
// p:nvPr > p:extLst > p:ext > ##p14:media
|
|
910
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
911
|
|
|
// p:nvPr > p:extLst > ##p:ext
|
|
912
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
913
|
|
|
// p:nvPr > ##p:extLst
|
|
914
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
915
|
|
|
}
|
|
916
|
|
|
// ##p:nvPr
|
|
917
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
918
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
919
|
|
|
|
|
920
|
|
|
// p:blipFill
|
|
921
|
|
|
$objWriter->startElement ( 'p:blipFill' );
|
|
|
|
|
|
|
922
|
|
|
|
|
923
|
|
|
// a:blip
|
|
924
|
|
|
$objWriter->startElement ( 'a:blip' );
|
|
|
|
|
|
|
925
|
|
|
$objWriter->writeAttribute ( 'r:embed', $shape->relationId );
|
|
|
|
|
|
|
926
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
927
|
|
|
|
|
928
|
|
|
// a:stretch
|
|
929
|
|
|
$objWriter->startElement ( 'a:stretch' );
|
|
|
|
|
|
|
930
|
|
|
$objWriter->writeElement ( 'a:fillRect' );
|
|
|
|
|
|
|
931
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
932
|
|
|
|
|
933
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
934
|
|
|
|
|
935
|
|
|
// p:spPr
|
|
936
|
|
|
$objWriter->startElement ( 'p:spPr' );
|
|
|
|
|
|
|
937
|
|
|
// a:xfrm
|
|
938
|
|
|
$objWriter->startElement ( 'a:xfrm' );
|
|
|
|
|
|
|
939
|
|
|
$objWriter->writeAttributeIf ( $shape->getRotation () != 0, 'rot', CommonDrawing::degreesToAngle ( $shape->getRotation () ) );
|
|
|
|
|
|
|
940
|
|
|
|
|
941
|
|
|
// a:off
|
|
942
|
|
|
$objWriter->startElement ( 'a:off' );
|
|
|
|
|
|
|
943
|
|
|
$objWriter->writeAttribute ( 'x', CommonDrawing::pixelsToEmu ( $shape->getOffsetX () ) );
|
|
|
|
|
|
|
944
|
|
|
$objWriter->writeAttribute ( 'y', CommonDrawing::pixelsToEmu ( $shape->getOffsetY () ) );
|
|
|
|
|
|
|
945
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
946
|
|
|
|
|
947
|
|
|
// a:ext
|
|
948
|
|
|
$objWriter->startElement ( 'a:ext' );
|
|
|
|
|
|
|
949
|
|
|
$objWriter->writeAttribute ( 'cx', CommonDrawing::pixelsToEmu ( $shape->getWidth () ) );
|
|
|
|
|
|
|
950
|
|
|
$objWriter->writeAttribute ( 'cy', CommonDrawing::pixelsToEmu ( $shape->getHeight () ) );
|
|
|
|
|
|
|
951
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
952
|
|
|
|
|
953
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
954
|
|
|
|
|
955
|
|
|
// a:prstGeom
|
|
956
|
|
|
$objWriter->startElement ( 'a:prstGeom' );
|
|
|
|
|
|
|
957
|
|
|
$objWriter->writeAttribute ( 'prst', 'rect' );
|
|
|
|
|
|
|
958
|
|
|
// // a:prstGeom/a:avLst
|
|
959
|
|
|
$objWriter->writeElement ( 'a:avLst', null );
|
|
|
|
|
|
|
960
|
|
|
// ##a:prstGeom
|
|
961
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
962
|
|
|
|
|
963
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
964
|
|
|
|
|
965
|
|
|
$objWriter->endElement ();
|
|
|
|
|
|
|
966
|
|
|
}
|
|
967
|
|
|
} |
|
968
|
|
|
|