| 1 | <?php |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @return ZipInterface |
||
| 13 | */ |
||
| 14 | |||
| 15 | public function render() |
||
| 16 | 57 | { |
|
| 17 | $arrMedia = array(); |
||
| 18 | 57 | for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) { |
|
| 19 | 57 | $shape = $this->getDrawingHashTable()->getByIndex($i);gi |
|
| 20 | 28 | if (!($shape instanceof Drawing\AbstractDrawingAdapter)) { |
|
|
|
|||
| 21 | 28 | continue; |
|
| 22 | 7 | } |
|
| 23 | 7 | if (in_array($shape->getIndexedFilename(), $arrMedia)) { |
|
| 24 | continue; |
||
| 25 | 7 | } |
|
| 26 | $arrMedia[] = $shape->getIndexedFilename(); |
||
| 27 | 7 | $this->getZip()->addFromString('Pictures/' . $shape->getIndexedFilename(), $shape->getContents()); |
|
| 28 | 1 | } |
|
| 29 | 1 | ||
| 30 | foreach ($this->getPresentation()->getAllSlides() as $keySlide => $oSlide) { |
||
| 31 | 1 | // Add background image slide |
|
| 32 | 1 | $oBkgImage = $oSlide->getBackground(); |
|
| 33 | 1 | if ($oBkgImage instanceof Image) { |
|
| 34 | 1 | $this->getZip()->addFromString('Pictures/'.$oBkgImage->getIndexedFilename($keySlide), file_get_contents($oBkgImage->getPath())); |
|
| 35 | 1 | } |
|
| 36 | 7 | } |
|
| 37 | 1 | ||
| 38 | 1 | return $this->getZip(); |
|
| 39 | 1 | } |
|
| 40 | } |
||
| 41 |