Skip to content

Commit d7bbf5c

Browse files
authored
Merge pull request #230 from Progi1984/issue161
#161 : PowerPoint2007 : Read/Write SlideLayout
2 parents 136bd35 + 701727b commit d7bbf5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4533
-924
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
- ODPresentation & PowerPoint2007 Writer : Add Font Support For Chart Axis - @jrking4 GH-186
2828
- ODPresentation & PowerPoint2007 Writer : Support for video - @Progi1984 GH-123
2929
- ODPresentation & PowerPoint2007 Writer : Support for Visibility for slides - @Progi1984
30+
- PowerPoint2007 Reader : Layout Management - @vincentKool @Progi1984 GH-161
3031
- PowerPoint2007 Writer : Presentation with predefined View Type - @Progi1984 GH-120
3132
- PowerPoint2007 Writer : Implement alpha channel to Fills - @Dayjo GH-203 / @Progi1984 GH-215
3233
- PowerPoint2007 Writer : Implement Animations - @JewrassicPark GH-214 / @Progi1984 GH-217
34+
- PowerPoint2007 Writer : Layout Management - @vincentKool @Progi1984 GH-161
3335

3436
## 0.6.0 - 2016-01-24
3537

docs/credits.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
Credits
44
=======
55

6-
Images from chart page come from the `LibreOffice Core <https://github.com/LibreOffice/core/tree/master/icon-themes/galaxy/chart2/res>`.
6+
Images from chart page come from the `LibreOffice Core <https://github.com/LibreOffice/core/tree/master/icon-themes/galaxy/chart2/res>`.
7+
8+
Some definitions come from the `Office Open XML <http://officeopenxml.com/>`.

docs/slides_layout.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.. _slides_layout:
2+
3+
Slides Layout
4+
=============
5+
6+
A slide is a hierarchy of three components :
7+
- The master slide upon which the slide is based : it specifies such properties as the font styles for the title, body, and footer, placeholder positions for text and objects, bullets styles, and background ;
8+
- The slide layout which is applied to the the slide : it permits to override what is specified in the master slide ;
9+
- The slide itself : it contains content and formatting that is not already specified by the master slide and the slide layout
10+
11+
Placeholders permit to link these three components together in order that the override is possible.
12+
13+
Master slides
14+
-------------
15+
16+
You can access to all master slides with the method ``getAllMasterSlides`` or create one with ``createMasterSlide``.
17+
18+
.. code-block:: php
19+
20+
$arraySlideMasters = $oPHPPresentation->getAllMasterSlides();
21+
$oMasterSlide = $oPHPPresentation->createMasterSlide();
22+
23+
Slides Layout
24+
-------------
25+
26+
You can access to all slide layout from a master with the method ``getAllSlideLayouts`` or create one with ``createSlideLayout``.
27+
28+
.. code-block:: php
29+
30+
$arraySlideLayouts = $oMasterSlide->getAllSlideLayouts();
31+
$oSlideLayout = $oMasterSlide->createSlideLayout();
32+
33+
Placeholders
34+
------------
35+
36+
For each master slide or slide layout, you can add any shape like on a slide.
37+
38+
.. code-block:: php
39+
40+
$oShape = $oMasterSlide->createChartShape();
41+
$oShape = $oSlideLayout->createTableShape();
42+
43+
You can define a shape as a placeholder for each level with the method ``setPlaceHolder``.
44+
A shape defined in each level will have an override for its formatting in each level.
45+
46+
.. code-block:: php
47+
48+
use PhpOffice\PhpPresentation\Shape\Placeholder;
49+
$oShape->setPlaceHolder(new Placeholder(Placeholder::PH_TYPE_TITLE));
50+

phpmd.xml.dist

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
<rule ref="rulesets/design.xml/DepthOfInheritance" />
1919
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
2020
<!-- PptSlides needs more coupling (default: 13) -->
21-
<properties>
22-
<property name="minimum" value="30" />
21+
<!-- Writer/Office2007/AbstractSlide needs more coupling (default: 13) -->
22+
<properties>
23+
<property name="minimum" value="31" />
2324
</properties>
2425
</rule>
2526
<rule ref="rulesets/design.xml/NumberOfChildren">

samples/Sample_01_Complex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
// Set properties
1717
echo date('H:i:s') . ' Set properties'.EOL;
18-
$objPHPPresentation->getProperties()->setCreator('PHPOffice')
18+
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')
1919
->setLastModifiedBy('PHPPresentation Team')
2020
->setTitle('Sample 02 Title')
2121
->setSubject('Sample 02 Subject')

samples/Sample_02_Serialized.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// Set properties
1515
echo date('H:i:s') . ' Set properties'.EOL;
16-
$objPHPPresentation->getProperties()->setCreator('PHPOffice')
16+
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')
1717
->setLastModifiedBy('PHPPresentation Team')
1818
->setTitle('Sample 03 Title')
1919
->setSubject('Sample 03 Subject')

samples/Sample_04_Table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// Set properties
1515
echo date('H:i:s') . ' Set properties'.EOL;
16-
$objPHPPresentation->getProperties()->setCreator('PHPOffice')
16+
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')
1717
->setLastModifiedBy('PHPPresentation Team')
1818
->setTitle('Sample 06 Title')
1919
->setSubject('Sample 06 Subject')

samples/Sample_05_Chart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ function fnSlide_Scatter(PhpPresentation $objPHPPresentation) {
526526

527527
// Set properties
528528
echo date('H:i:s') . ' Set properties'.EOL;
529-
$objPHPPresentation->getProperties()->setCreator('PHPOffice')
529+
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')
530530
->setLastModifiedBy('PHPPresentation Team')
531531
->setTitle('Sample 07 Title')
532532
->setSubject('Sample 07 Subject')

samples/Sample_05_Chart_with_PHPExcel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
// Set properties
2121
echo date('H:i:s') . ' Set properties'.EOL;
22-
$objPHPPresentation->getProperties()->setCreator('PHPOffice')
22+
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')
2323
->setLastModifiedBy('PHPPresentation Team')
2424
->setTitle('Sample 08 Title')
2525
->setSubject('Sample 08 Subject')

samples/Sample_06_Fill.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// Set properties
1515
echo date('H:i:s') . ' Set properties'.EOL;
16-
$objPHPPresentation->getProperties()->setCreator('PHPOffice')
16+
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')
1717
->setLastModifiedBy('PHPPresentation Team')
1818
->setTitle('Sample 01 Title')
1919
->setSubject('Sample 01 Subject')

0 commit comments

Comments
 (0)