@@ -157,7 +157,7 @@ protected function loadDocumentProperties($sPart)
157
157
$ oProperties = $ this ->oPhpPresentation ->getProperties ();
158
158
foreach ($ arrayProperties as $ path => $ property ) {
159
159
if (is_object ($ oElement = $ xmlReader ->getElement ($ path ))) {
160
- if ($ oElement ->hasAttribute ('xsi:type ' ) && $ oElement ->getAttribute ('xsi:type ' ) == 'dcterms:W3CDTF ' ) {
160
+ if ($ oElement ->hasAttribute ('xsi:type ' ) && $ oElement ->getAttribute ('xsi:type ' ) == 'dcterms:W3CDTF ' ) {
161
161
$ oDateTime = new \DateTime ();
162
162
$ oDateTime ->createFromFormat (\DateTime::W3C , $ oElement ->nodeValue );
163
163
$ oProperties ->{$ property }($ oDateTime ->getTimestamp ());
@@ -222,7 +222,7 @@ protected function loadSlide($sPart, $baseFile)
222
222
}
223
223
224
224
/**
225
- *
225
+ *
226
226
* @param XMLReader $document
227
227
* @param \DOMElement $node
228
228
* @param string $baseFile
@@ -236,7 +236,7 @@ protected function loadShapeDrawing(XMLReader $document, \DOMElement $node, $bas
236
236
$ fileRels = 'ppt/slides/_rels/ ' .$ baseFile .'.rels ' ;
237
237
238
238
$ oElement = $ document ->getElement ('p:nvPicPr/p:cNvPr ' , $ node );
239
- if ($ oElement ) {
239
+ if ($ oElement ) {
240
240
$ oShape ->setName ($ oElement ->hasAttribute ('name ' ) ? $ oElement ->getAttribute ('name ' ) : '' );
241
241
$ oShape ->setDescription ($ oElement ->hasAttribute ('descr ' ) ? $ oElement ->getAttribute ('descr ' ) : '' );
242
242
}
@@ -247,7 +247,7 @@ protected function loadShapeDrawing(XMLReader $document, \DOMElement $node, $bas
247
247
$ pathImage = 'ppt/slides/ ' .$ this ->arrayRels [$ fileRels ][$ oElement ->getAttribute ('r:embed ' )];
248
248
$ pathImage = explode ('/ ' , $ pathImage );
249
249
foreach ($ pathImage as $ key => $ partPath ) {
250
- if ($ partPath == '.. ' ) {
250
+ if ($ partPath == '.. ' ) {
251
251
unset($ pathImage [$ key - 1 ]);
252
252
unset($ pathImage [$ key ]);
253
253
}
@@ -387,71 +387,71 @@ protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $ba
387
387
$ oParagraph ->getAlignment ()->setLevel ($ oSubElement ->getAttribute ('lvl ' ));
388
388
}
389
389
390
- $ oElement_buFont = $ document ->getElement ('a:buFont ' , $ oSubElement );
390
+ $ oElementBuFont = $ document ->getElement ('a:buFont ' , $ oSubElement );
391
391
$ oParagraph ->getBulletStyle ()->setBulletType (Bullet::TYPE_NONE );
392
- if ($ oElement_buFont ) {
393
- if ($ oElement_buFont ->hasAttribute ('typeface ' )) {
394
- $ oParagraph ->getBulletStyle ()->setBulletFont ($ oElement_buFont ->getAttribute ('typeface ' ));
392
+ if ($ oElementBuFont ) {
393
+ if ($ oElementBuFont ->hasAttribute ('typeface ' )) {
394
+ $ oParagraph ->getBulletStyle ()->setBulletFont ($ oElementBuFont ->getAttribute ('typeface ' ));
395
395
}
396
396
}
397
- $ oElement_buChar = $ document ->getElement ('a:buChar ' , $ oSubElement );
398
- if ($ oElement_buChar ) {
397
+ $ oElementBuChar = $ document ->getElement ('a:buChar ' , $ oSubElement );
398
+ if ($ oElementBuChar ) {
399
399
$ oParagraph ->getBulletStyle ()->setBulletType (Bullet::TYPE_BULLET );
400
- if ($ oElement_buChar ->hasAttribute ('char ' )) {
401
- $ oParagraph ->getBulletStyle ()->setBulletChar ($ oElement_buChar ->getAttribute ('char ' ));
400
+ if ($ oElementBuChar ->hasAttribute ('char ' )) {
401
+ $ oParagraph ->getBulletStyle ()->setBulletChar ($ oElementBuChar ->getAttribute ('char ' ));
402
402
}
403
403
}
404
- /*$oElement_buAutoNum = $document->getElement('a:buAutoNum', $oSubElement);
405
- if ($oElement_buAutoNum ) {
404
+ /*$oElementBuAutoNum = $document->getElement('a:buAutoNum', $oSubElement);
405
+ if ($oElementBuAutoNum ) {
406
406
$oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NUMERIC);
407
- if ($oElement_buAutoNum ->hasAttribute('type')) {
408
- $oParagraph->getBulletStyle()->setBulletNumericStyle($oElement_buAutoNum ->getAttribute('type'));
407
+ if ($oElementBuAutoNum ->hasAttribute('type')) {
408
+ $oParagraph->getBulletStyle()->setBulletNumericStyle($oElementBuAutoNum ->getAttribute('type'));
409
409
}
410
- if ($oElement_buAutoNum ->hasAttribute('startAt') && $oElement_buAutoNum ->getAttribute('startAt') != 1) {
411
- $oParagraph->getBulletStyle()->setBulletNumericStartAt($oElement_buAutoNum ->getAttribute('startAt'));
410
+ if ($oElementBuAutoNum ->hasAttribute('startAt') && $oElementBuAutoNum ->getAttribute('startAt') != 1) {
411
+ $oParagraph->getBulletStyle()->setBulletNumericStartAt($oElementBuAutoNum ->getAttribute('startAt'));
412
412
}
413
413
}*/
414
414
}
415
415
$ arraySubElements = $ document ->getElements ('(a:r|a:br) ' , $ oElement );
416
416
foreach ($ arraySubElements as $ oSubElement ) {
417
- if ($ oSubElement ->tagName == 'a:br ' ) {
417
+ if ($ oSubElement ->tagName == 'a:br ' ) {
418
418
$ oParagraph ->createBreak ();
419
419
}
420
- if ($ oSubElement ->tagName == 'a:r ' ) {
421
- $ oElement_rPr = $ document ->getElement ('a:rPr ' , $ oSubElement );
422
- if (is_object ($ oElement_rPr )) {
420
+ if ($ oSubElement ->tagName == 'a:r ' ) {
421
+ $ oElementrPr = $ document ->getElement ('a:rPr ' , $ oSubElement );
422
+ if (is_object ($ oElementrPr )) {
423
423
$ oText = $ oParagraph ->createTextRun ();
424
424
425
- if ($ oElement_rPr ->hasAttribute ('b ' )) {
426
- $ oText ->getFont ()->setBold ($ oElement_rPr ->getAttribute ('b ' ) == 'true ' ? true : false );
425
+ if ($ oElementrPr ->hasAttribute ('b ' )) {
426
+ $ oText ->getFont ()->setBold ($ oElementrPr ->getAttribute ('b ' ) == 'true ' ? true : false );
427
427
}
428
- if ($ oElement_rPr ->hasAttribute ('i ' )) {
429
- $ oText ->getFont ()->setItalic ($ oElement_rPr ->getAttribute ('i ' ) == 'true ' ? true : false );
428
+ if ($ oElementrPr ->hasAttribute ('i ' )) {
429
+ $ oText ->getFont ()->setItalic ($ oElementrPr ->getAttribute ('i ' ) == 'true ' ? true : false );
430
430
}
431
- if ($ oElement_rPr ->hasAttribute ('strike ' )) {
432
- $ oText ->getFont ()->setStrikethrough ($ oElement_rPr ->getAttribute ('strike ' ) == 'noStrike ' ? false : true );
431
+ if ($ oElementrPr ->hasAttribute ('strike ' )) {
432
+ $ oText ->getFont ()->setStrikethrough ($ oElementrPr ->getAttribute ('strike ' ) == 'noStrike ' ? false : true );
433
433
}
434
- if ($ oElement_rPr ->hasAttribute ('sz ' )) {
435
- $ oText ->getFont ()->setSize ((int )($ oElement_rPr ->getAttribute ('sz ' ) / 100 ));
434
+ if ($ oElementrPr ->hasAttribute ('sz ' )) {
435
+ $ oText ->getFont ()->setSize ((int )($ oElementrPr ->getAttribute ('sz ' ) / 100 ));
436
436
}
437
- if ($ oElement_rPr ->hasAttribute ('u ' )) {
438
- $ oText ->getFont ()->setUnderline ($ oElement_rPr ->getAttribute ('u ' ));
437
+ if ($ oElementrPr ->hasAttribute ('u ' )) {
438
+ $ oText ->getFont ()->setUnderline ($ oElementrPr ->getAttribute ('u ' ));
439
439
}
440
440
// Color
441
- $ oElement_srgbClr = $ document ->getElement ('a:solidFill/a:srgbClr ' , $ oElement_rPr );
442
- if (is_object ($ oElement_srgbClr ) && $ oElement_srgbClr ->hasAttribute ('val ' )) {
441
+ $ oElementSrgbClr = $ document ->getElement ('a:solidFill/a:srgbClr ' , $ oElementrPr );
442
+ if (is_object ($ oElementSrgbClr ) && $ oElementSrgbClr ->hasAttribute ('val ' )) {
443
443
$ oColor = new Color ();
444
- $ oColor ->setRGB ($ oElement_srgbClr ->getAttribute ('val ' ));
444
+ $ oColor ->setRGB ($ oElementSrgbClr ->getAttribute ('val ' ));
445
445
$ oText ->getFont ()->setColor ($ oColor );
446
446
}
447
447
// Hyperlink
448
- $ oElement_hlinkClick = $ document ->getElement ('a:hlinkClick ' , $ oElement_rPr );
449
- if (is_object ($ oElement_hlinkClick )) {
450
- if ($ oElement_hlinkClick ->hasAttribute ('tooltip ' )) {
451
- $ oText ->getHyperlink ()->setTooltip ($ oElement_hlinkClick ->getAttribute ('tooltip ' ));
448
+ $ oElementHlinkClick = $ document ->getElement ('a:hlinkClick ' , $ oElementrPr );
449
+ if (is_object ($ oElementHlinkClick )) {
450
+ if ($ oElementHlinkClick ->hasAttribute ('tooltip ' )) {
451
+ $ oText ->getHyperlink ()->setTooltip ($ oElementHlinkClick ->getAttribute ('tooltip ' ));
452
452
}
453
- if ($ oElement_hlinkClick ->hasAttribute ('r:id ' ) && isset ($ this ->arrayRels [$ fileRels ][$ oElement_hlinkClick ->getAttribute ('r:id ' )])) {
454
- $ oText ->getHyperlink ()->setUrl ($ this ->arrayRels [$ fileRels ][$ oElement_hlinkClick ->getAttribute ('r:id ' )]);
453
+ if ($ oElementHlinkClick ->hasAttribute ('r:id ' ) && isset ($ this ->arrayRels [$ fileRels ][$ oElementHlinkClick ->getAttribute ('r:id ' )])) {
454
+ $ oText ->getHyperlink ()->setUrl ($ this ->arrayRels [$ fileRels ][$ oElementHlinkClick ->getAttribute ('r:id ' )]);
455
455
}
456
456
}
457
457
} else {
@@ -461,7 +461,7 @@ protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $ba
461
461
$ oSubSubElement = $ document ->getElement ('a:t ' , $ oSubElement );
462
462
$ oText ->setText ($ oSubSubElement ->nodeValue );
463
463
}
464
- }
464
+ }
465
465
}
466
466
467
467
if (count ($ oShape ->getParagraphs ()) > 0 ) {
@@ -470,14 +470,14 @@ protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $ba
470
470
}
471
471
472
472
/**
473
- *
473
+ *
474
474
* @param string $rId
475
475
* @return string
476
476
*/
477
477
protected function loadRels ($ fileRels )
478
478
{
479
479
$ sPart = $ this ->oZip ->getFromName ($ fileRels );
480
- if ($ sPart !== false ) {
480
+ if ($ sPart !== false ) {
481
481
$ xmlReader = new XMLReader ();
482
482
if ($ xmlReader ->getDomFromString ($ sPart )) {
483
483
foreach ($ xmlReader ->getElements ('* ' ) as $ oNode ) {
0 commit comments