Subversion Repositories eFlore/Applications.cel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2388 jpm 1
<?php
2
/**
3
 * PHPExcel
4
 *
5
 * Copyright (c) 2006 - 2013 PHPExcel
6
 *
7
 * This library is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
12
 * This library is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with this library; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20
 *
21
 * @category   PHPExcel
22
 * @package    PHPExcel_Writer_Excel2007
23
 * @copyright  Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
24
 * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
25
 * @version    ##VERSION##, ##DATE##
26
 */
27
 
28
 
29
/**
30
 * PHPExcel_Writer_Excel2007_Theme
31
 *
32
 * @category   PHPExcel
33
 * @package    PHPExcel_Writer_Excel2007
34
 * @copyright  Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
35
 */
36
class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPart
37
{
38
	/**
39
	 * Map of Major fonts to write
40
	 * @static	array of string
41
	 *
42
	 */
43
	private static $_majorFonts = array(
44
					'Jpan' => 'MS Pゴシック',
45
					'Hang' => '맑은 고딕',
46
					'Hans' => '宋体',
47
					'Hant' => '新細明體',
48
					'Arab' => 'Times New Roman',
49
					'Hebr' => 'Times New Roman',
50
					'Thai' => 'Tahoma',
51
					'Ethi' => 'Nyala',
52
					'Beng' => 'Vrinda',
53
					'Gujr' => 'Shruti',
54
					'Khmr' => 'MoolBoran',
55
					'Knda' => 'Tunga',
56
					'Guru' => 'Raavi',
57
					'Cans' => 'Euphemia',
58
					'Cher' => 'Plantagenet Cherokee',
59
					'Yiii' => 'Microsoft Yi Baiti',
60
					'Tibt' => 'Microsoft Himalaya',
61
					'Thaa' => 'MV Boli',
62
					'Deva' => 'Mangal',
63
					'Telu' => 'Gautami',
64
					'Taml' => 'Latha',
65
					'Syrc' => 'Estrangelo Edessa',
66
					'Orya' => 'Kalinga',
67
					'Mlym' => 'Kartika',
68
					'Laoo' => 'DokChampa',
69
					'Sinh' => 'Iskoola Pota',
70
					'Mong' => 'Mongolian Baiti',
71
					'Viet' => 'Times New Roman',
72
					'Uigh' => 'Microsoft Uighur',
73
					'Geor' => 'Sylfaen',
74
			);
75
 
76
	/**
77
	 * Map of Minor fonts to write
78
	 * @static	array of string
79
	 *
80
	 */
81
	private static $_minorFonts = array(
82
					'Jpan' => 'MS Pゴシック',
83
					'Hang' => '맑은 고딕',
84
					'Hans' => '宋体',
85
					'Hant' => '新細明體',
86
					'Arab' => 'Arial',
87
					'Hebr' => 'Arial',
88
					'Thai' => 'Tahoma',
89
					'Ethi' => 'Nyala',
90
					'Beng' => 'Vrinda',
91
					'Gujr' => 'Shruti',
92
					'Khmr' => 'DaunPenh',
93
					'Knda' => 'Tunga',
94
					'Guru' => 'Raavi',
95
					'Cans' => 'Euphemia',
96
					'Cher' => 'Plantagenet Cherokee',
97
					'Yiii' => 'Microsoft Yi Baiti',
98
					'Tibt' => 'Microsoft Himalaya',
99
					'Thaa' => 'MV Boli',
100
					'Deva' => 'Mangal',
101
					'Telu' => 'Gautami',
102
					'Taml' => 'Latha',
103
					'Syrc' => 'Estrangelo Edessa',
104
					'Orya' => 'Kalinga',
105
					'Mlym' => 'Kartika',
106
					'Laoo' => 'DokChampa',
107
					'Sinh' => 'Iskoola Pota',
108
					'Mong' => 'Mongolian Baiti',
109
					'Viet' => 'Arial',
110
					'Uigh' => 'Microsoft Uighur',
111
					'Geor' => 'Sylfaen',
112
			);
113
 
114
	/**
115
	 * Map of core colours
116
	 * @static	array of string
117
	 *
118
	 */
119
		private static $_colourScheme = array(
120
					'dk2'		=> '1F497D',
121
					'lt2'		=> 'EEECE1',
122
					'accent1'	=> '4F81BD',
123
					'accent2'	=> 'C0504D',
124
					'accent3'	=> '9BBB59',
125
					'accent4'	=> '8064A2',
126
					'accent5'	=> '4BACC6',
127
					'accent6'	=> 'F79646',
128
					'hlink'		=> '0000FF',
129
					'folHlink'	=> '800080',
130
			);
131
 
132
	/**
133
	 * Write theme to XML format
134
	 *
135
	 * @param 	PHPExcel	$pPHPExcel
136
	 * @return 	string 		XML Output
137
	 * @throws 	PHPExcel_Writer_Exception
138
	 */
139
	public function writeTheme(PHPExcel $pPHPExcel = null)
140
	{
141
			// Create XML writer
142
			$objWriter = null;
143
			if ($this->getParentWriter()->getUseDiskCaching()) {
144
				$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
145
			} else {
146
				$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
147
			}
148
 
149
			// XML header
150
			$objWriter->startDocument('1.0','UTF-8','yes');
151
 
152
			// a:theme
153
			$objWriter->startElement('a:theme');
154
			$objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
155
			$objWriter->writeAttribute('name', 'Office Theme');
156
 
157
				// a:themeElements
158
				$objWriter->startElement('a:themeElements');
159
 
160
					// a:clrScheme
161
					$objWriter->startElement('a:clrScheme');
162
					$objWriter->writeAttribute('name', 'Office');
163
 
164
						// a:dk1
165
						$objWriter->startElement('a:dk1');
166
 
167
							// a:sysClr
168
							$objWriter->startElement('a:sysClr');
169
							$objWriter->writeAttribute('val', 'windowText');
170
							$objWriter->writeAttribute('lastClr', '000000');
171
							$objWriter->endElement();
172
 
173
						$objWriter->endElement();
174
 
175
						// a:lt1
176
						$objWriter->startElement('a:lt1');
177
 
178
							// a:sysClr
179
							$objWriter->startElement('a:sysClr');
180
							$objWriter->writeAttribute('val', 'window');
181
							$objWriter->writeAttribute('lastClr', 'FFFFFF');
182
							$objWriter->endElement();
183
 
184
						$objWriter->endElement();
185
 
186
						// a:dk2
187
						$this->_writeColourScheme($objWriter);
188
 
189
					$objWriter->endElement();
190
 
191
					// a:fontScheme
192
					$objWriter->startElement('a:fontScheme');
193
					$objWriter->writeAttribute('name', 'Office');
194
 
195
						// a:majorFont
196
						$objWriter->startElement('a:majorFont');
197
							$this->_writeFonts($objWriter, 'Cambria', self::$_majorFonts);
198
						$objWriter->endElement();
199
 
200
						// a:minorFont
201
						$objWriter->startElement('a:minorFont');
202
							$this->_writeFonts($objWriter, 'Calibri', self::$_minorFonts);
203
						$objWriter->endElement();
204
 
205
					$objWriter->endElement();
206
 
207
					// a:fmtScheme
208
					$objWriter->startElement('a:fmtScheme');
209
					$objWriter->writeAttribute('name', 'Office');
210
 
211
						// a:fillStyleLst
212
						$objWriter->startElement('a:fillStyleLst');
213
 
214
							// a:solidFill
215
							$objWriter->startElement('a:solidFill');
216
 
217
								// a:schemeClr
218
								$objWriter->startElement('a:schemeClr');
219
								$objWriter->writeAttribute('val', 'phClr');
220
								$objWriter->endElement();
221
 
222
							$objWriter->endElement();
223
 
224
							// a:gradFill
225
							$objWriter->startElement('a:gradFill');
226
							$objWriter->writeAttribute('rotWithShape', '1');
227
 
228
								// a:gsLst
229
								$objWriter->startElement('a:gsLst');
230
 
231
									// a:gs
232
									$objWriter->startElement('a:gs');
233
									$objWriter->writeAttribute('pos', '0');
234
 
235
										// a:schemeClr
236
										$objWriter->startElement('a:schemeClr');
237
										$objWriter->writeAttribute('val', 'phClr');
238
 
239
											// a:tint
240
											$objWriter->startElement('a:tint');
241
											$objWriter->writeAttribute('val', '50000');
242
											$objWriter->endElement();
243
 
244
											// a:satMod
245
											$objWriter->startElement('a:satMod');
246
											$objWriter->writeAttribute('val', '300000');
247
											$objWriter->endElement();
248
 
249
										$objWriter->endElement();
250
 
251
									$objWriter->endElement();
252
 
253
									// a:gs
254
									$objWriter->startElement('a:gs');
255
									$objWriter->writeAttribute('pos', '35000');
256
 
257
										// a:schemeClr
258
										$objWriter->startElement('a:schemeClr');
259
										$objWriter->writeAttribute('val', 'phClr');
260
 
261
											// a:tint
262
											$objWriter->startElement('a:tint');
263
											$objWriter->writeAttribute('val', '37000');
264
											$objWriter->endElement();
265
 
266
											// a:satMod
267
											$objWriter->startElement('a:satMod');
268
											$objWriter->writeAttribute('val', '300000');
269
											$objWriter->endElement();
270
 
271
										$objWriter->endElement();
272
 
273
									$objWriter->endElement();
274
 
275
									// a:gs
276
									$objWriter->startElement('a:gs');
277
									$objWriter->writeAttribute('pos', '100000');
278
 
279
										// a:schemeClr
280
										$objWriter->startElement('a:schemeClr');
281
										$objWriter->writeAttribute('val', 'phClr');
282
 
283
											// a:tint
284
											$objWriter->startElement('a:tint');
285
											$objWriter->writeAttribute('val', '15000');
286
											$objWriter->endElement();
287
 
288
											// a:satMod
289
											$objWriter->startElement('a:satMod');
290
											$objWriter->writeAttribute('val', '350000');
291
											$objWriter->endElement();
292
 
293
										$objWriter->endElement();
294
 
295
									$objWriter->endElement();
296
 
297
								$objWriter->endElement();
298
 
299
								// a:lin
300
								$objWriter->startElement('a:lin');
301
								$objWriter->writeAttribute('ang', '16200000');
302
								$objWriter->writeAttribute('scaled', '1');
303
								$objWriter->endElement();
304
 
305
							$objWriter->endElement();
306
 
307
							// a:gradFill
308
							$objWriter->startElement('a:gradFill');
309
							$objWriter->writeAttribute('rotWithShape', '1');
310
 
311
								// a:gsLst
312
								$objWriter->startElement('a:gsLst');
313
 
314
									// a:gs
315
									$objWriter->startElement('a:gs');
316
									$objWriter->writeAttribute('pos', '0');
317
 
318
										// a:schemeClr
319
										$objWriter->startElement('a:schemeClr');
320
										$objWriter->writeAttribute('val', 'phClr');
321
 
322
											// a:shade
323
											$objWriter->startElement('a:shade');
324
											$objWriter->writeAttribute('val', '51000');
325
											$objWriter->endElement();
326
 
327
											// a:satMod
328
											$objWriter->startElement('a:satMod');
329
											$objWriter->writeAttribute('val', '130000');
330
											$objWriter->endElement();
331
 
332
										$objWriter->endElement();
333
 
334
									$objWriter->endElement();
335
 
336
									// a:gs
337
									$objWriter->startElement('a:gs');
338
									$objWriter->writeAttribute('pos', '80000');
339
 
340
										// a:schemeClr
341
										$objWriter->startElement('a:schemeClr');
342
										$objWriter->writeAttribute('val', 'phClr');
343
 
344
											// a:shade
345
											$objWriter->startElement('a:shade');
346
											$objWriter->writeAttribute('val', '93000');
347
											$objWriter->endElement();
348
 
349
											// a:satMod
350
											$objWriter->startElement('a:satMod');
351
											$objWriter->writeAttribute('val', '130000');
352
											$objWriter->endElement();
353
 
354
										$objWriter->endElement();
355
 
356
									$objWriter->endElement();
357
 
358
									// a:gs
359
									$objWriter->startElement('a:gs');
360
									$objWriter->writeAttribute('pos', '100000');
361
 
362
										// a:schemeClr
363
										$objWriter->startElement('a:schemeClr');
364
										$objWriter->writeAttribute('val', 'phClr');
365
 
366
											// a:shade
367
											$objWriter->startElement('a:shade');
368
											$objWriter->writeAttribute('val', '94000');
369
											$objWriter->endElement();
370
 
371
											// a:satMod
372
											$objWriter->startElement('a:satMod');
373
											$objWriter->writeAttribute('val', '135000');
374
											$objWriter->endElement();
375
 
376
										$objWriter->endElement();
377
 
378
									$objWriter->endElement();
379
 
380
								$objWriter->endElement();
381
 
382
								// a:lin
383
								$objWriter->startElement('a:lin');
384
								$objWriter->writeAttribute('ang', '16200000');
385
								$objWriter->writeAttribute('scaled', '0');
386
								$objWriter->endElement();
387
 
388
							$objWriter->endElement();
389
 
390
						$objWriter->endElement();
391
 
392
						// a:lnStyleLst
393
						$objWriter->startElement('a:lnStyleLst');
394
 
395
							// a:ln
396
							$objWriter->startElement('a:ln');
397
							$objWriter->writeAttribute('w', '9525');
398
							$objWriter->writeAttribute('cap', 'flat');
399
							$objWriter->writeAttribute('cmpd', 'sng');
400
							$objWriter->writeAttribute('algn', 'ctr');
401
 
402
								// a:solidFill
403
								$objWriter->startElement('a:solidFill');
404
 
405
									// a:schemeClr
406
									$objWriter->startElement('a:schemeClr');
407
									$objWriter->writeAttribute('val', 'phClr');
408
 
409
											// a:shade
410
											$objWriter->startElement('a:shade');
411
											$objWriter->writeAttribute('val', '95000');
412
											$objWriter->endElement();
413
 
414
											// a:satMod
415
											$objWriter->startElement('a:satMod');
416
											$objWriter->writeAttribute('val', '105000');
417
											$objWriter->endElement();
418
 
419
									$objWriter->endElement();
420
 
421
								$objWriter->endElement();
422
 
423
								// a:prstDash
424
								$objWriter->startElement('a:prstDash');
425
								$objWriter->writeAttribute('val', 'solid');
426
								$objWriter->endElement();
427
 
428
							$objWriter->endElement();
429
 
430
							// a:ln
431
							$objWriter->startElement('a:ln');
432
							$objWriter->writeAttribute('w', '25400');
433
							$objWriter->writeAttribute('cap', 'flat');
434
							$objWriter->writeAttribute('cmpd', 'sng');
435
							$objWriter->writeAttribute('algn', 'ctr');
436
 
437
								// a:solidFill
438
								$objWriter->startElement('a:solidFill');
439
 
440
									// a:schemeClr
441
									$objWriter->startElement('a:schemeClr');
442
									$objWriter->writeAttribute('val', 'phClr');
443
									$objWriter->endElement();
444
 
445
								$objWriter->endElement();
446
 
447
								// a:prstDash
448
								$objWriter->startElement('a:prstDash');
449
								$objWriter->writeAttribute('val', 'solid');
450
								$objWriter->endElement();
451
 
452
							$objWriter->endElement();
453
 
454
							// a:ln
455
							$objWriter->startElement('a:ln');
456
							$objWriter->writeAttribute('w', '38100');
457
							$objWriter->writeAttribute('cap', 'flat');
458
							$objWriter->writeAttribute('cmpd', 'sng');
459
							$objWriter->writeAttribute('algn', 'ctr');
460
 
461
								// a:solidFill
462
								$objWriter->startElement('a:solidFill');
463
 
464
									// a:schemeClr
465
									$objWriter->startElement('a:schemeClr');
466
									$objWriter->writeAttribute('val', 'phClr');
467
									$objWriter->endElement();
468
 
469
								$objWriter->endElement();
470
 
471
								// a:prstDash
472
								$objWriter->startElement('a:prstDash');
473
								$objWriter->writeAttribute('val', 'solid');
474
								$objWriter->endElement();
475
 
476
							$objWriter->endElement();
477
 
478
						$objWriter->endElement();
479
 
480
 
481
 
482
						// a:effectStyleLst
483
						$objWriter->startElement('a:effectStyleLst');
484
 
485
							// a:effectStyle
486
							$objWriter->startElement('a:effectStyle');
487
 
488
								// a:effectLst
489
								$objWriter->startElement('a:effectLst');
490
 
491
									// a:outerShdw
492
									$objWriter->startElement('a:outerShdw');
493
									$objWriter->writeAttribute('blurRad', '40000');
494
									$objWriter->writeAttribute('dist', '20000');
495
									$objWriter->writeAttribute('dir', '5400000');
496
									$objWriter->writeAttribute('rotWithShape', '0');
497
 
498
										// a:srgbClr
499
										$objWriter->startElement('a:srgbClr');
500
										$objWriter->writeAttribute('val', '000000');
501
 
502
											// a:alpha
503
											$objWriter->startElement('a:alpha');
504
											$objWriter->writeAttribute('val', '38000');
505
											$objWriter->endElement();
506
 
507
										$objWriter->endElement();
508
 
509
									$objWriter->endElement();
510
 
511
								$objWriter->endElement();
512
 
513
							$objWriter->endElement();
514
 
515
							// a:effectStyle
516
							$objWriter->startElement('a:effectStyle');
517
 
518
								// a:effectLst
519
								$objWriter->startElement('a:effectLst');
520
 
521
									// a:outerShdw
522
									$objWriter->startElement('a:outerShdw');
523
									$objWriter->writeAttribute('blurRad', '40000');
524
									$objWriter->writeAttribute('dist', '23000');
525
									$objWriter->writeAttribute('dir', '5400000');
526
									$objWriter->writeAttribute('rotWithShape', '0');
527
 
528
										// a:srgbClr
529
										$objWriter->startElement('a:srgbClr');
530
										$objWriter->writeAttribute('val', '000000');
531
 
532
											// a:alpha
533
											$objWriter->startElement('a:alpha');
534
											$objWriter->writeAttribute('val', '35000');
535
											$objWriter->endElement();
536
 
537
										$objWriter->endElement();
538
 
539
									$objWriter->endElement();
540
 
541
								$objWriter->endElement();
542
 
543
							$objWriter->endElement();
544
 
545
							// a:effectStyle
546
							$objWriter->startElement('a:effectStyle');
547
 
548
								// a:effectLst
549
								$objWriter->startElement('a:effectLst');
550
 
551
									// a:outerShdw
552
									$objWriter->startElement('a:outerShdw');
553
									$objWriter->writeAttribute('blurRad', '40000');
554
									$objWriter->writeAttribute('dist', '23000');
555
									$objWriter->writeAttribute('dir', '5400000');
556
									$objWriter->writeAttribute('rotWithShape', '0');
557
 
558
										// a:srgbClr
559
										$objWriter->startElement('a:srgbClr');
560
										$objWriter->writeAttribute('val', '000000');
561
 
562
											// a:alpha
563
											$objWriter->startElement('a:alpha');
564
											$objWriter->writeAttribute('val', '35000');
565
											$objWriter->endElement();
566
 
567
										$objWriter->endElement();
568
 
569
									$objWriter->endElement();
570
 
571
								$objWriter->endElement();
572
 
573
								// a:scene3d
574
								$objWriter->startElement('a:scene3d');
575
 
576
									// a:camera
577
									$objWriter->startElement('a:camera');
578
									$objWriter->writeAttribute('prst', 'orthographicFront');
579
 
580
										// a:rot
581
										$objWriter->startElement('a:rot');
582
										$objWriter->writeAttribute('lat', '0');
583
										$objWriter->writeAttribute('lon', '0');
584
										$objWriter->writeAttribute('rev', '0');
585
										$objWriter->endElement();
586
 
587
									$objWriter->endElement();
588
 
589
									// a:lightRig
590
									$objWriter->startElement('a:lightRig');
591
									$objWriter->writeAttribute('rig', 'threePt');
592
									$objWriter->writeAttribute('dir', 't');
593
 
594
										// a:rot
595
										$objWriter->startElement('a:rot');
596
										$objWriter->writeAttribute('lat', '0');
597
										$objWriter->writeAttribute('lon', '0');
598
										$objWriter->writeAttribute('rev', '1200000');
599
										$objWriter->endElement();
600
 
601
									$objWriter->endElement();
602
 
603
								$objWriter->endElement();
604
 
605
								// a:sp3d
606
								$objWriter->startElement('a:sp3d');
607
 
608
									// a:bevelT
609
									$objWriter->startElement('a:bevelT');
610
									$objWriter->writeAttribute('w', '63500');
611
									$objWriter->writeAttribute('h', '25400');
612
									$objWriter->endElement();
613
 
614
								$objWriter->endElement();
615
 
616
							$objWriter->endElement();
617
 
618
						$objWriter->endElement();
619
 
620
						// a:bgFillStyleLst
621
						$objWriter->startElement('a:bgFillStyleLst');
622
 
623
							// a:solidFill
624
							$objWriter->startElement('a:solidFill');
625
 
626
								// a:schemeClr
627
								$objWriter->startElement('a:schemeClr');
628
								$objWriter->writeAttribute('val', 'phClr');
629
								$objWriter->endElement();
630
 
631
							$objWriter->endElement();
632
 
633
							// a:gradFill
634
							$objWriter->startElement('a:gradFill');
635
							$objWriter->writeAttribute('rotWithShape', '1');
636
 
637
								// a:gsLst
638
								$objWriter->startElement('a:gsLst');
639
 
640
									// a:gs
641
									$objWriter->startElement('a:gs');
642
									$objWriter->writeAttribute('pos', '0');
643
 
644
										// a:schemeClr
645
										$objWriter->startElement('a:schemeClr');
646
										$objWriter->writeAttribute('val', 'phClr');
647
 
648
											// a:tint
649
											$objWriter->startElement('a:tint');
650
											$objWriter->writeAttribute('val', '40000');
651
											$objWriter->endElement();
652
 
653
											// a:satMod
654
											$objWriter->startElement('a:satMod');
655
											$objWriter->writeAttribute('val', '350000');
656
											$objWriter->endElement();
657
 
658
										$objWriter->endElement();
659
 
660
									$objWriter->endElement();
661
 
662
									// a:gs
663
									$objWriter->startElement('a:gs');
664
									$objWriter->writeAttribute('pos', '40000');
665
 
666
										// a:schemeClr
667
										$objWriter->startElement('a:schemeClr');
668
										$objWriter->writeAttribute('val', 'phClr');
669
 
670
											// a:tint
671
											$objWriter->startElement('a:tint');
672
											$objWriter->writeAttribute('val', '45000');
673
											$objWriter->endElement();
674
 
675
											// a:shade
676
											$objWriter->startElement('a:shade');
677
											$objWriter->writeAttribute('val', '99000');
678
											$objWriter->endElement();
679
 
680
											// a:satMod
681
											$objWriter->startElement('a:satMod');
682
											$objWriter->writeAttribute('val', '350000');
683
											$objWriter->endElement();
684
 
685
										$objWriter->endElement();
686
 
687
									$objWriter->endElement();
688
 
689
									// a:gs
690
									$objWriter->startElement('a:gs');
691
									$objWriter->writeAttribute('pos', '100000');
692
 
693
										// a:schemeClr
694
										$objWriter->startElement('a:schemeClr');
695
										$objWriter->writeAttribute('val', 'phClr');
696
 
697
											// a:shade
698
											$objWriter->startElement('a:shade');
699
											$objWriter->writeAttribute('val', '20000');
700
											$objWriter->endElement();
701
 
702
											// a:satMod
703
											$objWriter->startElement('a:satMod');
704
											$objWriter->writeAttribute('val', '255000');
705
											$objWriter->endElement();
706
 
707
										$objWriter->endElement();
708
 
709
									$objWriter->endElement();
710
 
711
								$objWriter->endElement();
712
 
713
								// a:path
714
								$objWriter->startElement('a:path');
715
								$objWriter->writeAttribute('path', 'circle');
716
 
717
									// a:fillToRect
718
									$objWriter->startElement('a:fillToRect');
719
									$objWriter->writeAttribute('l', '50000');
720
									$objWriter->writeAttribute('t', '-80000');
721
									$objWriter->writeAttribute('r', '50000');
722
									$objWriter->writeAttribute('b', '180000');
723
									$objWriter->endElement();
724
 
725
								$objWriter->endElement();
726
 
727
							$objWriter->endElement();
728
 
729
							// a:gradFill
730
							$objWriter->startElement('a:gradFill');
731
							$objWriter->writeAttribute('rotWithShape', '1');
732
 
733
								// a:gsLst
734
								$objWriter->startElement('a:gsLst');
735
 
736
									// a:gs
737
									$objWriter->startElement('a:gs');
738
									$objWriter->writeAttribute('pos', '0');
739
 
740
										// a:schemeClr
741
										$objWriter->startElement('a:schemeClr');
742
										$objWriter->writeAttribute('val', 'phClr');
743
 
744
											// a:tint
745
											$objWriter->startElement('a:tint');
746
											$objWriter->writeAttribute('val', '80000');
747
											$objWriter->endElement();
748
 
749
											// a:satMod
750
											$objWriter->startElement('a:satMod');
751
											$objWriter->writeAttribute('val', '300000');
752
											$objWriter->endElement();
753
 
754
										$objWriter->endElement();
755
 
756
									$objWriter->endElement();
757
 
758
									// a:gs
759
									$objWriter->startElement('a:gs');
760
									$objWriter->writeAttribute('pos', '100000');
761
 
762
										// a:schemeClr
763
										$objWriter->startElement('a:schemeClr');
764
										$objWriter->writeAttribute('val', 'phClr');
765
 
766
											// a:shade
767
											$objWriter->startElement('a:shade');
768
											$objWriter->writeAttribute('val', '30000');
769
											$objWriter->endElement();
770
 
771
											// a:satMod
772
											$objWriter->startElement('a:satMod');
773
											$objWriter->writeAttribute('val', '200000');
774
											$objWriter->endElement();
775
 
776
										$objWriter->endElement();
777
 
778
									$objWriter->endElement();
779
 
780
								$objWriter->endElement();
781
 
782
								// a:path
783
								$objWriter->startElement('a:path');
784
								$objWriter->writeAttribute('path', 'circle');
785
 
786
									// a:fillToRect
787
									$objWriter->startElement('a:fillToRect');
788
									$objWriter->writeAttribute('l', '50000');
789
									$objWriter->writeAttribute('t', '50000');
790
									$objWriter->writeAttribute('r', '50000');
791
									$objWriter->writeAttribute('b', '50000');
792
									$objWriter->endElement();
793
 
794
								$objWriter->endElement();
795
 
796
							$objWriter->endElement();
797
 
798
						$objWriter->endElement();
799
 
800
					$objWriter->endElement();
801
 
802
				$objWriter->endElement();
803
 
804
				// a:objectDefaults
805
				$objWriter->writeElement('a:objectDefaults', null);
806
 
807
				// a:extraClrSchemeLst
808
				$objWriter->writeElement('a:extraClrSchemeLst', null);
809
 
810
			$objWriter->endElement();
811
 
812
			// Return
813
			return $objWriter->getData();
814
	}
815
 
816
	/**
817
	 * Write fonts to XML format
818
	 *
819
	 * @param 	PHPExcel_Shared_XMLWriter	$objWriter
820
	 * @param 	string						$latinFont
821
	 * @param 	array of string				$fontSet
822
	 * @return 	string 						XML Output
823
	 * @throws 	PHPExcel_Writer_Exception
824
	 */
825
	private function _writeFonts($objWriter, $latinFont, $fontSet)
826
	{
827
		// a:latin
828
		$objWriter->startElement('a:latin');
829
		$objWriter->writeAttribute('typeface', $latinFont);
830
		$objWriter->endElement();
831
 
832
		// a:ea
833
		$objWriter->startElement('a:ea');
834
		$objWriter->writeAttribute('typeface', '');
835
		$objWriter->endElement();
836
 
837
		// a:cs
838
		$objWriter->startElement('a:cs');
839
		$objWriter->writeAttribute('typeface', '');
840
		$objWriter->endElement();
841
 
842
		foreach($fontSet as $fontScript => $typeface) {
843
			$objWriter->startElement('a:font');
844
				$objWriter->writeAttribute('script', $fontScript);
845
				$objWriter->writeAttribute('typeface', $typeface);
846
			$objWriter->endElement();
847
		}
848
 
849
	}
850
 
851
	/**
852
	 * Write colour scheme to XML format
853
	 *
854
	 * @param 	PHPExcel_Shared_XMLWriter	$objWriter
855
	 * @return 	string 						XML Output
856
	 * @throws 	PHPExcel_Writer_Exception
857
	 */
858
	private function _writeColourScheme($objWriter)
859
	{
860
		foreach(self::$_colourScheme as $colourName => $colourValue) {
861
			$objWriter->startElement('a:'.$colourName);
862
 
863
				$objWriter->startElement('a:srgbClr');
864
					$objWriter->writeAttribute('val', $colourValue);
865
				$objWriter->endElement();
866
 
867
			$objWriter->endElement();
868
		}
869
 
870
	}
871
}