Version Description
- Split the basic and premium options into a few sub-sections, to make it easier to find the right option
Download this release
Release Info
Developer | Rustaurius |
Plugin | Ultimate FAQ |
Version | 1.5.21 |
Comparing to | |
See all releases |
Code changes from version 1.5.20 to 1.5.21
- Main.php +1 -1
- PHPExcel/Classes/PHPExcel/Chart/Axis.php +561 -561
- PHPExcel/Classes/PHPExcel/Chart/GridLines.php +472 -472
- PHPExcel/Classes/PHPExcel/Chart/Properties.php +363 -363
- PHPExcel/Classes/PHPExcel/Helper/HTML.php +808 -808
- PHPExcel/Classes/PHPExcel/Reader/Excel5/Color.php +31 -31
- PHPExcel/Classes/PHPExcel/Reader/Excel5/Color/BIFF5.php +76 -76
- PHPExcel/Classes/PHPExcel/Reader/Excel5/Color/BIFF8.php +76 -76
- PHPExcel/Classes/PHPExcel/Reader/Excel5/Color/BuiltIn.php +30 -30
- PHPExcel/Classes/PHPExcel/Reader/Excel5/ErrorCode.php +27 -27
- PHPExcel/Classes/PHPExcel/Reader/Excel5/Style/Border.php +35 -35
- PHPExcel/Classes/PHPExcel/Reader/Excel5/Style/FillPattern.php +40 -40
- PHPExcel/Classes/PHPExcel/Worksheet/Column.php +86 -86
- PHPExcel/Classes/PHPExcel/Worksheet/ColumnCellIterator.php +216 -216
- PHPExcel/Classes/PHPExcel/Worksheet/ColumnIterator.php +201 -201
- PHPExcel/Classes/PHPExcel/Worksheet/Dimension.php +178 -178
- PHPExcel/Classes/PHPExcel/Worksheet/RowCellIterator.php +225 -225
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument.php +190 -190
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Cell/Comment.php +63 -63
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Content.php +272 -272
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Meta.php +95 -95
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/MetaInf.php +87 -87
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Mimetype.php +41 -41
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Settings.php +76 -76
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Styles.php +92 -92
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Thumbnails.php +41 -41
- PHPExcel/Classes/PHPExcel/Writer/OpenDocument/WriterPart.php +30 -30
- PHPExcel/Classes/PHPExcel/locale/bg/config +49 -49
- PHPExcel/Classes/PHPExcel/locale/da/config +1 -1
- css/Admin.css +55 -0
- html/OptionsPage.php +141 -100
- readme.txt +3 -0
Main.php
CHANGED
@@ -7,7 +7,7 @@ Author: Etoile Web Design
|
|
7 |
Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
|
8 |
Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
|
9 |
Text Domain: EWD_UFAQ
|
10 |
-
Version: 1.5.
|
11 |
*/
|
12 |
|
13 |
global $ewd_ufaq_message;
|
7 |
Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
|
8 |
Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
|
9 |
Text Domain: EWD_UFAQ
|
10 |
+
Version: 1.5.21
|
11 |
*/
|
12 |
|
13 |
global $ewd_ufaq_message;
|
PHPExcel/Classes/PHPExcel/Chart/Axis.php
CHANGED
@@ -1,561 +1,561 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Created by PhpStorm.
|
5 |
-
* User: Wiktor Trzonkowski
|
6 |
-
* Date: 6/17/14
|
7 |
-
* Time: 12:11 PM
|
8 |
-
*/
|
9 |
-
|
10 |
-
class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* Axis Number
|
14 |
-
*
|
15 |
-
* @var array of mixed
|
16 |
-
*/
|
17 |
-
private $axisNumber = array(
|
18 |
-
'format' => self::FORMAT_CODE_GENERAL,
|
19 |
-
'source_linked' => 1
|
20 |
-
);
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Axis Options
|
24 |
-
*
|
25 |
-
* @var array of mixed
|
26 |
-
*/
|
27 |
-
private $axisOptions = array(
|
28 |
-
'minimum' => null,
|
29 |
-
'maximum' => null,
|
30 |
-
'major_unit' => null,
|
31 |
-
'minor_unit' => null,
|
32 |
-
'orientation' => self::ORIENTATION_NORMAL,
|
33 |
-
'minor_tick_mark' => self::TICK_MARK_NONE,
|
34 |
-
'major_tick_mark' => self::TICK_MARK_NONE,
|
35 |
-
'axis_labels' => self::AXIS_LABELS_NEXT_TO,
|
36 |
-
'horizontal_crosses' => self::HORIZONTAL_CROSSES_AUTOZERO,
|
37 |
-
'horizontal_crosses_value' => null
|
38 |
-
);
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Fill Properties
|
42 |
-
*
|
43 |
-
* @var array of mixed
|
44 |
-
*/
|
45 |
-
private $fillProperties = array(
|
46 |
-
'type' => self::EXCEL_COLOR_TYPE_ARGB,
|
47 |
-
'value' => null,
|
48 |
-
'alpha' => 0
|
49 |
-
);
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Line Properties
|
53 |
-
*
|
54 |
-
* @var array of mixed
|
55 |
-
*/
|
56 |
-
private $lineProperties = array(
|
57 |
-
'type' => self::EXCEL_COLOR_TYPE_ARGB,
|
58 |
-
'value' => null,
|
59 |
-
'alpha' => 0
|
60 |
-
);
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Line Style Properties
|
64 |
-
*
|
65 |
-
* @var array of mixed
|
66 |
-
*/
|
67 |
-
private $lineStyleProperties = array(
|
68 |
-
'width' => '9525',
|
69 |
-
'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
|
70 |
-
'dash' => self::LINE_STYLE_DASH_SOLID,
|
71 |
-
'cap' => self::LINE_STYLE_CAP_FLAT,
|
72 |
-
'join' => self::LINE_STYLE_JOIN_BEVEL,
|
73 |
-
'arrow' => array(
|
74 |
-
'head' => array(
|
75 |
-
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
76 |
-
'size' => self::LINE_STYLE_ARROW_SIZE_5
|
77 |
-
),
|
78 |
-
'end' => array(
|
79 |
-
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
80 |
-
'size' => self::LINE_STYLE_ARROW_SIZE_8
|
81 |
-
),
|
82 |
-
)
|
83 |
-
);
|
84 |
-
|
85 |
-
/**
|
86 |
-
* Shadow Properties
|
87 |
-
*
|
88 |
-
* @var array of mixed
|
89 |
-
*/
|
90 |
-
private $shadowProperties = array(
|
91 |
-
'presets' => self::SHADOW_PRESETS_NOSHADOW,
|
92 |
-
'effect' => null,
|
93 |
-
'color' => array(
|
94 |
-
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
95 |
-
'value' => 'black',
|
96 |
-
'alpha' => 40,
|
97 |
-
),
|
98 |
-
'size' => array(
|
99 |
-
'sx' => null,
|
100 |
-
'sy' => null,
|
101 |
-
'kx' => null
|
102 |
-
),
|
103 |
-
'blur' => null,
|
104 |
-
'direction' => null,
|
105 |
-
'distance' => null,
|
106 |
-
'algn' => null,
|
107 |
-
'rotWithShape' => null
|
108 |
-
);
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Glow Properties
|
112 |
-
*
|
113 |
-
* @var array of mixed
|
114 |
-
*/
|
115 |
-
private $glowProperties = array(
|
116 |
-
'size' => null,
|
117 |
-
'color' => array(
|
118 |
-
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
119 |
-
'value' => 'black',
|
120 |
-
'alpha' => 40
|
121 |
-
)
|
122 |
-
);
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Soft Edge Properties
|
126 |
-
*
|
127 |
-
* @var array of mixed
|
128 |
-
*/
|
129 |
-
private $softEdges = array(
|
130 |
-
'size' => null
|
131 |
-
);
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Get Series Data Type
|
135 |
-
*
|
136 |
-
* @return string
|
137 |
-
*/
|
138 |
-
public function setAxisNumberProperties($format_code)
|
139 |
-
{
|
140 |
-
$this->axisNumber['format'] = (string) $format_code;
|
141 |
-
$this->axisNumber['source_linked'] = 0;
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* Get Axis Number Format Data Type
|
146 |
-
*
|
147 |
-
* @return string
|
148 |
-
*/
|
149 |
-
public function getAxisNumberFormat()
|
150 |
-
{
|
151 |
-
return $this->axisNumber['format'];
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Get Axis Number Source Linked
|
156 |
-
*
|
157 |
-
* @return string
|
158 |
-
*/
|
159 |
-
public function getAxisNumberSourceLinked()
|
160 |
-
{
|
161 |
-
return (string) $this->axisNumber['source_linked'];
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Set Axis Options Properties
|
166 |
-
*
|
167 |
-
* @param string $axis_labels
|
168 |
-
* @param string $horizontal_crosses_value
|
169 |
-
* @param string $horizontal_crosses
|
170 |
-
* @param string $axis_orientation
|
171 |
-
* @param string $major_tmt
|
172 |
-
* @param string $minor_tmt
|
173 |
-
* @param string $minimum
|
174 |
-
* @param string $maximum
|
175 |
-
* @param string $major_unit
|
176 |
-
* @param string $minor_unit
|
177 |
-
*
|
178 |
-
*/
|
179 |
-
public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null)
|
180 |
-
{
|
181 |
-
$this->axisOptions['axis_labels'] = (string) $axis_labels;
|
182 |
-
($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;
|
183 |
-
($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null;
|
184 |
-
($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null;
|
185 |
-
($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null;
|
186 |
-
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;
|
187 |
-
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;
|
188 |
-
($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null;
|
189 |
-
($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null;
|
190 |
-
($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null;
|
191 |
-
($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null;
|
192 |
-
}
|
193 |
-
|
194 |
-
/**
|
195 |
-
* Get Axis Options Property
|
196 |
-
*
|
197 |
-
* @param string $property
|
198 |
-
*
|
199 |
-
* @return string
|
200 |
-
*/
|
201 |
-
public function getAxisOptionsProperty($property)
|
202 |
-
{
|
203 |
-
return $this->axisOptions[$property];
|
204 |
-
}
|
205 |
-
|
206 |
-
/**
|
207 |
-
* Set Axis Orientation Property
|
208 |
-
*
|
209 |
-
* @param string $orientation
|
210 |
-
*
|
211 |
-
*/
|
212 |
-
public function setAxisOrientation($orientation)
|
213 |
-
{
|
214 |
-
$this->orientation = (string) $orientation;
|
215 |
-
}
|
216 |
-
|
217 |
-
/**
|
218 |
-
* Set Fill Property
|
219 |
-
*
|
220 |
-
* @param string $color
|
221 |
-
* @param int $alpha
|
222 |
-
* @param string $type
|
223 |
-
*
|
224 |
-
*/
|
225 |
-
public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB)
|
226 |
-
{
|
227 |
-
$this->fillProperties = $this->setColorProperties($color, $alpha, $type);
|
228 |
-
}
|
229 |
-
|
230 |
-
/**
|
231 |
-
* Set Line Property
|
232 |
-
*
|
233 |
-
* @param string $color
|
234 |
-
* @param int $alpha
|
235 |
-
* @param string $type
|
236 |
-
*
|
237 |
-
*/
|
238 |
-
public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB)
|
239 |
-
{
|
240 |
-
$this->lineProperties = $this->setColorProperties($color, $alpha, $type);
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* Get Fill Property
|
245 |
-
*
|
246 |
-
* @param string $property
|
247 |
-
*
|
248 |
-
* @return string
|
249 |
-
*/
|
250 |
-
public function getFillProperty($property)
|
251 |
-
{
|
252 |
-
return $this->fillProperties[$property];
|
253 |
-
}
|
254 |
-
|
255 |
-
/**
|
256 |
-
* Get Line Property
|
257 |
-
*
|
258 |
-
* @param string $property
|
259 |
-
*
|
260 |
-
* @return string
|
261 |
-
*/
|
262 |
-
public function getLineProperty($property)
|
263 |
-
{
|
264 |
-
return $this->lineProperties[$property];
|
265 |
-
}
|
266 |
-
|
267 |
-
/**
|
268 |
-
* Set Line Style Properties
|
269 |
-
*
|
270 |
-
* @param float $line_width
|
271 |
-
* @param string $compound_type
|
272 |
-
* @param string $dash_type
|
273 |
-
* @param string $cap_type
|
274 |
-
* @param string $join_type
|
275 |
-
* @param string $head_arrow_type
|
276 |
-
* @param string $head_arrow_size
|
277 |
-
* @param string $end_arrow_type
|
278 |
-
* @param string $end_arrow_size
|
279 |
-
*
|
280 |
-
*/
|
281 |
-
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null)
|
282 |
-
{
|
283 |
-
(!is_null($line_width)) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null;
|
284 |
-
(!is_null($compound_type)) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null;
|
285 |
-
(!is_null($dash_type)) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null;
|
286 |
-
(!is_null($cap_type)) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null;
|
287 |
-
(!is_null($join_type)) ? $this->lineStyleProperties['join'] = (string) $join_type : null;
|
288 |
-
(!is_null($head_arrow_type)) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null;
|
289 |
-
(!is_null($head_arrow_size)) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null;
|
290 |
-
(!is_null($end_arrow_type)) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null;
|
291 |
-
(!is_null($end_arrow_size)) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null;
|
292 |
-
}
|
293 |
-
|
294 |
-
/**
|
295 |
-
* Get Line Style Property
|
296 |
-
*
|
297 |
-
* @param array|string $elements
|
298 |
-
*
|
299 |
-
* @return string
|
300 |
-
*/
|
301 |
-
public function getLineStyleProperty($elements)
|
302 |
-
{
|
303 |
-
return $this->getArrayElementsValue($this->lineStyleProperties, $elements);
|
304 |
-
}
|
305 |
-
|
306 |
-
/**
|
307 |
-
* Get Line Style Arrow Excel Width
|
308 |
-
*
|
309 |
-
* @param string $arrow
|
310 |
-
*
|
311 |
-
* @return string
|
312 |
-
*/
|
313 |
-
public function getLineStyleArrowWidth($arrow)
|
314 |
-
{
|
315 |
-
return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'w');
|
316 |
-
}
|
317 |
-
|
318 |
-
/**
|
319 |
-
* Get Line Style Arrow Excel Length
|
320 |
-
*
|
321 |
-
* @param string $arrow
|
322 |
-
*
|
323 |
-
* @return string
|
324 |
-
*/
|
325 |
-
public function getLineStyleArrowLength($arrow)
|
326 |
-
{
|
327 |
-
return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'len');
|
328 |
-
}
|
329 |
-
|
330 |
-
/**
|
331 |
-
* Set Shadow Properties
|
332 |
-
*
|
333 |
-
* @param int $shadow_presets
|
334 |
-
* @param string $sh_color_value
|
335 |
-
* @param string $sh_color_type
|
336 |
-
* @param string $sh_color_alpha
|
337 |
-
* @param float $sh_blur
|
338 |
-
* @param int $sh_angle
|
339 |
-
* @param float $sh_distance
|
340 |
-
*
|
341 |
-
*/
|
342 |
-
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null)
|
343 |
-
{
|
344 |
-
$this->setShadowPresetsProperties((int) $sh_presets)
|
345 |
-
->setShadowColor(
|
346 |
-
is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value,
|
347 |
-
is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha,
|
348 |
-
is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type
|
349 |
-
)
|
350 |
-
->setShadowBlur($sh_blur)
|
351 |
-
->setShadowAngle($sh_angle)
|
352 |
-
->setShadowDistance($sh_distance);
|
353 |
-
}
|
354 |
-
|
355 |
-
/**
|
356 |
-
* Set Shadow Color
|
357 |
-
*
|
358 |
-
* @param int $shadow_presets
|
359 |
-
*
|
360 |
-
* @return PHPExcel_Chart_Axis
|
361 |
-
*/
|
362 |
-
private function setShadowPresetsProperties($shadow_presets)
|
363 |
-
{
|
364 |
-
$this->shadowProperties['presets'] = $shadow_presets;
|
365 |
-
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
|
366 |
-
|
367 |
-
return $this;
|
368 |
-
}
|
369 |
-
|
370 |
-
/**
|
371 |
-
* Set Shadow Properties from Maped Values
|
372 |
-
*
|
373 |
-
* @param array $properties_map
|
374 |
-
* @param * $reference
|
375 |
-
*
|
376 |
-
* @return PHPExcel_Chart_Axis
|
377 |
-
*/
|
378 |
-
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
|
379 |
-
{
|
380 |
-
$base_reference = $reference;
|
381 |
-
foreach ($properties_map as $property_key => $property_val) {
|
382 |
-
if (is_array($property_val)) {
|
383 |
-
if ($reference === null) {
|
384 |
-
$reference = & $this->shadowProperties[$property_key];
|
385 |
-
} else {
|
386 |
-
$reference = & $reference[$property_key];
|
387 |
-
}
|
388 |
-
$this->setShadowProperiesMapValues($property_val, $reference);
|
389 |
-
} else {
|
390 |
-
if ($base_reference === null) {
|
391 |
-
$this->shadowProperties[$property_key] = $property_val;
|
392 |
-
} else {
|
393 |
-
$reference[$property_key] = $property_val;
|
394 |
-
}
|
395 |
-
}
|
396 |
-
}
|
397 |
-
|
398 |
-
return $this;
|
399 |
-
}
|
400 |
-
|
401 |
-
/**
|
402 |
-
* Set Shadow Color
|
403 |
-
*
|
404 |
-
* @param string $color
|
405 |
-
* @param int $alpha
|
406 |
-
* @param string $type
|
407 |
-
*
|
408 |
-
* @return PHPExcel_Chart_Axis
|
409 |
-
*/
|
410 |
-
private function setShadowColor($color, $alpha, $type)
|
411 |
-
{
|
412 |
-
$this->shadowProperties['color'] = $this->setColorProperties($color, $alpha, $type);
|
413 |
-
|
414 |
-
return $this;
|
415 |
-
}
|
416 |
-
|
417 |
-
/**
|
418 |
-
* Set Shadow Blur
|
419 |
-
*
|
420 |
-
* @param float $blur
|
421 |
-
*
|
422 |
-
* @return PHPExcel_Chart_Axis
|
423 |
-
*/
|
424 |
-
private function setShadowBlur($blur)
|
425 |
-
{
|
426 |
-
if ($blur !== null) {
|
427 |
-
$this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur);
|
428 |
-
}
|
429 |
-
|
430 |
-
return $this;
|
431 |
-
}
|
432 |
-
|
433 |
-
/**
|
434 |
-
* Set Shadow Angle
|
435 |
-
*
|
436 |
-
* @param int $angle
|
437 |
-
*
|
438 |
-
* @return PHPExcel_Chart_Axis
|
439 |
-
*/
|
440 |
-
private function setShadowAngle($angle)
|
441 |
-
{
|
442 |
-
if ($angle !== null) {
|
443 |
-
$this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle);
|
444 |
-
}
|
445 |
-
|
446 |
-
return $this;
|
447 |
-
}
|
448 |
-
|
449 |
-
/**
|
450 |
-
* Set Shadow Distance
|
451 |
-
*
|
452 |
-
* @param float $distance
|
453 |
-
*
|
454 |
-
* @return PHPExcel_Chart_Axis
|
455 |
-
*/
|
456 |
-
private function setShadowDistance($distance)
|
457 |
-
{
|
458 |
-
if ($distance !== null) {
|
459 |
-
$this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance);
|
460 |
-
}
|
461 |
-
|
462 |
-
return $this;
|
463 |
-
}
|
464 |
-
|
465 |
-
/**
|
466 |
-
* Get Glow Property
|
467 |
-
*
|
468 |
-
* @param float $size
|
469 |
-
* @param string $color_value
|
470 |
-
* @param int $color_alpha
|
471 |
-
* @param string $color_type
|
472 |
-
*/
|
473 |
-
public function getShadowProperty($elements)
|
474 |
-
{
|
475 |
-
return $this->getArrayElementsValue($this->shadowProperties, $elements);
|
476 |
-
}
|
477 |
-
|
478 |
-
/**
|
479 |
-
* Set Glow Properties
|
480 |
-
*
|
481 |
-
* @param float $size
|
482 |
-
* @param string $color_value
|
483 |
-
* @param int $color_alpha
|
484 |
-
* @param string $color_type
|
485 |
-
*/
|
486 |
-
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null)
|
487 |
-
{
|
488 |
-
$this->setGlowSize($size)
|
489 |
-
->setGlowColor(
|
490 |
-
is_null($color_value) ? $this->glowProperties['color']['value'] : $color_value,
|
491 |
-
is_null($color_alpha) ? (int) $this->glowProperties['color']['alpha'] : $color_alpha,
|
492 |
-
is_null($color_type) ? $this->glowProperties['color']['type'] : $color_type
|
493 |
-
);
|
494 |
-
}
|
495 |
-
|
496 |
-
/**
|
497 |
-
* Get Glow Property
|
498 |
-
*
|
499 |
-
* @param array|string $property
|
500 |
-
*
|
501 |
-
* @return string
|
502 |
-
*/
|
503 |
-
public function getGlowProperty($property)
|
504 |
-
{
|
505 |
-
return $this->getArrayElementsValue($this->glowProperties, $property);
|
506 |
-
}
|
507 |
-
|
508 |
-
/**
|
509 |
-
* Set Glow Color
|
510 |
-
*
|
511 |
-
* @param float $size
|
512 |
-
*
|
513 |
-
* @return PHPExcel_Chart_Axis
|
514 |
-
*/
|
515 |
-
private function setGlowSize($size)
|
516 |
-
{
|
517 |
-
if (!is_null($size)) {
|
518 |
-
$this->glowProperties['size'] = $this->getExcelPointsWidth($size);
|
519 |
-
}
|
520 |
-
|
521 |
-
return $this;
|
522 |
-
}
|
523 |
-
|
524 |
-
/**
|
525 |
-
* Set Glow Color
|
526 |
-
*
|
527 |
-
* @param string $color
|
528 |
-
* @param int $alpha
|
529 |
-
* @param string $type
|
530 |
-
*
|
531 |
-
* @return PHPExcel_Chart_Axis
|
532 |
-
*/
|
533 |
-
private function setGlowColor($color, $alpha, $type)
|
534 |
-
{
|
535 |
-
$this->glowProperties['color'] = $this->setColorProperties($color, $alpha, $type);
|
536 |
-
|
537 |
-
return $this;
|
538 |
-
}
|
539 |
-
|
540 |
-
/**
|
541 |
-
* Set Soft Edges Size
|
542 |
-
*
|
543 |
-
* @param float $size
|
544 |
-
*/
|
545 |
-
public function setSoftEdges($size)
|
546 |
-
{
|
547 |
-
if (!is_null($size)) {
|
548 |
-
$softEdges['size'] = (string) $this->getExcelPointsWidth($size);
|
549 |
-
}
|
550 |
-
}
|
551 |
-
|
552 |
-
/**
|
553 |
-
* Get Soft Edges Size
|
554 |
-
*
|
555 |
-
* @return string
|
556 |
-
*/
|
557 |
-
public function getSoftEdgesSize()
|
558 |
-
{
|
559 |
-
return $this->softEdges['size'];
|
560 |
-
}
|
561 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Created by PhpStorm.
|
5 |
+
* User: Wiktor Trzonkowski
|
6 |
+
* Date: 6/17/14
|
7 |
+
* Time: 12:11 PM
|
8 |
+
*/
|
9 |
+
|
10 |
+
class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Axis Number
|
14 |
+
*
|
15 |
+
* @var array of mixed
|
16 |
+
*/
|
17 |
+
private $axisNumber = array(
|
18 |
+
'format' => self::FORMAT_CODE_GENERAL,
|
19 |
+
'source_linked' => 1
|
20 |
+
);
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Axis Options
|
24 |
+
*
|
25 |
+
* @var array of mixed
|
26 |
+
*/
|
27 |
+
private $axisOptions = array(
|
28 |
+
'minimum' => null,
|
29 |
+
'maximum' => null,
|
30 |
+
'major_unit' => null,
|
31 |
+
'minor_unit' => null,
|
32 |
+
'orientation' => self::ORIENTATION_NORMAL,
|
33 |
+
'minor_tick_mark' => self::TICK_MARK_NONE,
|
34 |
+
'major_tick_mark' => self::TICK_MARK_NONE,
|
35 |
+
'axis_labels' => self::AXIS_LABELS_NEXT_TO,
|
36 |
+
'horizontal_crosses' => self::HORIZONTAL_CROSSES_AUTOZERO,
|
37 |
+
'horizontal_crosses_value' => null
|
38 |
+
);
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Fill Properties
|
42 |
+
*
|
43 |
+
* @var array of mixed
|
44 |
+
*/
|
45 |
+
private $fillProperties = array(
|
46 |
+
'type' => self::EXCEL_COLOR_TYPE_ARGB,
|
47 |
+
'value' => null,
|
48 |
+
'alpha' => 0
|
49 |
+
);
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Line Properties
|
53 |
+
*
|
54 |
+
* @var array of mixed
|
55 |
+
*/
|
56 |
+
private $lineProperties = array(
|
57 |
+
'type' => self::EXCEL_COLOR_TYPE_ARGB,
|
58 |
+
'value' => null,
|
59 |
+
'alpha' => 0
|
60 |
+
);
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Line Style Properties
|
64 |
+
*
|
65 |
+
* @var array of mixed
|
66 |
+
*/
|
67 |
+
private $lineStyleProperties = array(
|
68 |
+
'width' => '9525',
|
69 |
+
'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
|
70 |
+
'dash' => self::LINE_STYLE_DASH_SOLID,
|
71 |
+
'cap' => self::LINE_STYLE_CAP_FLAT,
|
72 |
+
'join' => self::LINE_STYLE_JOIN_BEVEL,
|
73 |
+
'arrow' => array(
|
74 |
+
'head' => array(
|
75 |
+
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
76 |
+
'size' => self::LINE_STYLE_ARROW_SIZE_5
|
77 |
+
),
|
78 |
+
'end' => array(
|
79 |
+
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
80 |
+
'size' => self::LINE_STYLE_ARROW_SIZE_8
|
81 |
+
),
|
82 |
+
)
|
83 |
+
);
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Shadow Properties
|
87 |
+
*
|
88 |
+
* @var array of mixed
|
89 |
+
*/
|
90 |
+
private $shadowProperties = array(
|
91 |
+
'presets' => self::SHADOW_PRESETS_NOSHADOW,
|
92 |
+
'effect' => null,
|
93 |
+
'color' => array(
|
94 |
+
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
95 |
+
'value' => 'black',
|
96 |
+
'alpha' => 40,
|
97 |
+
),
|
98 |
+
'size' => array(
|
99 |
+
'sx' => null,
|
100 |
+
'sy' => null,
|
101 |
+
'kx' => null
|
102 |
+
),
|
103 |
+
'blur' => null,
|
104 |
+
'direction' => null,
|
105 |
+
'distance' => null,
|
106 |
+
'algn' => null,
|
107 |
+
'rotWithShape' => null
|
108 |
+
);
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Glow Properties
|
112 |
+
*
|
113 |
+
* @var array of mixed
|
114 |
+
*/
|
115 |
+
private $glowProperties = array(
|
116 |
+
'size' => null,
|
117 |
+
'color' => array(
|
118 |
+
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
119 |
+
'value' => 'black',
|
120 |
+
'alpha' => 40
|
121 |
+
)
|
122 |
+
);
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Soft Edge Properties
|
126 |
+
*
|
127 |
+
* @var array of mixed
|
128 |
+
*/
|
129 |
+
private $softEdges = array(
|
130 |
+
'size' => null
|
131 |
+
);
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Get Series Data Type
|
135 |
+
*
|
136 |
+
* @return string
|
137 |
+
*/
|
138 |
+
public function setAxisNumberProperties($format_code)
|
139 |
+
{
|
140 |
+
$this->axisNumber['format'] = (string) $format_code;
|
141 |
+
$this->axisNumber['source_linked'] = 0;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Get Axis Number Format Data Type
|
146 |
+
*
|
147 |
+
* @return string
|
148 |
+
*/
|
149 |
+
public function getAxisNumberFormat()
|
150 |
+
{
|
151 |
+
return $this->axisNumber['format'];
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Get Axis Number Source Linked
|
156 |
+
*
|
157 |
+
* @return string
|
158 |
+
*/
|
159 |
+
public function getAxisNumberSourceLinked()
|
160 |
+
{
|
161 |
+
return (string) $this->axisNumber['source_linked'];
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Set Axis Options Properties
|
166 |
+
*
|
167 |
+
* @param string $axis_labels
|
168 |
+
* @param string $horizontal_crosses_value
|
169 |
+
* @param string $horizontal_crosses
|
170 |
+
* @param string $axis_orientation
|
171 |
+
* @param string $major_tmt
|
172 |
+
* @param string $minor_tmt
|
173 |
+
* @param string $minimum
|
174 |
+
* @param string $maximum
|
175 |
+
* @param string $major_unit
|
176 |
+
* @param string $minor_unit
|
177 |
+
*
|
178 |
+
*/
|
179 |
+
public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null)
|
180 |
+
{
|
181 |
+
$this->axisOptions['axis_labels'] = (string) $axis_labels;
|
182 |
+
($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;
|
183 |
+
($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null;
|
184 |
+
($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null;
|
185 |
+
($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null;
|
186 |
+
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;
|
187 |
+
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;
|
188 |
+
($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null;
|
189 |
+
($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null;
|
190 |
+
($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null;
|
191 |
+
($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null;
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Get Axis Options Property
|
196 |
+
*
|
197 |
+
* @param string $property
|
198 |
+
*
|
199 |
+
* @return string
|
200 |
+
*/
|
201 |
+
public function getAxisOptionsProperty($property)
|
202 |
+
{
|
203 |
+
return $this->axisOptions[$property];
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Set Axis Orientation Property
|
208 |
+
*
|
209 |
+
* @param string $orientation
|
210 |
+
*
|
211 |
+
*/
|
212 |
+
public function setAxisOrientation($orientation)
|
213 |
+
{
|
214 |
+
$this->orientation = (string) $orientation;
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Set Fill Property
|
219 |
+
*
|
220 |
+
* @param string $color
|
221 |
+
* @param int $alpha
|
222 |
+
* @param string $type
|
223 |
+
*
|
224 |
+
*/
|
225 |
+
public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB)
|
226 |
+
{
|
227 |
+
$this->fillProperties = $this->setColorProperties($color, $alpha, $type);
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Set Line Property
|
232 |
+
*
|
233 |
+
* @param string $color
|
234 |
+
* @param int $alpha
|
235 |
+
* @param string $type
|
236 |
+
*
|
237 |
+
*/
|
238 |
+
public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB)
|
239 |
+
{
|
240 |
+
$this->lineProperties = $this->setColorProperties($color, $alpha, $type);
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Get Fill Property
|
245 |
+
*
|
246 |
+
* @param string $property
|
247 |
+
*
|
248 |
+
* @return string
|
249 |
+
*/
|
250 |
+
public function getFillProperty($property)
|
251 |
+
{
|
252 |
+
return $this->fillProperties[$property];
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Get Line Property
|
257 |
+
*
|
258 |
+
* @param string $property
|
259 |
+
*
|
260 |
+
* @return string
|
261 |
+
*/
|
262 |
+
public function getLineProperty($property)
|
263 |
+
{
|
264 |
+
return $this->lineProperties[$property];
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Set Line Style Properties
|
269 |
+
*
|
270 |
+
* @param float $line_width
|
271 |
+
* @param string $compound_type
|
272 |
+
* @param string $dash_type
|
273 |
+
* @param string $cap_type
|
274 |
+
* @param string $join_type
|
275 |
+
* @param string $head_arrow_type
|
276 |
+
* @param string $head_arrow_size
|
277 |
+
* @param string $end_arrow_type
|
278 |
+
* @param string $end_arrow_size
|
279 |
+
*
|
280 |
+
*/
|
281 |
+
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null)
|
282 |
+
{
|
283 |
+
(!is_null($line_width)) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null;
|
284 |
+
(!is_null($compound_type)) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null;
|
285 |
+
(!is_null($dash_type)) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null;
|
286 |
+
(!is_null($cap_type)) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null;
|
287 |
+
(!is_null($join_type)) ? $this->lineStyleProperties['join'] = (string) $join_type : null;
|
288 |
+
(!is_null($head_arrow_type)) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null;
|
289 |
+
(!is_null($head_arrow_size)) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null;
|
290 |
+
(!is_null($end_arrow_type)) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null;
|
291 |
+
(!is_null($end_arrow_size)) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null;
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Get Line Style Property
|
296 |
+
*
|
297 |
+
* @param array|string $elements
|
298 |
+
*
|
299 |
+
* @return string
|
300 |
+
*/
|
301 |
+
public function getLineStyleProperty($elements)
|
302 |
+
{
|
303 |
+
return $this->getArrayElementsValue($this->lineStyleProperties, $elements);
|
304 |
+
}
|
305 |
+
|
306 |
+
/**
|
307 |
+
* Get Line Style Arrow Excel Width
|
308 |
+
*
|
309 |
+
* @param string $arrow
|
310 |
+
*
|
311 |
+
* @return string
|
312 |
+
*/
|
313 |
+
public function getLineStyleArrowWidth($arrow)
|
314 |
+
{
|
315 |
+
return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'w');
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Get Line Style Arrow Excel Length
|
320 |
+
*
|
321 |
+
* @param string $arrow
|
322 |
+
*
|
323 |
+
* @return string
|
324 |
+
*/
|
325 |
+
public function getLineStyleArrowLength($arrow)
|
326 |
+
{
|
327 |
+
return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'len');
|
328 |
+
}
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Set Shadow Properties
|
332 |
+
*
|
333 |
+
* @param int $shadow_presets
|
334 |
+
* @param string $sh_color_value
|
335 |
+
* @param string $sh_color_type
|
336 |
+
* @param string $sh_color_alpha
|
337 |
+
* @param float $sh_blur
|
338 |
+
* @param int $sh_angle
|
339 |
+
* @param float $sh_distance
|
340 |
+
*
|
341 |
+
*/
|
342 |
+
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null)
|
343 |
+
{
|
344 |
+
$this->setShadowPresetsProperties((int) $sh_presets)
|
345 |
+
->setShadowColor(
|
346 |
+
is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value,
|
347 |
+
is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha,
|
348 |
+
is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type
|
349 |
+
)
|
350 |
+
->setShadowBlur($sh_blur)
|
351 |
+
->setShadowAngle($sh_angle)
|
352 |
+
->setShadowDistance($sh_distance);
|
353 |
+
}
|
354 |
+
|
355 |
+
/**
|
356 |
+
* Set Shadow Color
|
357 |
+
*
|
358 |
+
* @param int $shadow_presets
|
359 |
+
*
|
360 |
+
* @return PHPExcel_Chart_Axis
|
361 |
+
*/
|
362 |
+
private function setShadowPresetsProperties($shadow_presets)
|
363 |
+
{
|
364 |
+
$this->shadowProperties['presets'] = $shadow_presets;
|
365 |
+
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
|
366 |
+
|
367 |
+
return $this;
|
368 |
+
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Set Shadow Properties from Maped Values
|
372 |
+
*
|
373 |
+
* @param array $properties_map
|
374 |
+
* @param * $reference
|
375 |
+
*
|
376 |
+
* @return PHPExcel_Chart_Axis
|
377 |
+
*/
|
378 |
+
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
|
379 |
+
{
|
380 |
+
$base_reference = $reference;
|
381 |
+
foreach ($properties_map as $property_key => $property_val) {
|
382 |
+
if (is_array($property_val)) {
|
383 |
+
if ($reference === null) {
|
384 |
+
$reference = & $this->shadowProperties[$property_key];
|
385 |
+
} else {
|
386 |
+
$reference = & $reference[$property_key];
|
387 |
+
}
|
388 |
+
$this->setShadowProperiesMapValues($property_val, $reference);
|
389 |
+
} else {
|
390 |
+
if ($base_reference === null) {
|
391 |
+
$this->shadowProperties[$property_key] = $property_val;
|
392 |
+
} else {
|
393 |
+
$reference[$property_key] = $property_val;
|
394 |
+
}
|
395 |
+
}
|
396 |
+
}
|
397 |
+
|
398 |
+
return $this;
|
399 |
+
}
|
400 |
+
|
401 |
+
/**
|
402 |
+
* Set Shadow Color
|
403 |
+
*
|
404 |
+
* @param string $color
|
405 |
+
* @param int $alpha
|
406 |
+
* @param string $type
|
407 |
+
*
|
408 |
+
* @return PHPExcel_Chart_Axis
|
409 |
+
*/
|
410 |
+
private function setShadowColor($color, $alpha, $type)
|
411 |
+
{
|
412 |
+
$this->shadowProperties['color'] = $this->setColorProperties($color, $alpha, $type);
|
413 |
+
|
414 |
+
return $this;
|
415 |
+
}
|
416 |
+
|
417 |
+
/**
|
418 |
+
* Set Shadow Blur
|
419 |
+
*
|
420 |
+
* @param float $blur
|
421 |
+
*
|
422 |
+
* @return PHPExcel_Chart_Axis
|
423 |
+
*/
|
424 |
+
private function setShadowBlur($blur)
|
425 |
+
{
|
426 |
+
if ($blur !== null) {
|
427 |
+
$this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur);
|
428 |
+
}
|
429 |
+
|
430 |
+
return $this;
|
431 |
+
}
|
432 |
+
|
433 |
+
/**
|
434 |
+
* Set Shadow Angle
|
435 |
+
*
|
436 |
+
* @param int $angle
|
437 |
+
*
|
438 |
+
* @return PHPExcel_Chart_Axis
|
439 |
+
*/
|
440 |
+
private function setShadowAngle($angle)
|
441 |
+
{
|
442 |
+
if ($angle !== null) {
|
443 |
+
$this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle);
|
444 |
+
}
|
445 |
+
|
446 |
+
return $this;
|
447 |
+
}
|
448 |
+
|
449 |
+
/**
|
450 |
+
* Set Shadow Distance
|
451 |
+
*
|
452 |
+
* @param float $distance
|
453 |
+
*
|
454 |
+
* @return PHPExcel_Chart_Axis
|
455 |
+
*/
|
456 |
+
private function setShadowDistance($distance)
|
457 |
+
{
|
458 |
+
if ($distance !== null) {
|
459 |
+
$this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance);
|
460 |
+
}
|
461 |
+
|
462 |
+
return $this;
|
463 |
+
}
|
464 |
+
|
465 |
+
/**
|
466 |
+
* Get Glow Property
|
467 |
+
*
|
468 |
+
* @param float $size
|
469 |
+
* @param string $color_value
|
470 |
+
* @param int $color_alpha
|
471 |
+
* @param string $color_type
|
472 |
+
*/
|
473 |
+
public function getShadowProperty($elements)
|
474 |
+
{
|
475 |
+
return $this->getArrayElementsValue($this->shadowProperties, $elements);
|
476 |
+
}
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Set Glow Properties
|
480 |
+
*
|
481 |
+
* @param float $size
|
482 |
+
* @param string $color_value
|
483 |
+
* @param int $color_alpha
|
484 |
+
* @param string $color_type
|
485 |
+
*/
|
486 |
+
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null)
|
487 |
+
{
|
488 |
+
$this->setGlowSize($size)
|
489 |
+
->setGlowColor(
|
490 |
+
is_null($color_value) ? $this->glowProperties['color']['value'] : $color_value,
|
491 |
+
is_null($color_alpha) ? (int) $this->glowProperties['color']['alpha'] : $color_alpha,
|
492 |
+
is_null($color_type) ? $this->glowProperties['color']['type'] : $color_type
|
493 |
+
);
|
494 |
+
}
|
495 |
+
|
496 |
+
/**
|
497 |
+
* Get Glow Property
|
498 |
+
*
|
499 |
+
* @param array|string $property
|
500 |
+
*
|
501 |
+
* @return string
|
502 |
+
*/
|
503 |
+
public function getGlowProperty($property)
|
504 |
+
{
|
505 |
+
return $this->getArrayElementsValue($this->glowProperties, $property);
|
506 |
+
}
|
507 |
+
|
508 |
+
/**
|
509 |
+
* Set Glow Color
|
510 |
+
*
|
511 |
+
* @param float $size
|
512 |
+
*
|
513 |
+
* @return PHPExcel_Chart_Axis
|
514 |
+
*/
|
515 |
+
private function setGlowSize($size)
|
516 |
+
{
|
517 |
+
if (!is_null($size)) {
|
518 |
+
$this->glowProperties['size'] = $this->getExcelPointsWidth($size);
|
519 |
+
}
|
520 |
+
|
521 |
+
return $this;
|
522 |
+
}
|
523 |
+
|
524 |
+
/**
|
525 |
+
* Set Glow Color
|
526 |
+
*
|
527 |
+
* @param string $color
|
528 |
+
* @param int $alpha
|
529 |
+
* @param string $type
|
530 |
+
*
|
531 |
+
* @return PHPExcel_Chart_Axis
|
532 |
+
*/
|
533 |
+
private function setGlowColor($color, $alpha, $type)
|
534 |
+
{
|
535 |
+
$this->glowProperties['color'] = $this->setColorProperties($color, $alpha, $type);
|
536 |
+
|
537 |
+
return $this;
|
538 |
+
}
|
539 |
+
|
540 |
+
/**
|
541 |
+
* Set Soft Edges Size
|
542 |
+
*
|
543 |
+
* @param float $size
|
544 |
+
*/
|
545 |
+
public function setSoftEdges($size)
|
546 |
+
{
|
547 |
+
if (!is_null($size)) {
|
548 |
+
$softEdges['size'] = (string) $this->getExcelPointsWidth($size);
|
549 |
+
}
|
550 |
+
}
|
551 |
+
|
552 |
+
/**
|
553 |
+
* Get Soft Edges Size
|
554 |
+
*
|
555 |
+
* @return string
|
556 |
+
*/
|
557 |
+
public function getSoftEdgesSize()
|
558 |
+
{
|
559 |
+
return $this->softEdges['size'];
|
560 |
+
}
|
561 |
+
}
|
PHPExcel/Classes/PHPExcel/Chart/GridLines.php
CHANGED
@@ -1,472 +1,472 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Created by PhpStorm.
|
5 |
-
* User: Wiktor Trzonkowski
|
6 |
-
* Date: 7/2/14
|
7 |
-
* Time: 2:36 PM
|
8 |
-
*/
|
9 |
-
|
10 |
-
class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
|
11 |
-
{
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Properties of Class:
|
15 |
-
* Object State (State for Minor Tick Mark) @var bool
|
16 |
-
* Line Properties @var array of mixed
|
17 |
-
* Shadow Properties @var array of mixed
|
18 |
-
* Glow Properties @var array of mixed
|
19 |
-
* Soft Properties @var array of mixed
|
20 |
-
*
|
21 |
-
*/
|
22 |
-
|
23 |
-
private $objectState = false;
|
24 |
-
|
25 |
-
private $lineProperties = array(
|
26 |
-
'color' => array(
|
27 |
-
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
28 |
-
'value' => null,
|
29 |
-
'alpha' => 0
|
30 |
-
),
|
31 |
-
'style' => array(
|
32 |
-
'width' => '9525',
|
33 |
-
'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
|
34 |
-
'dash' => self::LINE_STYLE_DASH_SOLID,
|
35 |
-
'cap' => self::LINE_STYLE_CAP_FLAT,
|
36 |
-
'join' => self::LINE_STYLE_JOIN_BEVEL,
|
37 |
-
'arrow' => array(
|
38 |
-
'head' => array(
|
39 |
-
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
40 |
-
'size' => self::LINE_STYLE_ARROW_SIZE_5
|
41 |
-
),
|
42 |
-
'end' => array(
|
43 |
-
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
44 |
-
'size' => self::LINE_STYLE_ARROW_SIZE_8
|
45 |
-
),
|
46 |
-
)
|
47 |
-
)
|
48 |
-
);
|
49 |
-
|
50 |
-
private $shadowProperties = array(
|
51 |
-
'presets' => self::SHADOW_PRESETS_NOSHADOW,
|
52 |
-
'effect' => null,
|
53 |
-
'color' => array(
|
54 |
-
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
55 |
-
'value' => 'black',
|
56 |
-
'alpha' => 85,
|
57 |
-
),
|
58 |
-
'size' => array(
|
59 |
-
'sx' => null,
|
60 |
-
'sy' => null,
|
61 |
-
'kx' => null
|
62 |
-
),
|
63 |
-
'blur' => null,
|
64 |
-
'direction' => null,
|
65 |
-
'distance' => null,
|
66 |
-
'algn' => null,
|
67 |
-
'rotWithShape' => null
|
68 |
-
);
|
69 |
-
|
70 |
-
private $glowProperties = array(
|
71 |
-
'size' => null,
|
72 |
-
'color' => array(
|
73 |
-
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
74 |
-
'value' => 'black',
|
75 |
-
'alpha' => 40
|
76 |
-
)
|
77 |
-
);
|
78 |
-
|
79 |
-
private $softEdges = array(
|
80 |
-
'size' => null
|
81 |
-
);
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Get Object State
|
85 |
-
*
|
86 |
-
* @return bool
|
87 |
-
*/
|
88 |
-
|
89 |
-
public function getObjectState()
|
90 |
-
{
|
91 |
-
return $this->objectState;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Change Object State to True
|
96 |
-
*
|
97 |
-
* @return PHPExcel_Chart_GridLines
|
98 |
-
*/
|
99 |
-
|
100 |
-
private function activateObject()
|
101 |
-
{
|
102 |
-
$this->objectState = true;
|
103 |
-
|
104 |
-
return $this;
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Set Line Color Properties
|
109 |
-
*
|
110 |
-
* @param string $value
|
111 |
-
* @param int $alpha
|
112 |
-
* @param string $type
|
113 |
-
*/
|
114 |
-
|
115 |
-
public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD)
|
116 |
-
{
|
117 |
-
$this->activateObject()
|
118 |
-
->lineProperties['color'] = $this->setColorProperties(
|
119 |
-
$value,
|
120 |
-
$alpha,
|
121 |
-
$type
|
122 |
-
);
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Set Line Color Properties
|
127 |
-
*
|
128 |
-
* @param float $line_width
|
129 |
-
* @param string $compound_type
|
130 |
-
* @param string $dash_type
|
131 |
-
* @param string $cap_type
|
132 |
-
* @param string $join_type
|
133 |
-
* @param string $head_arrow_type
|
134 |
-
* @param string $head_arrow_size
|
135 |
-
* @param string $end_arrow_type
|
136 |
-
* @param string $end_arrow_size
|
137 |
-
*/
|
138 |
-
|
139 |
-
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null)
|
140 |
-
{
|
141 |
-
$this->activateObject();
|
142 |
-
(!is_null($line_width))
|
143 |
-
? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $line_width)
|
144 |
-
: null;
|
145 |
-
(!is_null($compound_type))
|
146 |
-
? $this->lineProperties['style']['compound'] = (string) $compound_type
|
147 |
-
: null;
|
148 |
-
(!is_null($dash_type))
|
149 |
-
? $this->lineProperties['style']['dash'] = (string) $dash_type
|
150 |
-
: null;
|
151 |
-
(!is_null($cap_type))
|
152 |
-
? $this->lineProperties['style']['cap'] = (string) $cap_type
|
153 |
-
: null;
|
154 |
-
(!is_null($join_type))
|
155 |
-
? $this->lineProperties['style']['join'] = (string) $join_type
|
156 |
-
: null;
|
157 |
-
(!is_null($head_arrow_type))
|
158 |
-
? $this->lineProperties['style']['arrow']['head']['type'] = (string) $head_arrow_type
|
159 |
-
: null;
|
160 |
-
(!is_null($head_arrow_size))
|
161 |
-
? $this->lineProperties['style']['arrow']['head']['size'] = (string) $head_arrow_size
|
162 |
-
: null;
|
163 |
-
(!is_null($end_arrow_type))
|
164 |
-
? $this->lineProperties['style']['arrow']['end']['type'] = (string) $end_arrow_type
|
165 |
-
: null;
|
166 |
-
(!is_null($end_arrow_size))
|
167 |
-
? $this->lineProperties['style']['arrow']['end']['size'] = (string) $end_arrow_size
|
168 |
-
: null;
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Get Line Color Property
|
173 |
-
*
|
174 |
-
* @param string $parameter
|
175 |
-
*
|
176 |
-
* @return string
|
177 |
-
*/
|
178 |
-
|
179 |
-
public function getLineColorProperty($parameter)
|
180 |
-
{
|
181 |
-
return $this->lineProperties['color'][$parameter];
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Get Line Style Property
|
186 |
-
*
|
187 |
-
* @param array|string $elements
|
188 |
-
*
|
189 |
-
* @return string
|
190 |
-
*/
|
191 |
-
|
192 |
-
public function getLineStyleProperty($elements)
|
193 |
-
{
|
194 |
-
return $this->getArrayElementsValue($this->lineProperties['style'], $elements);
|
195 |
-
}
|
196 |
-
|
197 |
-
/**
|
198 |
-
* Set Glow Properties
|
199 |
-
*
|
200 |
-
* @param float $size
|
201 |
-
* @param string $color_value
|
202 |
-
* @param int $color_alpha
|
203 |
-
* @param string $color_type
|
204 |
-
*
|
205 |
-
*/
|
206 |
-
|
207 |
-
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null)
|
208 |
-
{
|
209 |
-
$this
|
210 |
-
->activateObject()
|
211 |
-
->setGlowSize($size)
|
212 |
-
->setGlowColor($color_value, $color_alpha, $color_type);
|
213 |
-
}
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Get Glow Color Property
|
217 |
-
*
|
218 |
-
* @param string $property
|
219 |
-
*
|
220 |
-
* @return string
|
221 |
-
*/
|
222 |
-
|
223 |
-
public function getGlowColor($property)
|
224 |
-
{
|
225 |
-
return $this->glowProperties['color'][$property];
|
226 |
-
}
|
227 |
-
|
228 |
-
/**
|
229 |
-
* Get Glow Size
|
230 |
-
*
|
231 |
-
* @return string
|
232 |
-
*/
|
233 |
-
|
234 |
-
public function getGlowSize()
|
235 |
-
{
|
236 |
-
return $this->glowProperties['size'];
|
237 |
-
}
|
238 |
-
|
239 |
-
/**
|
240 |
-
* Set Glow Size
|
241 |
-
*
|
242 |
-
* @param float $size
|
243 |
-
*
|
244 |
-
* @return PHPExcel_Chart_GridLines
|
245 |
-
*/
|
246 |
-
|
247 |
-
private function setGlowSize($size)
|
248 |
-
{
|
249 |
-
$this->glowProperties['size'] = $this->getExcelPointsWidth((float) $size);
|
250 |
-
|
251 |
-
return $this;
|
252 |
-
}
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Set Glow Color
|
256 |
-
*
|
257 |
-
* @param string $color
|
258 |
-
* @param int $alpha
|
259 |
-
* @param string $type
|
260 |
-
*
|
261 |
-
* @return PHPExcel_Chart_GridLines
|
262 |
-
*/
|
263 |
-
|
264 |
-
private function setGlowColor($color, $alpha, $type)
|
265 |
-
{
|
266 |
-
if (!is_null($color)) {
|
267 |
-
$this->glowProperties['color']['value'] = (string) $color;
|
268 |
-
}
|
269 |
-
if (!is_null($alpha)) {
|
270 |
-
$this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
|
271 |
-
}
|
272 |
-
if (!is_null($type)) {
|
273 |
-
$this->glowProperties['color']['type'] = (string) $type;
|
274 |
-
}
|
275 |
-
|
276 |
-
return $this;
|
277 |
-
}
|
278 |
-
|
279 |
-
/**
|
280 |
-
* Get Line Style Arrow Parameters
|
281 |
-
*
|
282 |
-
* @param string $arrow_selector
|
283 |
-
* @param string $property_selector
|
284 |
-
*
|
285 |
-
* @return string
|
286 |
-
*/
|
287 |
-
|
288 |
-
public function getLineStyleArrowParameters($arrow_selector, $property_selector)
|
289 |
-
{
|
290 |
-
return $this->getLineStyleArrowSize($this->lineProperties['style']['arrow'][$arrow_selector]['size'], $property_selector);
|
291 |
-
}
|
292 |
-
|
293 |
-
/**
|
294 |
-
* Set Shadow Properties
|
295 |
-
*
|
296 |
-
* @param int $sh_presets
|
297 |
-
* @param string $sh_color_value
|
298 |
-
* @param string $sh_color_type
|
299 |
-
* @param int $sh_color_alpha
|
300 |
-
* @param string $sh_blur
|
301 |
-
* @param int $sh_angle
|
302 |
-
* @param float $sh_distance
|
303 |
-
*
|
304 |
-
*/
|
305 |
-
|
306 |
-
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null)
|
307 |
-
{
|
308 |
-
$this->activateObject()
|
309 |
-
->setShadowPresetsProperties((int) $sh_presets)
|
310 |
-
->setShadowColor(
|
311 |
-
is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value,
|
312 |
-
is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha),
|
313 |
-
is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type
|
314 |
-
)
|
315 |
-
->setShadowBlur($sh_blur)
|
316 |
-
->setShadowAngle($sh_angle)
|
317 |
-
->setShadowDistance($sh_distance);
|
318 |
-
}
|
319 |
-
|
320 |
-
/**
|
321 |
-
* Set Shadow Presets Properties
|
322 |
-
*
|
323 |
-
* @param int $shadow_presets
|
324 |
-
*
|
325 |
-
* @return PHPExcel_Chart_GridLines
|
326 |
-
*/
|
327 |
-
|
328 |
-
private function setShadowPresetsProperties($shadow_presets)
|
329 |
-
{
|
330 |
-
$this->shadowProperties['presets'] = $shadow_presets;
|
331 |
-
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
|
332 |
-
|
333 |
-
return $this;
|
334 |
-
}
|
335 |
-
|
336 |
-
/**
|
337 |
-
* Set Shadow Properties Values
|
338 |
-
*
|
339 |
-
* @param array $properties_map
|
340 |
-
* @param * $reference
|
341 |
-
*
|
342 |
-
* @return PHPExcel_Chart_GridLines
|
343 |
-
*/
|
344 |
-
|
345 |
-
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
|
346 |
-
{
|
347 |
-
$base_reference = $reference;
|
348 |
-
foreach ($properties_map as $property_key => $property_val) {
|
349 |
-
if (is_array($property_val)) {
|
350 |
-
if ($reference === null) {
|
351 |
-
$reference = & $this->shadowProperties[$property_key];
|
352 |
-
} else {
|
353 |
-
$reference = & $reference[$property_key];
|
354 |
-
}
|
355 |
-
$this->setShadowProperiesMapValues($property_val, $reference);
|
356 |
-
} else {
|
357 |
-
if ($base_reference === null) {
|
358 |
-
$this->shadowProperties[$property_key] = $property_val;
|
359 |
-
} else {
|
360 |
-
$reference[$property_key] = $property_val;
|
361 |
-
}
|
362 |
-
}
|
363 |
-
}
|
364 |
-
|
365 |
-
return $this;
|
366 |
-
}
|
367 |
-
|
368 |
-
/**
|
369 |
-
* Set Shadow Color
|
370 |
-
*
|
371 |
-
* @param string $color
|
372 |
-
* @param int $alpha
|
373 |
-
* @param string $type
|
374 |
-
* @return PHPExcel_Chart_GridLines
|
375 |
-
*/
|
376 |
-
private function setShadowColor($color, $alpha, $type)
|
377 |
-
{
|
378 |
-
if (!is_null($color)) {
|
379 |
-
$this->shadowProperties['color']['value'] = (string) $color;
|
380 |
-
}
|
381 |
-
if (!is_null($alpha)) {
|
382 |
-
$this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
|
383 |
-
}
|
384 |
-
if (!is_null($type)) {
|
385 |
-
$this->shadowProperties['color']['type'] = (string) $type;
|
386 |
-
}
|
387 |
-
|
388 |
-
return $this;
|
389 |
-
}
|
390 |
-
|
391 |
-
/**
|
392 |
-
* Set Shadow Blur
|
393 |
-
*
|
394 |
-
* @param float $blur
|
395 |
-
*
|
396 |
-
* @return PHPExcel_Chart_GridLines
|
397 |
-
*/
|
398 |
-
private function setShadowBlur($blur)
|
399 |
-
{
|
400 |
-
if ($blur !== null) {
|
401 |
-
$this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur);
|
402 |
-
}
|
403 |
-
|
404 |
-
return $this;
|
405 |
-
}
|
406 |
-
|
407 |
-
/**
|
408 |
-
* Set Shadow Angle
|
409 |
-
*
|
410 |
-
* @param int $angle
|
411 |
-
* @return PHPExcel_Chart_GridLines
|
412 |
-
*/
|
413 |
-
|
414 |
-
private function setShadowAngle($angle)
|
415 |
-
{
|
416 |
-
if ($angle !== null) {
|
417 |
-
$this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle);
|
418 |
-
}
|
419 |
-
|
420 |
-
return $this;
|
421 |
-
}
|
422 |
-
|
423 |
-
/**
|
424 |
-
* Set Shadow Distance
|
425 |
-
*
|
426 |
-
* @param float $distance
|
427 |
-
* @return PHPExcel_Chart_GridLines
|
428 |
-
*/
|
429 |
-
private function setShadowDistance($distance)
|
430 |
-
{
|
431 |
-
if ($distance !== null) {
|
432 |
-
$this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance);
|
433 |
-
}
|
434 |
-
|
435 |
-
return $this;
|
436 |
-
}
|
437 |
-
|
438 |
-
/**
|
439 |
-
* Get Shadow Property
|
440 |
-
*
|
441 |
-
* @param string $elements
|
442 |
-
* @param array $elements
|
443 |
-
* @return string
|
444 |
-
*/
|
445 |
-
public function getShadowProperty($elements)
|
446 |
-
{
|
447 |
-
return $this->getArrayElementsValue($this->shadowProperties, $elements);
|
448 |
-
}
|
449 |
-
|
450 |
-
/**
|
451 |
-
* Set Soft Edges Size
|
452 |
-
*
|
453 |
-
* @param float $size
|
454 |
-
*/
|
455 |
-
public function setSoftEdgesSize($size)
|
456 |
-
{
|
457 |
-
if (!is_null($size)) {
|
458 |
-
$this->activateObject();
|
459 |
-
$softEdges['size'] = (string) $this->getExcelPointsWidth($size);
|
460 |
-
}
|
461 |
-
}
|
462 |
-
|
463 |
-
/**
|
464 |
-
* Get Soft Edges Size
|
465 |
-
*
|
466 |
-
* @return string
|
467 |
-
*/
|
468 |
-
public function getSoftEdgesSize()
|
469 |
-
{
|
470 |
-
return $this->softEdges['size'];
|
471 |
-
}
|
472 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Created by PhpStorm.
|
5 |
+
* User: Wiktor Trzonkowski
|
6 |
+
* Date: 7/2/14
|
7 |
+
* Time: 2:36 PM
|
8 |
+
*/
|
9 |
+
|
10 |
+
class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
|
11 |
+
{
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Properties of Class:
|
15 |
+
* Object State (State for Minor Tick Mark) @var bool
|
16 |
+
* Line Properties @var array of mixed
|
17 |
+
* Shadow Properties @var array of mixed
|
18 |
+
* Glow Properties @var array of mixed
|
19 |
+
* Soft Properties @var array of mixed
|
20 |
+
*
|
21 |
+
*/
|
22 |
+
|
23 |
+
private $objectState = false;
|
24 |
+
|
25 |
+
private $lineProperties = array(
|
26 |
+
'color' => array(
|
27 |
+
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
28 |
+
'value' => null,
|
29 |
+
'alpha' => 0
|
30 |
+
),
|
31 |
+
'style' => array(
|
32 |
+
'width' => '9525',
|
33 |
+
'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
|
34 |
+
'dash' => self::LINE_STYLE_DASH_SOLID,
|
35 |
+
'cap' => self::LINE_STYLE_CAP_FLAT,
|
36 |
+
'join' => self::LINE_STYLE_JOIN_BEVEL,
|
37 |
+
'arrow' => array(
|
38 |
+
'head' => array(
|
39 |
+
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
40 |
+
'size' => self::LINE_STYLE_ARROW_SIZE_5
|
41 |
+
),
|
42 |
+
'end' => array(
|
43 |
+
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
44 |
+
'size' => self::LINE_STYLE_ARROW_SIZE_8
|
45 |
+
),
|
46 |
+
)
|
47 |
+
)
|
48 |
+
);
|
49 |
+
|
50 |
+
private $shadowProperties = array(
|
51 |
+
'presets' => self::SHADOW_PRESETS_NOSHADOW,
|
52 |
+
'effect' => null,
|
53 |
+
'color' => array(
|
54 |
+
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
55 |
+
'value' => 'black',
|
56 |
+
'alpha' => 85,
|
57 |
+
),
|
58 |
+
'size' => array(
|
59 |
+
'sx' => null,
|
60 |
+
'sy' => null,
|
61 |
+
'kx' => null
|
62 |
+
),
|
63 |
+
'blur' => null,
|
64 |
+
'direction' => null,
|
65 |
+
'distance' => null,
|
66 |
+
'algn' => null,
|
67 |
+
'rotWithShape' => null
|
68 |
+
);
|
69 |
+
|
70 |
+
private $glowProperties = array(
|
71 |
+
'size' => null,
|
72 |
+
'color' => array(
|
73 |
+
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
74 |
+
'value' => 'black',
|
75 |
+
'alpha' => 40
|
76 |
+
)
|
77 |
+
);
|
78 |
+
|
79 |
+
private $softEdges = array(
|
80 |
+
'size' => null
|
81 |
+
);
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Get Object State
|
85 |
+
*
|
86 |
+
* @return bool
|
87 |
+
*/
|
88 |
+
|
89 |
+
public function getObjectState()
|
90 |
+
{
|
91 |
+
return $this->objectState;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Change Object State to True
|
96 |
+
*
|
97 |
+
* @return PHPExcel_Chart_GridLines
|
98 |
+
*/
|
99 |
+
|
100 |
+
private function activateObject()
|
101 |
+
{
|
102 |
+
$this->objectState = true;
|
103 |
+
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Set Line Color Properties
|
109 |
+
*
|
110 |
+
* @param string $value
|
111 |
+
* @param int $alpha
|
112 |
+
* @param string $type
|
113 |
+
*/
|
114 |
+
|
115 |
+
public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD)
|
116 |
+
{
|
117 |
+
$this->activateObject()
|
118 |
+
->lineProperties['color'] = $this->setColorProperties(
|
119 |
+
$value,
|
120 |
+
$alpha,
|
121 |
+
$type
|
122 |
+
);
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Set Line Color Properties
|
127 |
+
*
|
128 |
+
* @param float $line_width
|
129 |
+
* @param string $compound_type
|
130 |
+
* @param string $dash_type
|
131 |
+
* @param string $cap_type
|
132 |
+
* @param string $join_type
|
133 |
+
* @param string $head_arrow_type
|
134 |
+
* @param string $head_arrow_size
|
135 |
+
* @param string $end_arrow_type
|
136 |
+
* @param string $end_arrow_size
|
137 |
+
*/
|
138 |
+
|
139 |
+
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null)
|
140 |
+
{
|
141 |
+
$this->activateObject();
|
142 |
+
(!is_null($line_width))
|
143 |
+
? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $line_width)
|
144 |
+
: null;
|
145 |
+
(!is_null($compound_type))
|
146 |
+
? $this->lineProperties['style']['compound'] = (string) $compound_type
|
147 |
+
: null;
|
148 |
+
(!is_null($dash_type))
|
149 |
+
? $this->lineProperties['style']['dash'] = (string) $dash_type
|
150 |
+
: null;
|
151 |
+
(!is_null($cap_type))
|
152 |
+
? $this->lineProperties['style']['cap'] = (string) $cap_type
|
153 |
+
: null;
|
154 |
+
(!is_null($join_type))
|
155 |
+
? $this->lineProperties['style']['join'] = (string) $join_type
|
156 |
+
: null;
|
157 |
+
(!is_null($head_arrow_type))
|
158 |
+
? $this->lineProperties['style']['arrow']['head']['type'] = (string) $head_arrow_type
|
159 |
+
: null;
|
160 |
+
(!is_null($head_arrow_size))
|
161 |
+
? $this->lineProperties['style']['arrow']['head']['size'] = (string) $head_arrow_size
|
162 |
+
: null;
|
163 |
+
(!is_null($end_arrow_type))
|
164 |
+
? $this->lineProperties['style']['arrow']['end']['type'] = (string) $end_arrow_type
|
165 |
+
: null;
|
166 |
+
(!is_null($end_arrow_size))
|
167 |
+
? $this->lineProperties['style']['arrow']['end']['size'] = (string) $end_arrow_size
|
168 |
+
: null;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Get Line Color Property
|
173 |
+
*
|
174 |
+
* @param string $parameter
|
175 |
+
*
|
176 |
+
* @return string
|
177 |
+
*/
|
178 |
+
|
179 |
+
public function getLineColorProperty($parameter)
|
180 |
+
{
|
181 |
+
return $this->lineProperties['color'][$parameter];
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Get Line Style Property
|
186 |
+
*
|
187 |
+
* @param array|string $elements
|
188 |
+
*
|
189 |
+
* @return string
|
190 |
+
*/
|
191 |
+
|
192 |
+
public function getLineStyleProperty($elements)
|
193 |
+
{
|
194 |
+
return $this->getArrayElementsValue($this->lineProperties['style'], $elements);
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Set Glow Properties
|
199 |
+
*
|
200 |
+
* @param float $size
|
201 |
+
* @param string $color_value
|
202 |
+
* @param int $color_alpha
|
203 |
+
* @param string $color_type
|
204 |
+
*
|
205 |
+
*/
|
206 |
+
|
207 |
+
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null)
|
208 |
+
{
|
209 |
+
$this
|
210 |
+
->activateObject()
|
211 |
+
->setGlowSize($size)
|
212 |
+
->setGlowColor($color_value, $color_alpha, $color_type);
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Get Glow Color Property
|
217 |
+
*
|
218 |
+
* @param string $property
|
219 |
+
*
|
220 |
+
* @return string
|
221 |
+
*/
|
222 |
+
|
223 |
+
public function getGlowColor($property)
|
224 |
+
{
|
225 |
+
return $this->glowProperties['color'][$property];
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Get Glow Size
|
230 |
+
*
|
231 |
+
* @return string
|
232 |
+
*/
|
233 |
+
|
234 |
+
public function getGlowSize()
|
235 |
+
{
|
236 |
+
return $this->glowProperties['size'];
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Set Glow Size
|
241 |
+
*
|
242 |
+
* @param float $size
|
243 |
+
*
|
244 |
+
* @return PHPExcel_Chart_GridLines
|
245 |
+
*/
|
246 |
+
|
247 |
+
private function setGlowSize($size)
|
248 |
+
{
|
249 |
+
$this->glowProperties['size'] = $this->getExcelPointsWidth((float) $size);
|
250 |
+
|
251 |
+
return $this;
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Set Glow Color
|
256 |
+
*
|
257 |
+
* @param string $color
|
258 |
+
* @param int $alpha
|
259 |
+
* @param string $type
|
260 |
+
*
|
261 |
+
* @return PHPExcel_Chart_GridLines
|
262 |
+
*/
|
263 |
+
|
264 |
+
private function setGlowColor($color, $alpha, $type)
|
265 |
+
{
|
266 |
+
if (!is_null($color)) {
|
267 |
+
$this->glowProperties['color']['value'] = (string) $color;
|
268 |
+
}
|
269 |
+
if (!is_null($alpha)) {
|
270 |
+
$this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
|
271 |
+
}
|
272 |
+
if (!is_null($type)) {
|
273 |
+
$this->glowProperties['color']['type'] = (string) $type;
|
274 |
+
}
|
275 |
+
|
276 |
+
return $this;
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Get Line Style Arrow Parameters
|
281 |
+
*
|
282 |
+
* @param string $arrow_selector
|
283 |
+
* @param string $property_selector
|
284 |
+
*
|
285 |
+
* @return string
|
286 |
+
*/
|
287 |
+
|
288 |
+
public function getLineStyleArrowParameters($arrow_selector, $property_selector)
|
289 |
+
{
|
290 |
+
return $this->getLineStyleArrowSize($this->lineProperties['style']['arrow'][$arrow_selector]['size'], $property_selector);
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Set Shadow Properties
|
295 |
+
*
|
296 |
+
* @param int $sh_presets
|
297 |
+
* @param string $sh_color_value
|
298 |
+
* @param string $sh_color_type
|
299 |
+
* @param int $sh_color_alpha
|
300 |
+
* @param string $sh_blur
|
301 |
+
* @param int $sh_angle
|
302 |
+
* @param float $sh_distance
|
303 |
+
*
|
304 |
+
*/
|
305 |
+
|
306 |
+
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null)
|
307 |
+
{
|
308 |
+
$this->activateObject()
|
309 |
+
->setShadowPresetsProperties((int) $sh_presets)
|
310 |
+
->setShadowColor(
|
311 |
+
is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value,
|
312 |
+
is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha),
|
313 |
+
is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type
|
314 |
+
)
|
315 |
+
->setShadowBlur($sh_blur)
|
316 |
+
->setShadowAngle($sh_angle)
|
317 |
+
->setShadowDistance($sh_distance);
|
318 |
+
}
|
319 |
+
|
320 |
+
/**
|
321 |
+
* Set Shadow Presets Properties
|
322 |
+
*
|
323 |
+
* @param int $shadow_presets
|
324 |
+
*
|
325 |
+
* @return PHPExcel_Chart_GridLines
|
326 |
+
*/
|
327 |
+
|
328 |
+
private function setShadowPresetsProperties($shadow_presets)
|
329 |
+
{
|
330 |
+
$this->shadowProperties['presets'] = $shadow_presets;
|
331 |
+
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
|
332 |
+
|
333 |
+
return $this;
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Set Shadow Properties Values
|
338 |
+
*
|
339 |
+
* @param array $properties_map
|
340 |
+
* @param * $reference
|
341 |
+
*
|
342 |
+
* @return PHPExcel_Chart_GridLines
|
343 |
+
*/
|
344 |
+
|
345 |
+
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
|
346 |
+
{
|
347 |
+
$base_reference = $reference;
|
348 |
+
foreach ($properties_map as $property_key => $property_val) {
|
349 |
+
if (is_array($property_val)) {
|
350 |
+
if ($reference === null) {
|
351 |
+
$reference = & $this->shadowProperties[$property_key];
|
352 |
+
} else {
|
353 |
+
$reference = & $reference[$property_key];
|
354 |
+
}
|
355 |
+
$this->setShadowProperiesMapValues($property_val, $reference);
|
356 |
+
} else {
|
357 |
+
if ($base_reference === null) {
|
358 |
+
$this->shadowProperties[$property_key] = $property_val;
|
359 |
+
} else {
|
360 |
+
$reference[$property_key] = $property_val;
|
361 |
+
}
|
362 |
+
}
|
363 |
+
}
|
364 |
+
|
365 |
+
return $this;
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* Set Shadow Color
|
370 |
+
*
|
371 |
+
* @param string $color
|
372 |
+
* @param int $alpha
|
373 |
+
* @param string $type
|
374 |
+
* @return PHPExcel_Chart_GridLines
|
375 |
+
*/
|
376 |
+
private function setShadowColor($color, $alpha, $type)
|
377 |
+
{
|
378 |
+
if (!is_null($color)) {
|
379 |
+
$this->shadowProperties['color']['value'] = (string) $color;
|
380 |
+
}
|
381 |
+
if (!is_null($alpha)) {
|
382 |
+
$this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
|
383 |
+
}
|
384 |
+
if (!is_null($type)) {
|
385 |
+
$this->shadowProperties['color']['type'] = (string) $type;
|
386 |
+
}
|
387 |
+
|
388 |
+
return $this;
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Set Shadow Blur
|
393 |
+
*
|
394 |
+
* @param float $blur
|
395 |
+
*
|
396 |
+
* @return PHPExcel_Chart_GridLines
|
397 |
+
*/
|
398 |
+
private function setShadowBlur($blur)
|
399 |
+
{
|
400 |
+
if ($blur !== null) {
|
401 |
+
$this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur);
|
402 |
+
}
|
403 |
+
|
404 |
+
return $this;
|
405 |
+
}
|
406 |
+
|
407 |
+
/**
|
408 |
+
* Set Shadow Angle
|
409 |
+
*
|
410 |
+
* @param int $angle
|
411 |
+
* @return PHPExcel_Chart_GridLines
|
412 |
+
*/
|
413 |
+
|
414 |
+
private function setShadowAngle($angle)
|
415 |
+
{
|
416 |
+
if ($angle !== null) {
|
417 |
+
$this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle);
|
418 |
+
}
|
419 |
+
|
420 |
+
return $this;
|
421 |
+
}
|
422 |
+
|
423 |
+
/**
|
424 |
+
* Set Shadow Distance
|
425 |
+
*
|
426 |
+
* @param float $distance
|
427 |
+
* @return PHPExcel_Chart_GridLines
|
428 |
+
*/
|
429 |
+
private function setShadowDistance($distance)
|
430 |
+
{
|
431 |
+
if ($distance !== null) {
|
432 |
+
$this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance);
|
433 |
+
}
|
434 |
+
|
435 |
+
return $this;
|
436 |
+
}
|
437 |
+
|
438 |
+
/**
|
439 |
+
* Get Shadow Property
|
440 |
+
*
|
441 |
+
* @param string $elements
|
442 |
+
* @param array $elements
|
443 |
+
* @return string
|
444 |
+
*/
|
445 |
+
public function getShadowProperty($elements)
|
446 |
+
{
|
447 |
+
return $this->getArrayElementsValue($this->shadowProperties, $elements);
|
448 |
+
}
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Set Soft Edges Size
|
452 |
+
*
|
453 |
+
* @param float $size
|
454 |
+
*/
|
455 |
+
public function setSoftEdgesSize($size)
|
456 |
+
{
|
457 |
+
if (!is_null($size)) {
|
458 |
+
$this->activateObject();
|
459 |
+
$softEdges['size'] = (string) $this->getExcelPointsWidth($size);
|
460 |
+
}
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* Get Soft Edges Size
|
465 |
+
*
|
466 |
+
* @return string
|
467 |
+
*/
|
468 |
+
public function getSoftEdgesSize()
|
469 |
+
{
|
470 |
+
return $this->softEdges['size'];
|
471 |
+
}
|
472 |
+
}
|
PHPExcel/Classes/PHPExcel/Chart/Properties.php
CHANGED
@@ -1,363 +1,363 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Created by PhpStorm.
|
4 |
-
* User: nhw2h8s
|
5 |
-
* Date: 7/2/14
|
6 |
-
* Time: 5:45 PM
|
7 |
-
*/
|
8 |
-
|
9 |
-
abstract class PHPExcel_Chart_Properties
|
10 |
-
{
|
11 |
-
const
|
12 |
-
EXCEL_COLOR_TYPE_STANDARD = 'prstClr',
|
13 |
-
EXCEL_COLOR_TYPE_SCHEME = 'schemeClr',
|
14 |
-
EXCEL_COLOR_TYPE_ARGB = 'srgbClr';
|
15 |
-
|
16 |
-
const
|
17 |
-
AXIS_LABELS_LOW = 'low',
|
18 |
-
AXIS_LABELS_HIGH = 'high',
|
19 |
-
AXIS_LABELS_NEXT_TO = 'nextTo',
|
20 |
-
AXIS_LABELS_NONE = 'none';
|
21 |
-
|
22 |
-
const
|
23 |
-
TICK_MARK_NONE = 'none',
|
24 |
-
TICK_MARK_INSIDE = 'in',
|
25 |
-
TICK_MARK_OUTSIDE = 'out',
|
26 |
-
TICK_MARK_CROSS = 'cross';
|
27 |
-
|
28 |
-
const
|
29 |
-
HORIZONTAL_CROSSES_AUTOZERO = 'autoZero',
|
30 |
-
HORIZONTAL_CROSSES_MAXIMUM = 'max';
|
31 |
-
|
32 |
-
const
|
33 |
-
FORMAT_CODE_GENERAL = 'General',
|
34 |
-
FORMAT_CODE_NUMBER = '#,##0.00',
|
35 |
-
FORMAT_CODE_CURRENCY = '$#,##0.00',
|
36 |
-
FORMAT_CODE_ACCOUNTING = '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)',
|
37 |
-
FORMAT_CODE_DATE = 'm/d/yyyy',
|
38 |
-
FORMAT_CODE_TIME = '[$-F400]h:mm:ss AM/PM',
|
39 |
-
FORMAT_CODE_PERCENTAGE = '0.00%',
|
40 |
-
FORMAT_CODE_FRACTION = '# ?/?',
|
41 |
-
FORMAT_CODE_SCIENTIFIC = '0.00E+00',
|
42 |
-
FORMAT_CODE_TEXT = '@',
|
43 |
-
FORMAT_CODE_SPECIAL = '00000';
|
44 |
-
|
45 |
-
const
|
46 |
-
ORIENTATION_NORMAL = 'minMax',
|
47 |
-
ORIENTATION_REVERSED = 'maxMin';
|
48 |
-
|
49 |
-
const
|
50 |
-
LINE_STYLE_COMPOUND_SIMPLE = 'sng',
|
51 |
-
LINE_STYLE_COMPOUND_DOUBLE = 'dbl',
|
52 |
-
LINE_STYLE_COMPOUND_THICKTHIN = 'thickThin',
|
53 |
-
LINE_STYLE_COMPOUND_THINTHICK = 'thinThick',
|
54 |
-
LINE_STYLE_COMPOUND_TRIPLE = 'tri',
|
55 |
-
|
56 |
-
LINE_STYLE_DASH_SOLID = 'solid',
|
57 |
-
LINE_STYLE_DASH_ROUND_DOT = 'sysDot',
|
58 |
-
LINE_STYLE_DASH_SQUERE_DOT = 'sysDash',
|
59 |
-
LINE_STYPE_DASH_DASH = 'dash',
|
60 |
-
LINE_STYLE_DASH_DASH_DOT = 'dashDot',
|
61 |
-
LINE_STYLE_DASH_LONG_DASH = 'lgDash',
|
62 |
-
LINE_STYLE_DASH_LONG_DASH_DOT = 'lgDashDot',
|
63 |
-
LINE_STYLE_DASH_LONG_DASH_DOT_DOT = 'lgDashDotDot',
|
64 |
-
|
65 |
-
LINE_STYLE_CAP_SQUARE = 'sq',
|
66 |
-
LINE_STYLE_CAP_ROUND = 'rnd',
|
67 |
-
LINE_STYLE_CAP_FLAT = 'flat',
|
68 |
-
|
69 |
-
LINE_STYLE_JOIN_ROUND = 'bevel',
|
70 |
-
LINE_STYLE_JOIN_MITER = 'miter',
|
71 |
-
LINE_STYLE_JOIN_BEVEL = 'bevel',
|
72 |
-
|
73 |
-
LINE_STYLE_ARROW_TYPE_NOARROW = null,
|
74 |
-
LINE_STYLE_ARROW_TYPE_ARROW = 'triangle',
|
75 |
-
LINE_STYLE_ARROW_TYPE_OPEN = 'arrow',
|
76 |
-
LINE_STYLE_ARROW_TYPE_STEALTH = 'stealth',
|
77 |
-
LINE_STYLE_ARROW_TYPE_DIAMOND = 'diamond',
|
78 |
-
LINE_STYLE_ARROW_TYPE_OVAL = 'oval',
|
79 |
-
|
80 |
-
LINE_STYLE_ARROW_SIZE_1 = 1,
|
81 |
-
LINE_STYLE_ARROW_SIZE_2 = 2,
|
82 |
-
LINE_STYLE_ARROW_SIZE_3 = 3,
|
83 |
-
LINE_STYLE_ARROW_SIZE_4 = 4,
|
84 |
-
LINE_STYLE_ARROW_SIZE_5 = 5,
|
85 |
-
LINE_STYLE_ARROW_SIZE_6 = 6,
|
86 |
-
LINE_STYLE_ARROW_SIZE_7 = 7,
|
87 |
-
LINE_STYLE_ARROW_SIZE_8 = 8,
|
88 |
-
LINE_STYLE_ARROW_SIZE_9 = 9;
|
89 |
-
|
90 |
-
const
|
91 |
-
SHADOW_PRESETS_NOSHADOW = null,
|
92 |
-
SHADOW_PRESETS_OUTER_BOTTTOM_RIGHT = 1,
|
93 |
-
SHADOW_PRESETS_OUTER_BOTTOM = 2,
|
94 |
-
SHADOW_PRESETS_OUTER_BOTTOM_LEFT = 3,
|
95 |
-
SHADOW_PRESETS_OUTER_RIGHT = 4,
|
96 |
-
SHADOW_PRESETS_OUTER_CENTER = 5,
|
97 |
-
SHADOW_PRESETS_OUTER_LEFT = 6,
|
98 |
-
SHADOW_PRESETS_OUTER_TOP_RIGHT = 7,
|
99 |
-
SHADOW_PRESETS_OUTER_TOP = 8,
|
100 |
-
SHADOW_PRESETS_OUTER_TOP_LEFT = 9,
|
101 |
-
SHADOW_PRESETS_INNER_BOTTTOM_RIGHT = 10,
|
102 |
-
SHADOW_PRESETS_INNER_BOTTOM = 11,
|
103 |
-
SHADOW_PRESETS_INNER_BOTTOM_LEFT = 12,
|
104 |
-
SHADOW_PRESETS_INNER_RIGHT = 13,
|
105 |
-
SHADOW_PRESETS_INNER_CENTER = 14,
|
106 |
-
SHADOW_PRESETS_INNER_LEFT = 15,
|
107 |
-
SHADOW_PRESETS_INNER_TOP_RIGHT = 16,
|
108 |
-
SHADOW_PRESETS_INNER_TOP = 17,
|
109 |
-
SHADOW_PRESETS_INNER_TOP_LEFT = 18,
|
110 |
-
SHADOW_PRESETS_PERSPECTIVE_BELOW = 19,
|
111 |
-
SHADOW_PRESETS_PERSPECTIVE_UPPER_RIGHT = 20,
|
112 |
-
SHADOW_PRESETS_PERSPECTIVE_UPPER_LEFT = 21,
|
113 |
-
SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT = 22,
|
114 |
-
SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT = 23;
|
115 |
-
|
116 |
-
protected function getExcelPointsWidth($width)
|
117 |
-
{
|
118 |
-
return $width * 12700;
|
119 |
-
}
|
120 |
-
|
121 |
-
protected function getExcelPointsAngle($angle)
|
122 |
-
{
|
123 |
-
return $angle * 60000;
|
124 |
-
}
|
125 |
-
|
126 |
-
protected function getTrueAlpha($alpha)
|
127 |
-
{
|
128 |
-
return (string) 100 - $alpha . '000';
|
129 |
-
}
|
130 |
-
|
131 |
-
protected function setColorProperties($color, $alpha, $type)
|
132 |
-
{
|
133 |
-
return array(
|
134 |
-
'type' => (string) $type,
|
135 |
-
'value' => (string) $color,
|
136 |
-
'alpha' => (string) $this->getTrueAlpha($alpha)
|
137 |
-
);
|
138 |
-
}
|
139 |
-
|
140 |
-
protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
|
141 |
-
{
|
142 |
-
$sizes = array(
|
143 |
-
1 => array('w' => 'sm', 'len' => 'sm'),
|
144 |
-
2 => array('w' => 'sm', 'len' => 'med'),
|
145 |
-
3 => array('w' => 'sm', 'len' => 'lg'),
|
146 |
-
4 => array('w' => 'med', 'len' => 'sm'),
|
147 |
-
5 => array('w' => 'med', 'len' => 'med'),
|
148 |
-
6 => array('w' => 'med', 'len' => 'lg'),
|
149 |
-
7 => array('w' => 'lg', 'len' => 'sm'),
|
150 |
-
8 => array('w' => 'lg', 'len' => 'med'),
|
151 |
-
9 => array('w' => 'lg', 'len' => 'lg')
|
152 |
-
);
|
153 |
-
|
154 |
-
return $sizes[$array_selector][$array_kay_selector];
|
155 |
-
}
|
156 |
-
|
157 |
-
protected function getShadowPresetsMap($shadow_presets_option)
|
158 |
-
{
|
159 |
-
$presets_options = array(
|
160 |
-
//OUTER
|
161 |
-
1 => array(
|
162 |
-
'effect' => 'outerShdw',
|
163 |
-
'blur' => '50800',
|
164 |
-
'distance' => '38100',
|
165 |
-
'direction' => '2700000',
|
166 |
-
'algn' => 'tl',
|
167 |
-
'rotWithShape' => '0'
|
168 |
-
),
|
169 |
-
2 => array(
|
170 |
-
'effect' => 'outerShdw',
|
171 |
-
'blur' => '50800',
|
172 |
-
'distance' => '38100',
|
173 |
-
'direction' => '5400000',
|
174 |
-
'algn' => 't',
|
175 |
-
'rotWithShape' => '0'
|
176 |
-
),
|
177 |
-
3 => array(
|
178 |
-
'effect' => 'outerShdw',
|
179 |
-
'blur' => '50800',
|
180 |
-
'distance' => '38100',
|
181 |
-
'direction' => '8100000',
|
182 |
-
'algn' => 'tr',
|
183 |
-
'rotWithShape' => '0'
|
184 |
-
),
|
185 |
-
4 => array(
|
186 |
-
'effect' => 'outerShdw',
|
187 |
-
'blur' => '50800',
|
188 |
-
'distance' => '38100',
|
189 |
-
'algn' => 'l',
|
190 |
-
'rotWithShape' => '0'
|
191 |
-
),
|
192 |
-
5 => array(
|
193 |
-
'effect' => 'outerShdw',
|
194 |
-
'size' => array(
|
195 |
-
'sx' => '102000',
|
196 |
-
'sy' => '102000'
|
197 |
-
)
|
198 |
-
,
|
199 |
-
'blur' => '63500',
|
200 |
-
'distance' => '38100',
|
201 |
-
'algn' => 'ctr',
|
202 |
-
'rotWithShape' => '0'
|
203 |
-
),
|
204 |
-
6 => array(
|
205 |
-
'effect' => 'outerShdw',
|
206 |
-
'blur' => '50800',
|
207 |
-
'distance' => '38100',
|
208 |
-
'direction' => '10800000',
|
209 |
-
'algn' => 'r',
|
210 |
-
'rotWithShape' => '0'
|
211 |
-
),
|
212 |
-
7 => array(
|
213 |
-
'effect' => 'outerShdw',
|
214 |
-
'blur' => '50800',
|
215 |
-
'distance' => '38100',
|
216 |
-
'direction' => '18900000',
|
217 |
-
'algn' => 'bl',
|
218 |
-
'rotWithShape' => '0'
|
219 |
-
),
|
220 |
-
8 => array(
|
221 |
-
'effect' => 'outerShdw',
|
222 |
-
'blur' => '50800',
|
223 |
-
'distance' => '38100',
|
224 |
-
'direction' => '16200000',
|
225 |
-
'rotWithShape' => '0'
|
226 |
-
),
|
227 |
-
9 => array(
|
228 |
-
'effect' => 'outerShdw',
|
229 |
-
'blur' => '50800',
|
230 |
-
'distance' => '38100',
|
231 |
-
'direction' => '13500000',
|
232 |
-
'algn' => 'br',
|
233 |
-
'rotWithShape' => '0'
|
234 |
-
),
|
235 |
-
//INNER
|
236 |
-
10 => array(
|
237 |
-
'effect' => 'innerShdw',
|
238 |
-
'blur' => '63500',
|
239 |
-
'distance' => '50800',
|
240 |
-
'direction' => '2700000',
|
241 |
-
),
|
242 |
-
11 => array(
|
243 |
-
'effect' => 'innerShdw',
|
244 |
-
'blur' => '63500',
|
245 |
-
'distance' => '50800',
|
246 |
-
'direction' => '5400000',
|
247 |
-
),
|
248 |
-
12 => array(
|
249 |
-
'effect' => 'innerShdw',
|
250 |
-
'blur' => '63500',
|
251 |
-
'distance' => '50800',
|
252 |
-
'direction' => '8100000',
|
253 |
-
),
|
254 |
-
13 => array(
|
255 |
-
'effect' => 'innerShdw',
|
256 |
-
'blur' => '63500',
|
257 |
-
'distance' => '50800',
|
258 |
-
),
|
259 |
-
14 => array(
|
260 |
-
'effect' => 'innerShdw',
|
261 |
-
'blur' => '114300',
|
262 |
-
),
|
263 |
-
15 => array(
|
264 |
-
'effect' => 'innerShdw',
|
265 |
-
'blur' => '63500',
|
266 |
-
'distance' => '50800',
|
267 |
-
'direction' => '10800000',
|
268 |
-
),
|
269 |
-
16 => array(
|
270 |
-
'effect' => 'innerShdw',
|
271 |
-
'blur' => '63500',
|
272 |
-
'distance' => '50800',
|
273 |
-
'direction' => '18900000',
|
274 |
-
),
|
275 |
-
17 => array(
|
276 |
-
'effect' => 'innerShdw',
|
277 |
-
'blur' => '63500',
|
278 |
-
'distance' => '50800',
|
279 |
-
'direction' => '16200000',
|
280 |
-
),
|
281 |
-
18 => array(
|
282 |
-
'effect' => 'innerShdw',
|
283 |
-
'blur' => '63500',
|
284 |
-
'distance' => '50800',
|
285 |
-
'direction' => '13500000',
|
286 |
-
),
|
287 |
-
//perspective
|
288 |
-
19 => array(
|
289 |
-
'effect' => 'outerShdw',
|
290 |
-
'blur' => '152400',
|
291 |
-
'distance' => '317500',
|
292 |
-
'size' => array(
|
293 |
-
'sx' => '90000',
|
294 |
-
'sy' => '-19000',
|
295 |
-
),
|
296 |
-
'direction' => '5400000',
|
297 |
-
'rotWithShape' => '0',
|
298 |
-
),
|
299 |
-
20 => array(
|
300 |
-
'effect' => 'outerShdw',
|
301 |
-
'blur' => '76200',
|
302 |
-
'direction' => '18900000',
|
303 |
-
'size' => array(
|
304 |
-
'sy' => '23000',
|
305 |
-
'kx' => '-1200000',
|
306 |
-
),
|
307 |
-
'algn' => 'bl',
|
308 |
-
'rotWithShape' => '0',
|
309 |
-
),
|
310 |
-
21 => array(
|
311 |
-
'effect' => 'outerShdw',
|
312 |
-
'blur' => '76200',
|
313 |
-
'direction' => '13500000',
|
314 |
-
'size' => array(
|
315 |
-
'sy' => '23000',
|
316 |
-
'kx' => '1200000',
|
317 |
-
),
|
318 |
-
'algn' => 'br',
|
319 |
-
'rotWithShape' => '0',
|
320 |
-
),
|
321 |
-
22 => array(
|
322 |
-
'effect' => 'outerShdw',
|
323 |
-
'blur' => '76200',
|
324 |
-
'distance' => '12700',
|
325 |
-
'direction' => '2700000',
|
326 |
-
'size' => array(
|
327 |
-
'sy' => '-23000',
|
328 |
-
'kx' => '-800400',
|
329 |
-
),
|
330 |
-
'algn' => 'bl',
|
331 |
-
'rotWithShape' => '0',
|
332 |
-
),
|
333 |
-
23 => array(
|
334 |
-
'effect' => 'outerShdw',
|
335 |
-
'blur' => '76200',
|
336 |
-
'distance' => '12700',
|
337 |
-
'direction' => '8100000',
|
338 |
-
'size' => array(
|
339 |
-
'sy' => '-23000',
|
340 |
-
'kx' => '800400',
|
341 |
-
),
|
342 |
-
'algn' => 'br',
|
343 |
-
'rotWithShape' => '0',
|
344 |
-
),
|
345 |
-
);
|
346 |
-
|
347 |
-
return $presets_options[$shadow_presets_option];
|
348 |
-
}
|
349 |
-
|
350 |
-
protected function getArrayElementsValue($properties, $elements)
|
351 |
-
{
|
352 |
-
$reference = & $properties;
|
353 |
-
if (!is_array($elements)) {
|
354 |
-
return $reference[$elements];
|
355 |
-
} else {
|
356 |
-
foreach ($elements as $keys) {
|
357 |
-
$reference = & $reference[$keys];
|
358 |
-
}
|
359 |
-
return $reference;
|
360 |
-
}
|
361 |
-
return $this;
|
362 |
-
}
|
363 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: nhw2h8s
|
5 |
+
* Date: 7/2/14
|
6 |
+
* Time: 5:45 PM
|
7 |
+
*/
|
8 |
+
|
9 |
+
abstract class PHPExcel_Chart_Properties
|
10 |
+
{
|
11 |
+
const
|
12 |
+
EXCEL_COLOR_TYPE_STANDARD = 'prstClr',
|
13 |
+
EXCEL_COLOR_TYPE_SCHEME = 'schemeClr',
|
14 |
+
EXCEL_COLOR_TYPE_ARGB = 'srgbClr';
|
15 |
+
|
16 |
+
const
|
17 |
+
AXIS_LABELS_LOW = 'low',
|
18 |
+
AXIS_LABELS_HIGH = 'high',
|
19 |
+
AXIS_LABELS_NEXT_TO = 'nextTo',
|
20 |
+
AXIS_LABELS_NONE = 'none';
|
21 |
+
|
22 |
+
const
|
23 |
+
TICK_MARK_NONE = 'none',
|
24 |
+
TICK_MARK_INSIDE = 'in',
|
25 |
+
TICK_MARK_OUTSIDE = 'out',
|
26 |
+
TICK_MARK_CROSS = 'cross';
|
27 |
+
|
28 |
+
const
|
29 |
+
HORIZONTAL_CROSSES_AUTOZERO = 'autoZero',
|
30 |
+
HORIZONTAL_CROSSES_MAXIMUM = 'max';
|
31 |
+
|
32 |
+
const
|
33 |
+
FORMAT_CODE_GENERAL = 'General',
|
34 |
+
FORMAT_CODE_NUMBER = '#,##0.00',
|
35 |
+
FORMAT_CODE_CURRENCY = '$#,##0.00',
|
36 |
+
FORMAT_CODE_ACCOUNTING = '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)',
|
37 |
+
FORMAT_CODE_DATE = 'm/d/yyyy',
|
38 |
+
FORMAT_CODE_TIME = '[$-F400]h:mm:ss AM/PM',
|
39 |
+
FORMAT_CODE_PERCENTAGE = '0.00%',
|
40 |
+
FORMAT_CODE_FRACTION = '# ?/?',
|
41 |
+
FORMAT_CODE_SCIENTIFIC = '0.00E+00',
|
42 |
+
FORMAT_CODE_TEXT = '@',
|
43 |
+
FORMAT_CODE_SPECIAL = '00000';
|
44 |
+
|
45 |
+
const
|
46 |
+
ORIENTATION_NORMAL = 'minMax',
|
47 |
+
ORIENTATION_REVERSED = 'maxMin';
|
48 |
+
|
49 |
+
const
|
50 |
+
LINE_STYLE_COMPOUND_SIMPLE = 'sng',
|
51 |
+
LINE_STYLE_COMPOUND_DOUBLE = 'dbl',
|
52 |
+
LINE_STYLE_COMPOUND_THICKTHIN = 'thickThin',
|
53 |
+
LINE_STYLE_COMPOUND_THINTHICK = 'thinThick',
|
54 |
+
LINE_STYLE_COMPOUND_TRIPLE = 'tri',
|
55 |
+
|
56 |
+
LINE_STYLE_DASH_SOLID = 'solid',
|
57 |
+
LINE_STYLE_DASH_ROUND_DOT = 'sysDot',
|
58 |
+
LINE_STYLE_DASH_SQUERE_DOT = 'sysDash',
|
59 |
+
LINE_STYPE_DASH_DASH = 'dash',
|
60 |
+
LINE_STYLE_DASH_DASH_DOT = 'dashDot',
|
61 |
+
LINE_STYLE_DASH_LONG_DASH = 'lgDash',
|
62 |
+
LINE_STYLE_DASH_LONG_DASH_DOT = 'lgDashDot',
|
63 |
+
LINE_STYLE_DASH_LONG_DASH_DOT_DOT = 'lgDashDotDot',
|
64 |
+
|
65 |
+
LINE_STYLE_CAP_SQUARE = 'sq',
|
66 |
+
LINE_STYLE_CAP_ROUND = 'rnd',
|
67 |
+
LINE_STYLE_CAP_FLAT = 'flat',
|
68 |
+
|
69 |
+
LINE_STYLE_JOIN_ROUND = 'bevel',
|
70 |
+
LINE_STYLE_JOIN_MITER = 'miter',
|
71 |
+
LINE_STYLE_JOIN_BEVEL = 'bevel',
|
72 |
+
|
73 |
+
LINE_STYLE_ARROW_TYPE_NOARROW = null,
|
74 |
+
LINE_STYLE_ARROW_TYPE_ARROW = 'triangle',
|
75 |
+
LINE_STYLE_ARROW_TYPE_OPEN = 'arrow',
|
76 |
+
LINE_STYLE_ARROW_TYPE_STEALTH = 'stealth',
|
77 |
+
LINE_STYLE_ARROW_TYPE_DIAMOND = 'diamond',
|
78 |
+
LINE_STYLE_ARROW_TYPE_OVAL = 'oval',
|
79 |
+
|
80 |
+
LINE_STYLE_ARROW_SIZE_1 = 1,
|
81 |
+
LINE_STYLE_ARROW_SIZE_2 = 2,
|
82 |
+
LINE_STYLE_ARROW_SIZE_3 = 3,
|
83 |
+
LINE_STYLE_ARROW_SIZE_4 = 4,
|
84 |
+
LINE_STYLE_ARROW_SIZE_5 = 5,
|
85 |
+
LINE_STYLE_ARROW_SIZE_6 = 6,
|
86 |
+
LINE_STYLE_ARROW_SIZE_7 = 7,
|
87 |
+
LINE_STYLE_ARROW_SIZE_8 = 8,
|
88 |
+
LINE_STYLE_ARROW_SIZE_9 = 9;
|
89 |
+
|
90 |
+
const
|
91 |
+
SHADOW_PRESETS_NOSHADOW = null,
|
92 |
+
SHADOW_PRESETS_OUTER_BOTTTOM_RIGHT = 1,
|
93 |
+
SHADOW_PRESETS_OUTER_BOTTOM = 2,
|
94 |
+
SHADOW_PRESETS_OUTER_BOTTOM_LEFT = 3,
|
95 |
+
SHADOW_PRESETS_OUTER_RIGHT = 4,
|
96 |
+
SHADOW_PRESETS_OUTER_CENTER = 5,
|
97 |
+
SHADOW_PRESETS_OUTER_LEFT = 6,
|
98 |
+
SHADOW_PRESETS_OUTER_TOP_RIGHT = 7,
|
99 |
+
SHADOW_PRESETS_OUTER_TOP = 8,
|
100 |
+
SHADOW_PRESETS_OUTER_TOP_LEFT = 9,
|
101 |
+
SHADOW_PRESETS_INNER_BOTTTOM_RIGHT = 10,
|
102 |
+
SHADOW_PRESETS_INNER_BOTTOM = 11,
|
103 |
+
SHADOW_PRESETS_INNER_BOTTOM_LEFT = 12,
|
104 |
+
SHADOW_PRESETS_INNER_RIGHT = 13,
|
105 |
+
SHADOW_PRESETS_INNER_CENTER = 14,
|
106 |
+
SHADOW_PRESETS_INNER_LEFT = 15,
|
107 |
+
SHADOW_PRESETS_INNER_TOP_RIGHT = 16,
|
108 |
+
SHADOW_PRESETS_INNER_TOP = 17,
|
109 |
+
SHADOW_PRESETS_INNER_TOP_LEFT = 18,
|
110 |
+
SHADOW_PRESETS_PERSPECTIVE_BELOW = 19,
|
111 |
+
SHADOW_PRESETS_PERSPECTIVE_UPPER_RIGHT = 20,
|
112 |
+
SHADOW_PRESETS_PERSPECTIVE_UPPER_LEFT = 21,
|
113 |
+
SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT = 22,
|
114 |
+
SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT = 23;
|
115 |
+
|
116 |
+
protected function getExcelPointsWidth($width)
|
117 |
+
{
|
118 |
+
return $width * 12700;
|
119 |
+
}
|
120 |
+
|
121 |
+
protected function getExcelPointsAngle($angle)
|
122 |
+
{
|
123 |
+
return $angle * 60000;
|
124 |
+
}
|
125 |
+
|
126 |
+
protected function getTrueAlpha($alpha)
|
127 |
+
{
|
128 |
+
return (string) 100 - $alpha . '000';
|
129 |
+
}
|
130 |
+
|
131 |
+
protected function setColorProperties($color, $alpha, $type)
|
132 |
+
{
|
133 |
+
return array(
|
134 |
+
'type' => (string) $type,
|
135 |
+
'value' => (string) $color,
|
136 |
+
'alpha' => (string) $this->getTrueAlpha($alpha)
|
137 |
+
);
|
138 |
+
}
|
139 |
+
|
140 |
+
protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
|
141 |
+
{
|
142 |
+
$sizes = array(
|
143 |
+
1 => array('w' => 'sm', 'len' => 'sm'),
|
144 |
+
2 => array('w' => 'sm', 'len' => 'med'),
|
145 |
+
3 => array('w' => 'sm', 'len' => 'lg'),
|
146 |
+
4 => array('w' => 'med', 'len' => 'sm'),
|
147 |
+
5 => array('w' => 'med', 'len' => 'med'),
|
148 |
+
6 => array('w' => 'med', 'len' => 'lg'),
|
149 |
+
7 => array('w' => 'lg', 'len' => 'sm'),
|
150 |
+
8 => array('w' => 'lg', 'len' => 'med'),
|
151 |
+
9 => array('w' => 'lg', 'len' => 'lg')
|
152 |
+
);
|
153 |
+
|
154 |
+
return $sizes[$array_selector][$array_kay_selector];
|
155 |
+
}
|
156 |
+
|
157 |
+
protected function getShadowPresetsMap($shadow_presets_option)
|
158 |
+
{
|
159 |
+
$presets_options = array(
|
160 |
+
//OUTER
|
161 |
+
1 => array(
|
162 |
+
'effect' => 'outerShdw',
|
163 |
+
'blur' => '50800',
|
164 |
+
'distance' => '38100',
|
165 |
+
'direction' => '2700000',
|
166 |
+
'algn' => 'tl',
|
167 |
+
'rotWithShape' => '0'
|
168 |
+
),
|
169 |
+
2 => array(
|
170 |
+
'effect' => 'outerShdw',
|
171 |
+
'blur' => '50800',
|
172 |
+
'distance' => '38100',
|
173 |
+
'direction' => '5400000',
|
174 |
+
'algn' => 't',
|
175 |
+
'rotWithShape' => '0'
|
176 |
+
),
|
177 |
+
3 => array(
|
178 |
+
'effect' => 'outerShdw',
|
179 |
+
'blur' => '50800',
|
180 |
+
'distance' => '38100',
|
181 |
+
'direction' => '8100000',
|
182 |
+
'algn' => 'tr',
|
183 |
+
'rotWithShape' => '0'
|
184 |
+
),
|
185 |
+
4 => array(
|
186 |
+
'effect' => 'outerShdw',
|
187 |
+
'blur' => '50800',
|
188 |
+
'distance' => '38100',
|
189 |
+
'algn' => 'l',
|
190 |
+
'rotWithShape' => '0'
|
191 |
+
),
|
192 |
+
5 => array(
|
193 |
+
'effect' => 'outerShdw',
|
194 |
+
'size' => array(
|
195 |
+
'sx' => '102000',
|
196 |
+
'sy' => '102000'
|
197 |
+
)
|
198 |
+
,
|
199 |
+
'blur' => '63500',
|
200 |
+
'distance' => '38100',
|
201 |
+
'algn' => 'ctr',
|
202 |
+
'rotWithShape' => '0'
|
203 |
+
),
|
204 |
+
6 => array(
|
205 |
+
'effect' => 'outerShdw',
|
206 |
+
'blur' => '50800',
|
207 |
+
'distance' => '38100',
|
208 |
+
'direction' => '10800000',
|
209 |
+
'algn' => 'r',
|
210 |
+
'rotWithShape' => '0'
|
211 |
+
),
|
212 |
+
7 => array(
|
213 |
+
'effect' => 'outerShdw',
|
214 |
+
'blur' => '50800',
|
215 |
+
'distance' => '38100',
|
216 |
+
'direction' => '18900000',
|
217 |
+
'algn' => 'bl',
|
218 |
+
'rotWithShape' => '0'
|
219 |
+
),
|
220 |
+
8 => array(
|
221 |
+
'effect' => 'outerShdw',
|
222 |
+
'blur' => '50800',
|
223 |
+
'distance' => '38100',
|
224 |
+
'direction' => '16200000',
|
225 |
+
'rotWithShape' => '0'
|
226 |
+
),
|
227 |
+
9 => array(
|
228 |
+
'effect' => 'outerShdw',
|
229 |
+
'blur' => '50800',
|
230 |
+
'distance' => '38100',
|
231 |
+
'direction' => '13500000',
|
232 |
+
'algn' => 'br',
|
233 |
+
'rotWithShape' => '0'
|
234 |
+
),
|
235 |
+
//INNER
|
236 |
+
10 => array(
|
237 |
+
'effect' => 'innerShdw',
|
238 |
+
'blur' => '63500',
|
239 |
+
'distance' => '50800',
|
240 |
+
'direction' => '2700000',
|
241 |
+
),
|
242 |
+
11 => array(
|
243 |
+
'effect' => 'innerShdw',
|
244 |
+
'blur' => '63500',
|
245 |
+
'distance' => '50800',
|
246 |
+
'direction' => '5400000',
|
247 |
+
),
|
248 |
+
12 => array(
|
249 |
+
'effect' => 'innerShdw',
|
250 |
+
'blur' => '63500',
|
251 |
+
'distance' => '50800',
|
252 |
+
'direction' => '8100000',
|
253 |
+
),
|
254 |
+
13 => array(
|
255 |
+
'effect' => 'innerShdw',
|
256 |
+
'blur' => '63500',
|
257 |
+
'distance' => '50800',
|
258 |
+
),
|
259 |
+
14 => array(
|
260 |
+
'effect' => 'innerShdw',
|
261 |
+
'blur' => '114300',
|
262 |
+
),
|
263 |
+
15 => array(
|
264 |
+
'effect' => 'innerShdw',
|
265 |
+
'blur' => '63500',
|
266 |
+
'distance' => '50800',
|
267 |
+
'direction' => '10800000',
|
268 |
+
),
|
269 |
+
16 => array(
|
270 |
+
'effect' => 'innerShdw',
|
271 |
+
'blur' => '63500',
|
272 |
+
'distance' => '50800',
|
273 |
+
'direction' => '18900000',
|
274 |
+
),
|
275 |
+
17 => array(
|
276 |
+
'effect' => 'innerShdw',
|
277 |
+
'blur' => '63500',
|
278 |
+
'distance' => '50800',
|
279 |
+
'direction' => '16200000',
|
280 |
+
),
|
281 |
+
18 => array(
|
282 |
+
'effect' => 'innerShdw',
|
283 |
+
'blur' => '63500',
|
284 |
+
'distance' => '50800',
|
285 |
+
'direction' => '13500000',
|
286 |
+
),
|
287 |
+
//perspective
|
288 |
+
19 => array(
|
289 |
+
'effect' => 'outerShdw',
|
290 |
+
'blur' => '152400',
|
291 |
+
'distance' => '317500',
|
292 |
+
'size' => array(
|
293 |
+
'sx' => '90000',
|
294 |
+
'sy' => '-19000',
|
295 |
+
),
|
296 |
+
'direction' => '5400000',
|
297 |
+
'rotWithShape' => '0',
|
298 |
+
),
|
299 |
+
20 => array(
|
300 |
+
'effect' => 'outerShdw',
|
301 |
+
'blur' => '76200',
|
302 |
+
'direction' => '18900000',
|
303 |
+
'size' => array(
|
304 |
+
'sy' => '23000',
|
305 |
+
'kx' => '-1200000',
|
306 |
+
),
|
307 |
+
'algn' => 'bl',
|
308 |
+
'rotWithShape' => '0',
|
309 |
+
),
|
310 |
+
21 => array(
|
311 |
+
'effect' => 'outerShdw',
|
312 |
+
'blur' => '76200',
|
313 |
+
'direction' => '13500000',
|
314 |
+
'size' => array(
|
315 |
+
'sy' => '23000',
|
316 |
+
'kx' => '1200000',
|
317 |
+
),
|
318 |
+
'algn' => 'br',
|
319 |
+
'rotWithShape' => '0',
|
320 |
+
),
|
321 |
+
22 => array(
|
322 |
+
'effect' => 'outerShdw',
|
323 |
+
'blur' => '76200',
|
324 |
+
'distance' => '12700',
|
325 |
+
'direction' => '2700000',
|
326 |
+
'size' => array(
|
327 |
+
'sy' => '-23000',
|
328 |
+
'kx' => '-800400',
|
329 |
+
),
|
330 |
+
'algn' => 'bl',
|
331 |
+
'rotWithShape' => '0',
|
332 |
+
),
|
333 |
+
23 => array(
|
334 |
+
'effect' => 'outerShdw',
|
335 |
+
'blur' => '76200',
|
336 |
+
'distance' => '12700',
|
337 |
+
'direction' => '8100000',
|
338 |
+
'size' => array(
|
339 |
+
'sy' => '-23000',
|
340 |
+
'kx' => '800400',
|
341 |
+
),
|
342 |
+
'algn' => 'br',
|
343 |
+
'rotWithShape' => '0',
|
344 |
+
),
|
345 |
+
);
|
346 |
+
|
347 |
+
return $presets_options[$shadow_presets_option];
|
348 |
+
}
|
349 |
+
|
350 |
+
protected function getArrayElementsValue($properties, $elements)
|
351 |
+
{
|
352 |
+
$reference = & $properties;
|
353 |
+
if (!is_array($elements)) {
|
354 |
+
return $reference[$elements];
|
355 |
+
} else {
|
356 |
+
foreach ($elements as $keys) {
|
357 |
+
$reference = & $reference[$keys];
|
358 |
+
}
|
359 |
+
return $reference;
|
360 |
+
}
|
361 |
+
return $this;
|
362 |
+
}
|
363 |
+
}
|
PHPExcel/Classes/PHPExcel/Helper/HTML.php
CHANGED
@@ -1,808 +1,808 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class PHPExcel_Helper_HTML
|
4 |
-
{
|
5 |
-
protected static $colourMap = array(
|
6 |
-
'aliceblue' => 'f0f8ff',
|
7 |
-
'antiquewhite' => 'faebd7',
|
8 |
-
'antiquewhite1' => 'ffefdb',
|
9 |
-
'antiquewhite2' => 'eedfcc',
|
10 |
-
'antiquewhite3' => 'cdc0b0',
|
11 |
-
'antiquewhite4' => '8b8378',
|
12 |
-
'aqua' => '00ffff',
|
13 |
-
'aquamarine1' => '7fffd4',
|
14 |
-
'aquamarine2' => '76eec6',
|
15 |
-
'aquamarine4' => '458b74',
|
16 |
-
'azure1' => 'f0ffff',
|
17 |
-
'azure2' => 'e0eeee',
|
18 |
-
'azure3' => 'c1cdcd',
|
19 |
-
'azure4' => '838b8b',
|
20 |
-
'beige' => 'f5f5dc',
|
21 |
-
'bisque1' => 'ffe4c4',
|
22 |
-
'bisque2' => 'eed5b7',
|
23 |
-
'bisque3' => 'cdb79e',
|
24 |
-
'bisque4' => '8b7d6b',
|
25 |
-
'black' => '000000',
|
26 |
-
'blanchedalmond' => 'ffebcd',
|
27 |
-
'blue' => '0000ff',
|
28 |
-
'blue1' => '0000ff',
|
29 |
-
'blue2' => '0000ee',
|
30 |
-
'blue4' => '00008b',
|
31 |
-
'blueviolet' => '8a2be2',
|
32 |
-
'brown' => 'a52a2a',
|
33 |
-
'brown1' => 'ff4040',
|
34 |
-
'brown2' => 'ee3b3b',
|
35 |
-
'brown3' => 'cd3333',
|
36 |
-
'brown4' => '8b2323',
|
37 |
-
'burlywood' => 'deb887',
|
38 |
-
'burlywood1' => 'ffd39b',
|
39 |
-
'burlywood2' => 'eec591',
|
40 |
-
'burlywood3' => 'cdaa7d',
|
41 |
-
'burlywood4' => '8b7355',
|
42 |
-
'cadetblue' => '5f9ea0',
|
43 |
-
'cadetblue1' => '98f5ff',
|
44 |
-
'cadetblue2' => '8ee5ee',
|
45 |
-
'cadetblue3' => '7ac5cd',
|
46 |
-
'cadetblue4' => '53868b',
|
47 |
-
'chartreuse1' => '7fff00',
|
48 |
-
'chartreuse2' => '76ee00',
|
49 |
-
'chartreuse3' => '66cd00',
|
50 |
-
'chartreuse4' => '458b00',
|
51 |
-
'chocolate' => 'd2691e',
|
52 |
-
'chocolate1' => 'ff7f24',
|
53 |
-
'chocolate2' => 'ee7621',
|
54 |
-
'chocolate3' => 'cd661d',
|
55 |
-
'coral' => 'ff7f50',
|
56 |
-
'coral1' => 'ff7256',
|
57 |
-
'coral2' => 'ee6a50',
|
58 |
-
'coral3' => 'cd5b45',
|
59 |
-
'coral4' => '8b3e2f',
|
60 |
-
'cornflowerblue' => '6495ed',
|
61 |
-
'cornsilk1' => 'fff8dc',
|
62 |
-
'cornsilk2' => 'eee8cd',
|
63 |
-
'cornsilk3' => 'cdc8b1',
|
64 |
-
'cornsilk4' => '8b8878',
|
65 |
-
'cyan1' => '00ffff',
|
66 |
-
'cyan2' => '00eeee',
|
67 |
-
'cyan3' => '00cdcd',
|
68 |
-
'cyan4' => '008b8b',
|
69 |
-
'darkgoldenrod' => 'b8860b',
|
70 |
-
'darkgoldenrod1' => 'ffb90f',
|
71 |
-
'darkgoldenrod2' => 'eead0e',
|
72 |
-
'darkgoldenrod3' => 'cd950c',
|
73 |
-
'darkgoldenrod4' => '8b6508',
|
74 |
-
'darkgreen' => '006400',
|
75 |
-
'darkkhaki' => 'bdb76b',
|
76 |
-
'darkolivegreen' => '556b2f',
|
77 |
-
'darkolivegreen1' => 'caff70',
|
78 |
-
'darkolivegreen2' => 'bcee68',
|
79 |
-
'darkolivegreen3' => 'a2cd5a',
|
80 |
-
'darkolivegreen4' => '6e8b3d',
|
81 |
-
'darkorange' => 'ff8c00',
|
82 |
-
'darkorange1' => 'ff7f00',
|
83 |
-
'darkorange2' => 'ee7600',
|
84 |
-
'darkorange3' => 'cd6600',
|
85 |
-
'darkorange4' => '8b4500',
|
86 |
-
'darkorchid' => '9932cc',
|
87 |
-
'darkorchid1' => 'bf3eff',
|
88 |
-
'darkorchid2' => 'b23aee',
|
89 |
-
'darkorchid3' => '9a32cd',
|
90 |
-
'darkorchid4' => '68228b',
|
91 |
-
'darksalmon' => 'e9967a',
|
92 |
-
'darkseagreen' => '8fbc8f',
|
93 |
-
'darkseagreen1' => 'c1ffc1',
|
94 |
-
'darkseagreen2' => 'b4eeb4',
|
95 |
-
'darkseagreen3' => '9bcd9b',
|
96 |
-
'darkseagreen4' => '698b69',
|
97 |
-
'darkslateblue' => '483d8b',
|
98 |
-
'darkslategray' => '2f4f4f',
|
99 |
-
'darkslategray1' => '97ffff',
|
100 |
-
'darkslategray2' => '8deeee',
|
101 |
-
'darkslategray3' => '79cdcd',
|
102 |
-
'darkslategray4' => '528b8b',
|
103 |
-
'darkturquoise' => '00ced1',
|
104 |
-
'darkviolet' => '9400d3',
|
105 |
-
'deeppink1' => 'ff1493',
|
106 |
-
'deeppink2' => 'ee1289',
|
107 |
-
'deeppink3' => 'cd1076',
|
108 |
-
'deeppink4' => '8b0a50',
|
109 |
-
'deepskyblue1' => '00bfff',
|
110 |
-
'deepskyblue2' => '00b2ee',
|
111 |
-
'deepskyblue3' => '009acd',
|
112 |
-
'deepskyblue4' => '00688b',
|
113 |
-
'dimgray' => '696969',
|
114 |
-
'dodgerblue1' => '1e90ff',
|
115 |
-
'dodgerblue2' => '1c86ee',
|
116 |
-
'dodgerblue3' => '1874cd',
|
117 |
-
'dodgerblue4' => '104e8b',
|
118 |
-
'firebrick' => 'b22222',
|
119 |
-
'firebrick1' => 'ff3030',
|
120 |
-
'firebrick2' => 'ee2c2c',
|
121 |
-
'firebrick3' => 'cd2626',
|
122 |
-
'firebrick4' => '8b1a1a',
|
123 |
-
'floralwhite' => 'fffaf0',
|
124 |
-
'forestgreen' => '228b22',
|
125 |
-
'fuchsia' => 'ff00ff',
|
126 |
-
'gainsboro' => 'dcdcdc',
|
127 |
-
'ghostwhite' => 'f8f8ff',
|
128 |
-
'gold1' => 'ffd700',
|
129 |
-
'gold2' => 'eec900',
|
130 |
-
'gold3' => 'cdad00',
|
131 |
-
'gold4' => '8b7500',
|
132 |
-
'goldenrod' => 'daa520',
|
133 |
-
'goldenrod1' => 'ffc125',
|
134 |
-
'goldenrod2' => 'eeb422',
|
135 |
-
'goldenrod3' => 'cd9b1d',
|
136 |
-
'goldenrod4' => '8b6914',
|
137 |
-
'gray' => 'bebebe',
|
138 |
-
'gray1' => '030303',
|
139 |
-
'gray10' => '1a1a1a',
|
140 |
-
'gray11' => '1c1c1c',
|
141 |
-
'gray12' => '1f1f1f',
|
142 |
-
'gray13' => '212121',
|
143 |
-
'gray14' => '242424',
|
144 |
-
'gray15' => '262626',
|
145 |
-
'gray16' => '292929',
|
146 |
-
'gray17' => '2b2b2b',
|
147 |
-
'gray18' => '2e2e2e',
|
148 |
-
'gray19' => '303030',
|
149 |
-
'gray2' => '050505',
|
150 |
-
'gray20' => '333333',
|
151 |
-
'gray21' => '363636',
|
152 |
-
'gray22' => '383838',
|
153 |
-
'gray23' => '3b3b3b',
|
154 |
-
'gray24' => '3d3d3d',
|
155 |
-
'gray25' => '404040',
|
156 |
-
'gray26' => '424242',
|
157 |
-
'gray27' => '454545',
|
158 |
-
'gray28' => '474747',
|
159 |
-
'gray29' => '4a4a4a',
|
160 |
-
'gray3' => '080808',
|
161 |
-
'gray30' => '4d4d4d',
|
162 |
-
'gray31' => '4f4f4f',
|
163 |
-
'gray32' => '525252',
|
164 |
-
'gray33' => '545454',
|
165 |
-
'gray34' => '575757',
|
166 |
-
'gray35' => '595959',
|
167 |
-
'gray36' => '5c5c5c',
|
168 |
-
'gray37' => '5e5e5e',
|
169 |
-
'gray38' => '616161',
|
170 |
-
'gray39' => '636363',
|
171 |
-
'gray4' => '0a0a0a',
|
172 |
-
'gray40' => '666666',
|
173 |
-
'gray41' => '696969',
|
174 |
-
'gray42' => '6b6b6b',
|
175 |
-
'gray43' => '6e6e6e',
|
176 |
-
'gray44' => '707070',
|
177 |
-
'gray45' => '737373',
|
178 |
-
'gray46' => '757575',
|
179 |
-
'gray47' => '787878',
|
180 |
-
'gray48' => '7a7a7a',
|
181 |
-
'gray49' => '7d7d7d',
|
182 |
-
'gray5' => '0d0d0d',
|
183 |
-
'gray50' => '7f7f7f',
|
184 |
-
'gray51' => '828282',
|
185 |
-
'gray52' => '858585',
|
186 |
-
'gray53' => '878787',
|
187 |
-
'gray54' => '8a8a8a',
|
188 |
-
'gray55' => '8c8c8c',
|
189 |
-
'gray56' => '8f8f8f',
|
190 |
-
'gray57' => '919191',
|
191 |
-
'gray58' => '949494',
|
192 |
-
'gray59' => '969696',
|
193 |
-
'gray6' => '0f0f0f',
|
194 |
-
'gray60' => '999999',
|
195 |
-
'gray61' => '9c9c9c',
|
196 |
-
'gray62' => '9e9e9e',
|
197 |
-
'gray63' => 'a1a1a1',
|
198 |
-
'gray64' => 'a3a3a3',
|
199 |
-
'gray65' => 'a6a6a6',
|
200 |
-
'gray66' => 'a8a8a8',
|
201 |
-
'gray67' => 'ababab',
|
202 |
-
'gray68' => 'adadad',
|
203 |
-
'gray69' => 'b0b0b0',
|
204 |
-
'gray7' => '121212',
|
205 |
-
'gray70' => 'b3b3b3',
|
206 |
-
'gray71' => 'b5b5b5',
|
207 |
-
'gray72' => 'b8b8b8',
|
208 |
-
'gray73' => 'bababa',
|
209 |
-
'gray74' => 'bdbdbd',
|
210 |
-
'gray75' => 'bfbfbf',
|
211 |
-
'gray76' => 'c2c2c2',
|
212 |
-
'gray77' => 'c4c4c4',
|
213 |
-
'gray78' => 'c7c7c7',
|
214 |
-
'gray79' => 'c9c9c9',
|
215 |
-
'gray8' => '141414',
|
216 |
-
'gray80' => 'cccccc',
|
217 |
-
'gray81' => 'cfcfcf',
|
218 |
-
'gray82' => 'd1d1d1',
|
219 |
-
'gray83' => 'd4d4d4',
|
220 |
-
'gray84' => 'd6d6d6',
|
221 |
-
'gray85' => 'd9d9d9',
|
222 |
-
'gray86' => 'dbdbdb',
|
223 |
-
'gray87' => 'dedede',
|
224 |
-
'gray88' => 'e0e0e0',
|
225 |
-
'gray89' => 'e3e3e3',
|
226 |
-
'gray9' => '171717',
|
227 |
-
'gray90' => 'e5e5e5',
|
228 |
-
'gray91' => 'e8e8e8',
|
229 |
-
'gray92' => 'ebebeb',
|
230 |
-
'gray93' => 'ededed',
|
231 |
-
'gray94' => 'f0f0f0',
|
232 |
-
'gray95' => 'f2f2f2',
|
233 |
-
'gray97' => 'f7f7f7',
|
234 |
-
'gray98' => 'fafafa',
|
235 |
-
'gray99' => 'fcfcfc',
|
236 |
-
'green' => '00ff00',
|
237 |
-
'green1' => '00ff00',
|
238 |
-
'green2' => '00ee00',
|
239 |
-
'green3' => '00cd00',
|
240 |
-
'green4' => '008b00',
|
241 |
-
'greenyellow' => 'adff2f',
|
242 |
-
'honeydew1' => 'f0fff0',
|
243 |
-
'honeydew2' => 'e0eee0',
|
244 |
-
'honeydew3' => 'c1cdc1',
|
245 |
-
'honeydew4' => '838b83',
|
246 |
-
'hotpink' => 'ff69b4',
|
247 |
-
'hotpink1' => 'ff6eb4',
|
248 |
-
'hotpink2' => 'ee6aa7',
|
249 |
-
'hotpink3' => 'cd6090',
|
250 |
-
'hotpink4' => '8b3a62',
|
251 |
-
'indianred' => 'cd5c5c',
|
252 |
-
'indianred1' => 'ff6a6a',
|
253 |
-
'indianred2' => 'ee6363',
|
254 |
-
'indianred3' => 'cd5555',
|
255 |
-
'indianred4' => '8b3a3a',
|
256 |
-
'ivory1' => 'fffff0',
|
257 |
-
'ivory2' => 'eeeee0',
|
258 |
-
'ivory3' => 'cdcdc1',
|
259 |
-
'ivory4' => '8b8b83',
|
260 |
-
'khaki' => 'f0e68c',
|
261 |
-
'khaki1' => 'fff68f',
|
262 |
-
'khaki2' => 'eee685',
|
263 |
-
'khaki3' => 'cdc673',
|
264 |
-
'khaki4' => '8b864e',
|
265 |
-
'lavender' => 'e6e6fa',
|
266 |
-
'lavenderblush1' => 'fff0f5',
|
267 |
-
'lavenderblush2' => 'eee0e5',
|
268 |
-
'lavenderblush3' => 'cdc1c5',
|
269 |
-
'lavenderblush4' => '8b8386',
|
270 |
-
'lawngreen' => '7cfc00',
|
271 |
-
'lemonchiffon1' => 'fffacd',
|
272 |
-
'lemonchiffon2' => 'eee9bf',
|
273 |
-
'lemonchiffon3' => 'cdc9a5',
|
274 |
-
'lemonchiffon4' => '8b8970',
|
275 |
-
'light' => 'eedd82',
|
276 |
-
'lightblue' => 'add8e6',
|
277 |
-
'lightblue1' => 'bfefff',
|
278 |
-
'lightblue2' => 'b2dfee',
|
279 |
-
'lightblue3' => '9ac0cd',
|
280 |
-
'lightblue4' => '68838b',
|
281 |
-
'lightcoral' => 'f08080',
|
282 |
-
'lightcyan1' => 'e0ffff',
|
283 |
-
'lightcyan2' => 'd1eeee',
|
284 |
-
'lightcyan3' => 'b4cdcd',
|
285 |
-
'lightcyan4' => '7a8b8b',
|
286 |
-
'lightgoldenrod1' => 'ffec8b',
|
287 |
-
'lightgoldenrod2' => 'eedc82',
|
288 |
-
'lightgoldenrod3' => 'cdbe70',
|
289 |
-
'lightgoldenrod4' => '8b814c',
|
290 |
-
'lightgoldenrodyellow' => 'fafad2',
|
291 |
-
'lightgray' => 'd3d3d3',
|
292 |
-
'lightpink' => 'ffb6c1',
|
293 |
-
'lightpink1' => 'ffaeb9',
|
294 |
-
'lightpink2' => 'eea2ad',
|
295 |
-
'lightpink3' => 'cd8c95',
|
296 |
-
'lightpink4' => '8b5f65',
|
297 |
-
'lightsalmon1' => 'ffa07a',
|
298 |
-
'lightsalmon2' => 'ee9572',
|
299 |
-
'lightsalmon3' => 'cd8162',
|
300 |
-
'lightsalmon4' => '8b5742',
|
301 |
-
'lightseagreen' => '20b2aa',
|
302 |
-
'lightskyblue' => '87cefa',
|
303 |
-
'lightskyblue1' => 'b0e2ff',
|
304 |
-
'lightskyblue2' => 'a4d3ee',
|
305 |
-
'lightskyblue3' => '8db6cd',
|
306 |
-
'lightskyblue4' => '607b8b',
|
307 |
-
'lightslateblue' => '8470ff',
|
308 |
-
'lightslategray' => '778899',
|
309 |
-
'lightsteelblue' => 'b0c4de',
|
310 |
-
'lightsteelblue1' => 'cae1ff',
|
311 |
-
'lightsteelblue2' => 'bcd2ee',
|
312 |
-
'lightsteelblue3' => 'a2b5cd',
|
313 |
-
'lightsteelblue4' => '6e7b8b',
|
314 |
-
'lightyellow1' => 'ffffe0',
|
315 |
-
'lightyellow2' => 'eeeed1',
|
316 |
-
'lightyellow3' => 'cdcdb4',
|
317 |
-
'lightyellow4' => '8b8b7a',
|
318 |
-
'lime' => '00ff00',
|
319 |
-
'limegreen' => '32cd32',
|
320 |
-
'linen' => 'faf0e6',
|
321 |
-
'magenta' => 'ff00ff',
|
322 |
-
'magenta2' => 'ee00ee',
|
323 |
-
'magenta3' => 'cd00cd',
|
324 |
-
'magenta4' => '8b008b',
|
325 |
-
'maroon' => 'b03060',
|
326 |
-
'maroon1' => 'ff34b3',
|
327 |
-
'maroon2' => 'ee30a7',
|
328 |
-
'maroon3' => 'cd2990',
|
329 |
-
'maroon4' => '8b1c62',
|
330 |
-
'medium' => '66cdaa',
|
331 |
-
'mediumaquamarine' => '66cdaa',
|
332 |
-
'mediumblue' => '0000cd',
|
333 |
-
'mediumorchid' => 'ba55d3',
|
334 |
-
'mediumorchid1' => 'e066ff',
|
335 |
-
'mediumorchid2' => 'd15fee',
|
336 |
-
'mediumorchid3' => 'b452cd',
|
337 |
-
'mediumorchid4' => '7a378b',
|
338 |
-
'mediumpurple' => '9370db',
|
339 |
-
'mediumpurple1' => 'ab82ff',
|
340 |
-
'mediumpurple2' => '9f79ee',
|
341 |
-
'mediumpurple3' => '8968cd',
|
342 |
-
'mediumpurple4' => '5d478b',
|
343 |
-
'mediumseagreen' => '3cb371',
|
344 |
-
'mediumslateblue' => '7b68ee',
|
345 |
-
'mediumspringgreen' => '00fa9a',
|
346 |
-
'mediumturquoise' => '48d1cc',
|
347 |
-
'mediumvioletred' => 'c71585',
|
348 |
-
'midnightblue' => '191970',
|
349 |
-
'mintcream' => 'f5fffa',
|
350 |
-
'mistyrose1' => 'ffe4e1',
|
351 |
-
'mistyrose2' => 'eed5d2',
|
352 |
-
'mistyrose3' => 'cdb7b5',
|
353 |
-
'mistyrose4' => '8b7d7b',
|
354 |
-
'moccasin' => 'ffe4b5',
|
355 |
-
'navajowhite1' => 'ffdead',
|
356 |
-
'navajowhite2' => 'eecfa1',
|
357 |
-
'navajowhite3' => 'cdb38b',
|
358 |
-
'navajowhite4' => '8b795e',
|
359 |
-
'navy' => '000080',
|
360 |
-
'navyblue' => '000080',
|
361 |
-
'oldlace' => 'fdf5e6',
|
362 |
-
'olive' => '808000',
|
363 |
-
'olivedrab' => '6b8e23',
|
364 |
-
'olivedrab1' => 'c0ff3e',
|
365 |
-
'olivedrab2' => 'b3ee3a',
|
366 |
-
'olivedrab4' => '698b22',
|
367 |
-
'orange' => 'ffa500',
|
368 |
-
'orange1' => 'ffa500',
|
369 |
-
'orange2' => 'ee9a00',
|
370 |
-
'orange3' => 'cd8500',
|
371 |
-
'orange4' => '8b5a00',
|
372 |
-
'orangered1' => 'ff4500',
|
373 |
-
'orangered2' => 'ee4000',
|
374 |
-
'orangered3' => 'cd3700',
|
375 |
-
'orangered4' => '8b2500',
|
376 |
-
'orchid' => 'da70d6',
|
377 |
-
'orchid1' => 'ff83fa',
|
378 |
-
'orchid2' => 'ee7ae9',
|
379 |
-
'orchid3' => 'cd69c9',
|
380 |
-
'orchid4' => '8b4789',
|
381 |
-
'pale' => 'db7093',
|
382 |
-
'palegoldenrod' => 'eee8aa',
|
383 |
-
'palegreen' => '98fb98',
|
384 |
-
'palegreen1' => '9aff9a',
|
385 |
-
'palegreen2' => '90ee90',
|
386 |
-
'palegreen3' => '7ccd7c',
|
387 |
-
'palegreen4' => '548b54',
|
388 |
-
'paleturquoise' => 'afeeee',
|
389 |
-
'paleturquoise1' => 'bbffff',
|
390 |
-
'paleturquoise2' => 'aeeeee',
|
391 |
-
'paleturquoise3' => '96cdcd',
|
392 |
-
'paleturquoise4' => '668b8b',
|
393 |
-
'palevioletred' => 'db7093',
|
394 |
-
'palevioletred1' => 'ff82ab',
|
395 |
-
'palevioletred2' => 'ee799f',
|
396 |
-
'palevioletred3' => 'cd6889',
|
397 |
-
'palevioletred4' => '8b475d',
|
398 |
-
'papayawhip' => 'ffefd5',
|
399 |
-
'peachpuff1' => 'ffdab9',
|
400 |
-
'peachpuff2' => 'eecbad',
|
401 |
-
'peachpuff3' => 'cdaf95',
|
402 |
-
'peachpuff4' => '8b7765',
|
403 |
-
'pink' => 'ffc0cb',
|
404 |
-
'pink1' => 'ffb5c5',
|
405 |
-
'pink2' => 'eea9b8',
|
406 |
-
'pink3' => 'cd919e',
|
407 |
-
'pink4' => '8b636c',
|
408 |
-
'plum' => 'dda0dd',
|
409 |
-
'plum1' => 'ffbbff',
|
410 |
-
'plum2' => 'eeaeee',
|
411 |
-
'plum3' => 'cd96cd',
|
412 |
-
'plum4' => '8b668b',
|
413 |
-
'powderblue' => 'b0e0e6',
|
414 |
-
'purple' => 'a020f0',
|
415 |
-
'rebeccapurple' => '663399',
|
416 |
-
'purple1' => '9b30ff',
|
417 |
-
'purple2' => '912cee',
|
418 |
-
'purple3' => '7d26cd',
|
419 |
-
'purple4' => '551a8b',
|
420 |
-
'red' => 'ff0000',
|
421 |
-
'red1' => 'ff0000',
|
422 |
-
'red2' => 'ee0000',
|
423 |
-
'red3' => 'cd0000',
|
424 |
-
'red4' => '8b0000',
|
425 |
-
'rosybrown' => 'bc8f8f',
|
426 |
-
'rosybrown1' => 'ffc1c1',
|
427 |
-
'rosybrown2' => 'eeb4b4',
|
428 |
-
'rosybrown3' => 'cd9b9b',
|
429 |
-
'rosybrown4' => '8b6969',
|
430 |
-
'royalblue' => '4169e1',
|
431 |
-
'royalblue1' => '4876ff',
|
432 |
-
'royalblue2' => '436eee',
|
433 |
-
'royalblue3' => '3a5fcd',
|
434 |
-
'royalblue4' => '27408b',
|
435 |
-
'saddlebrown' => '8b4513',
|
436 |
-
'salmon' => 'fa8072',
|
437 |
-
'salmon1' => 'ff8c69',
|
438 |
-
'salmon2' => 'ee8262',
|
439 |
-
'salmon3' => 'cd7054',
|
440 |
-
'salmon4' => '8b4c39',
|
441 |
-
'sandybrown' => 'f4a460',
|
442 |
-
'seagreen1' => '54ff9f',
|
443 |
-
'seagreen2' => '4eee94',
|
444 |
-
'seagreen3' => '43cd80',
|
445 |
-
'seagreen4' => '2e8b57',
|
446 |
-
'seashell1' => 'fff5ee',
|
447 |
-
'seashell2' => 'eee5de',
|
448 |
-
'seashell3' => 'cdc5bf',
|
449 |
-
'seashell4' => '8b8682',
|
450 |
-
'sienna' => 'a0522d',
|
451 |
-
'sienna1' => 'ff8247',
|
452 |
-
'sienna2' => 'ee7942',
|
453 |
-
'sienna3' => 'cd6839',
|
454 |
-
'sienna4' => '8b4726',
|
455 |
-
'silver' => 'c0c0c0',
|
456 |
-
'skyblue' => '87ceeb',
|
457 |
-
'skyblue1' => '87ceff',
|
458 |
-
'skyblue2' => '7ec0ee',
|
459 |
-
'skyblue3' => '6ca6cd',
|
460 |
-
'skyblue4' => '4a708b',
|
461 |
-
'slateblue' => '6a5acd',
|
462 |
-
'slateblue1' => '836fff',
|
463 |
-
'slateblue2' => '7a67ee',
|
464 |
-
'slateblue3' => '6959cd',
|
465 |
-
'slateblue4' => '473c8b',
|
466 |
-
'slategray' => '708090',
|
467 |
-
'slategray1' => 'c6e2ff',
|
468 |
-
'slategray2' => 'b9d3ee',
|
469 |
-
'slategray3' => '9fb6cd',
|
470 |
-
'slategray4' => '6c7b8b',
|
471 |
-
'snow1' => 'fffafa',
|
472 |
-
'snow2' => 'eee9e9',
|
473 |
-
'snow3' => 'cdc9c9',
|
474 |
-
'snow4' => '8b8989',
|
475 |
-
'springgreen1' => '00ff7f',
|
476 |
-
'springgreen2' => '00ee76',
|
477 |
-
'springgreen3' => '00cd66',
|
478 |
-
'springgreen4' => '008b45',
|
479 |
-
'steelblue' => '4682b4',
|
480 |
-
'steelblue1' => '63b8ff',
|
481 |
-
'steelblue2' => '5cacee',
|
482 |
-
'steelblue3' => '4f94cd',
|
483 |
-
'steelblue4' => '36648b',
|
484 |
-
'tan' => 'd2b48c',
|
485 |
-
'tan1' => 'ffa54f',
|
486 |
-
'tan2' => 'ee9a49',
|
487 |
-
'tan3' => 'cd853f',
|
488 |
-
'tan4' => '8b5a2b',
|
489 |
-
'teal' => '008080',
|
490 |
-
'thistle' => 'd8bfd8',
|
491 |
-
'thistle1' => 'ffe1ff',
|
492 |
-
'thistle2' => 'eed2ee',
|
493 |
-
'thistle3' => 'cdb5cd',
|
494 |
-
'thistle4' => '8b7b8b',
|
495 |
-
'tomato1' => 'ff6347',
|
496 |
-
'tomato2' => 'ee5c42',
|
497 |
-
'tomato3' => 'cd4f39',
|
498 |
-
'tomato4' => '8b3626',
|
499 |
-
'turquoise' => '40e0d0',
|
500 |
-
'turquoise1' => '00f5ff',
|
501 |
-
'turquoise2' => '00e5ee',
|
502 |
-
'turquoise3' => '00c5cd',
|
503 |
-
'turquoise4' => '00868b',
|
504 |
-
'violet' => 'ee82ee',
|
505 |
-
'violetred' => 'd02090',
|
506 |
-
'violetred1' => 'ff3e96',
|
507 |
-
'violetred2' => 'ee3a8c',
|
508 |
-
'violetred3' => 'cd3278',
|
509 |
-
'violetred4' => '8b2252',
|
510 |
-
'wheat' => 'f5deb3',
|
511 |
-
'wheat1' => 'ffe7ba',
|
512 |
-
'wheat2' => 'eed8ae',
|
513 |
-
'wheat3' => 'cdba96',
|
514 |
-
'wheat4' => '8b7e66',
|
515 |
-
'white' => 'ffffff',
|
516 |
-
'whitesmoke' => 'f5f5f5',
|
517 |
-
'yellow' => 'ffff00',
|
518 |
-
'yellow1' => 'ffff00',
|
519 |
-
'yellow2' => 'eeee00',
|
520 |
-
'yellow3' => 'cdcd00',
|
521 |
-
'yellow4' => '8b8b00',
|
522 |
-
'yellowgreen' => '9acd32',
|
523 |
-
);
|
524 |
-
|
525 |
-
protected $face;
|
526 |
-
protected $size;
|
527 |
-
protected $color;
|
528 |
-
|
529 |
-
protected $bold = false;
|
530 |
-
protected $italic = false;
|
531 |
-
protected $underline = false;
|
532 |
-
protected $superscript = false;
|
533 |
-
protected $subscript = false;
|
534 |
-
protected $strikethrough = false;
|
535 |
-
|
536 |
-
protected $startTagCallbacks = array(
|
537 |
-
'font' => 'startFontTag',
|
538 |
-
'b' => 'startBoldTag',
|
539 |
-
'strong' => 'startBoldTag',
|
540 |
-
'i' => 'startItalicTag',
|
541 |
-
'em' => 'startItalicTag',
|
542 |
-
'u' => 'startUnderlineTag',
|
543 |
-
'ins' => 'startUnderlineTag',
|
544 |
-
'del' => 'startStrikethruTag',
|
545 |
-
'sup' => 'startSuperscriptTag',
|
546 |
-
'sub' => 'startSubscriptTag',
|
547 |
-
);
|
548 |
-
|
549 |
-
protected $endTagCallbacks = array(
|
550 |
-
'font' => 'endFontTag',
|
551 |
-
'b' => 'endBoldTag',
|
552 |
-
'strong' => 'endBoldTag',
|
553 |
-
'i' => 'endItalicTag',
|
554 |
-
'em' => 'endItalicTag',
|
555 |
-
'u' => 'endUnderlineTag',
|
556 |
-
'ins' => 'endUnderlineTag',
|
557 |
-
'del' => 'endStrikethruTag',
|
558 |
-
'sup' => 'endSuperscriptTag',
|
559 |
-
'sub' => 'endSubscriptTag',
|
560 |
-
'br' => 'breakTag',
|
561 |
-
'p' => 'breakTag',
|
562 |
-
'h1' => 'breakTag',
|
563 |
-
'h2' => 'breakTag',
|
564 |
-
'h3' => 'breakTag',
|
565 |
-
'h4' => 'breakTag',
|
566 |
-
'h5' => 'breakTag',
|
567 |
-
'h6' => 'breakTag',
|
568 |
-
);
|
569 |
-
|
570 |
-
protected $stack = array();
|
571 |
-
|
572 |
-
protected $stringData = '';
|
573 |
-
|
574 |
-
protected $richTextObject;
|
575 |
-
|
576 |
-
protected function initialise()
|
577 |
-
{
|
578 |
-
$this->face = $this->size = $this->color = null;
|
579 |
-
$this->bold = $this->italic = $this->underline = $this->superscript = $this->subscript = $this->strikethrough = false;
|
580 |
-
|
581 |
-
$this->stack = array();
|
582 |
-
|
583 |
-
$this->stringData = '';
|
584 |
-
}
|
585 |
-
|
586 |
-
public function toRichTextObject($html)
|
587 |
-
{
|
588 |
-
$this->initialise();
|
589 |
-
|
590 |
-
// Create a new DOM object
|
591 |
-
$dom = new \DOMDocument;
|
592 |
-
// Load the HTML file into the DOM object
|
593 |
-
// Note the use of error suppression, because typically this will be an html fragment, so not fully valid markup
|
594 |
-
$loaded = @$dom->loadHTML($html);
|
595 |
-
|
596 |
-
// Discard excess white space
|
597 |
-
$dom->preserveWhiteSpace = false;
|
598 |
-
|
599 |
-
$this->richTextObject = new PHPExcel_RichText();;
|
600 |
-
$this->parseElements($dom);
|
601 |
-
|
602 |
-
// Clean any further spurious whitespace
|
603 |
-
$this->cleanWhitespace();
|
604 |
-
|
605 |
-
return $this->richTextObject;
|
606 |
-
}
|
607 |
-
|
608 |
-
protected function cleanWhitespace()
|
609 |
-
{
|
610 |
-
foreach ($this->richTextObject->getRichTextElements() as $key => $element) {
|
611 |
-
$text = $element->getText();
|
612 |
-
// Trim any leading spaces on the first run
|
613 |
-
if ($key == 0) {
|
614 |
-
$text = ltrim($text);
|
615 |
-
}
|
616 |
-
// Trim any spaces immediately after a line break
|
617 |
-
$text = preg_replace('/\n */mu', "\n", $text);
|
618 |
-
$element->setText($text);
|
619 |
-
}
|
620 |
-
}
|
621 |
-
|
622 |
-
protected function buildTextRun()
|
623 |
-
{
|
624 |
-
$text = $this->stringData;
|
625 |
-
if (trim($text) === '') {
|
626 |
-
return;
|
627 |
-
}
|
628 |
-
|
629 |
-
$richtextRun = $this->richTextObject->createTextRun($this->stringData);
|
630 |
-
if ($this->face) {
|
631 |
-
$richtextRun->getFont()->setName($this->face);
|
632 |
-
}
|
633 |
-
if ($this->size) {
|
634 |
-
$richtextRun->getFont()->setSize($this->size);
|
635 |
-
}
|
636 |
-
if ($this->color) {
|
637 |
-
$richtextRun->getFont()->setColor(new PHPExcel_Style_Color('ff' . $this->color));
|
638 |
-
}
|
639 |
-
if ($this->bold) {
|
640 |
-
$richtextRun->getFont()->setBold(true);
|
641 |
-
}
|
642 |
-
if ($this->italic) {
|
643 |
-
$richtextRun->getFont()->setItalic(true);
|
644 |
-
}
|
645 |
-
if ($this->underline) {
|
646 |
-
$richtextRun->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
|
647 |
-
}
|
648 |
-
if ($this->superscript) {
|
649 |
-
$richtextRun->getFont()->setSuperScript(true);
|
650 |
-
}
|
651 |
-
if ($this->subscript) {
|
652 |
-
$richtextRun->getFont()->setSubScript(true);
|
653 |
-
}
|
654 |
-
if ($this->strikethrough) {
|
655 |
-
$richtextRun->getFont()->setStrikethrough(true);
|
656 |
-
}
|
657 |
-
$this->stringData = '';
|
658 |
-
}
|
659 |
-
|
660 |
-
protected function rgbToColour($rgb)
|
661 |
-
{
|
662 |
-
preg_match_all('/\d+/', $rgb, $values);
|
663 |
-
foreach ($values[0] as &$value) {
|
664 |
-
$value = str_pad(dechex($value), 2, '0', STR_PAD_LEFT);
|
665 |
-
}
|
666 |
-
return implode($values[0]);
|
667 |
-
}
|
668 |
-
|
669 |
-
protected function colourNameLookup($rgb)
|
670 |
-
{
|
671 |
-
return self::$colourMap[$rgb];
|
672 |
-
}
|
673 |
-
|
674 |
-
protected function startFontTag($tag)
|
675 |
-
{
|
676 |
-
foreach ($tag->attributes as $attribute) {
|
677 |
-
$attributeName = strtolower($attribute->name);
|
678 |
-
$attributeValue = $attribute->value;
|
679 |
-
|
680 |
-
if ($attributeName == 'color') {
|
681 |
-
if (preg_match('/rgb\s*\(/', $attributeValue)) {
|
682 |
-
$this->$attributeName = $this->rgbToColour($attributeValue);
|
683 |
-
} elseif (strpos(trim($attributeValue), '#') === 0) {
|
684 |
-
$this->$attributeName = ltrim($attributeValue, '#');
|
685 |
-
} else {
|
686 |
-
$this->$attributeName = $this->colourNameLookup($attributeValue);
|
687 |
-
}
|
688 |
-
} else {
|
689 |
-
$this->$attributeName = $attributeValue;
|
690 |
-
}
|
691 |
-
}
|
692 |
-
}
|
693 |
-
|
694 |
-
protected function endFontTag()
|
695 |
-
{
|
696 |
-
$this->face = $this->size = $this->color = null;
|
697 |
-
}
|
698 |
-
|
699 |
-
protected function startBoldTag()
|
700 |
-
{
|
701 |
-
$this->bold = true;
|
702 |
-
}
|
703 |
-
|
704 |
-
protected function endBoldTag()
|
705 |
-
{
|
706 |
-
$this->bold = false;
|
707 |
-
}
|
708 |
-
|
709 |
-
protected function startItalicTag()
|
710 |
-
{
|
711 |
-
$this->italic = true;
|
712 |
-
}
|
713 |
-
|
714 |
-
protected function endItalicTag()
|
715 |
-
{
|
716 |
-
$this->italic = false;
|
717 |
-
}
|
718 |
-
|
719 |
-
protected function startUnderlineTag()
|
720 |
-
{
|
721 |
-
$this->underline = true;
|
722 |
-
}
|
723 |
-
|
724 |
-
protected function endUnderlineTag()
|
725 |
-
{
|
726 |
-
$this->underline = false;
|
727 |
-
}
|
728 |
-
|
729 |
-
protected function startSubscriptTag()
|
730 |
-
{
|
731 |
-
$this->subscript = true;
|
732 |
-
}
|
733 |
-
|
734 |
-
protected function endSubscriptTag()
|
735 |
-
{
|
736 |
-
$this->subscript = false;
|
737 |
-
}
|
738 |
-
|
739 |
-
protected function startSuperscriptTag()
|
740 |
-
{
|
741 |
-
$this->superscript = true;
|
742 |
-
}
|
743 |
-
|
744 |
-
protected function endSuperscriptTag()
|
745 |
-
{
|
746 |
-
$this->superscript = false;
|
747 |
-
}
|
748 |
-
|
749 |
-
protected function startStrikethruTag()
|
750 |
-
{
|
751 |
-
$this->strikethrough = true;
|
752 |
-
}
|
753 |
-
|
754 |
-
protected function endStrikethruTag()
|
755 |
-
{
|
756 |
-
$this->strikethrough = false;
|
757 |
-
}
|
758 |
-
|
759 |
-
protected function breakTag()
|
760 |
-
{
|
761 |
-
$this->stringData .= "\n";
|
762 |
-
}
|
763 |
-
|
764 |
-
protected function parseTextNode(DOMText $textNode)
|
765 |
-
{
|
766 |
-
$domText = preg_replace(
|
767 |
-
'/\s+/u',
|
768 |
-
' ',
|
769 |
-
str_replace(array("\r", "\n"), ' ', $textNode->nodeValue)
|
770 |
-
);
|
771 |
-
$this->stringData .= $domText;
|
772 |
-
$this->buildTextRun();
|
773 |
-
}
|
774 |
-
|
775 |
-
protected function handleCallback($element, $callbackTag, $callbacks)
|
776 |
-
{
|
777 |
-
if (isset($callbacks[$callbackTag])) {
|
778 |
-
$elementHandler = $callbacks[$callbackTag];
|
779 |
-
if (method_exists($this, $elementHandler)) {
|
780 |
-
call_user_func(array($this, $elementHandler), $element);
|
781 |
-
}
|
782 |
-
}
|
783 |
-
}
|
784 |
-
|
785 |
-
protected function parseElementNode(DOMElement $element)
|
786 |
-
{
|
787 |
-
$callbackTag = strtolower($element->nodeName);
|
788 |
-
$this->stack[] = $callbackTag;
|
789 |
-
|
790 |
-
$this->handleCallback($element, $callbackTag, $this->startTagCallbacks);
|
791 |
-
|
792 |
-
$this->parseElements($element);
|
793 |
-
array_pop($this->stack);
|
794 |
-
|
795 |
-
$this->handleCallback($element, $callbackTag, $this->endTagCallbacks);
|
796 |
-
}
|
797 |
-
|
798 |
-
protected function parseElements(DOMNode $element)
|
799 |
-
{
|
800 |
-
foreach ($element->childNodes as $child) {
|
801 |
-
if ($child instanceof DOMText) {
|
802 |
-
$this->parseTextNode($child);
|
803 |
-
} elseif ($child instanceof DOMElement) {
|
804 |
-
$this->parseElementNode($child);
|
805 |
-
}
|
806 |
-
}
|
807 |
-
}
|
808 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PHPExcel_Helper_HTML
|
4 |
+
{
|
5 |
+
protected static $colourMap = array(
|
6 |
+
'aliceblue' => 'f0f8ff',
|
7 |
+
'antiquewhite' => 'faebd7',
|
8 |
+
'antiquewhite1' => 'ffefdb',
|
9 |
+
'antiquewhite2' => 'eedfcc',
|
10 |
+
'antiquewhite3' => 'cdc0b0',
|
11 |
+
'antiquewhite4' => '8b8378',
|
12 |
+
'aqua' => '00ffff',
|
13 |
+
'aquamarine1' => '7fffd4',
|
14 |
+
'aquamarine2' => '76eec6',
|
15 |
+
'aquamarine4' => '458b74',
|
16 |
+
'azure1' => 'f0ffff',
|
17 |
+
'azure2' => 'e0eeee',
|
18 |
+
'azure3' => 'c1cdcd',
|
19 |
+
'azure4' => '838b8b',
|
20 |
+
'beige' => 'f5f5dc',
|
21 |
+
'bisque1' => 'ffe4c4',
|
22 |
+
'bisque2' => 'eed5b7',
|
23 |
+
'bisque3' => 'cdb79e',
|
24 |
+
'bisque4' => '8b7d6b',
|
25 |
+
'black' => '000000',
|
26 |
+
'blanchedalmond' => 'ffebcd',
|
27 |
+
'blue' => '0000ff',
|
28 |
+
'blue1' => '0000ff',
|
29 |
+
'blue2' => '0000ee',
|
30 |
+
'blue4' => '00008b',
|
31 |
+
'blueviolet' => '8a2be2',
|
32 |
+
'brown' => 'a52a2a',
|
33 |
+
'brown1' => 'ff4040',
|
34 |
+
'brown2' => 'ee3b3b',
|
35 |
+
'brown3' => 'cd3333',
|
36 |
+
'brown4' => '8b2323',
|
37 |
+
'burlywood' => 'deb887',
|
38 |
+
'burlywood1' => 'ffd39b',
|
39 |
+
'burlywood2' => 'eec591',
|
40 |
+
'burlywood3' => 'cdaa7d',
|
41 |
+
'burlywood4' => '8b7355',
|
42 |
+
'cadetblue' => '5f9ea0',
|
43 |
+
'cadetblue1' => '98f5ff',
|
44 |
+
'cadetblue2' => '8ee5ee',
|
45 |
+
'cadetblue3' => '7ac5cd',
|
46 |
+
'cadetblue4' => '53868b',
|
47 |
+
'chartreuse1' => '7fff00',
|
48 |
+
'chartreuse2' => '76ee00',
|
49 |
+
'chartreuse3' => '66cd00',
|
50 |
+
'chartreuse4' => '458b00',
|
51 |
+
'chocolate' => 'd2691e',
|
52 |
+
'chocolate1' => 'ff7f24',
|
53 |
+
'chocolate2' => 'ee7621',
|
54 |
+
'chocolate3' => 'cd661d',
|
55 |
+
'coral' => 'ff7f50',
|
56 |
+
'coral1' => 'ff7256',
|
57 |
+
'coral2' => 'ee6a50',
|
58 |
+
'coral3' => 'cd5b45',
|
59 |
+
'coral4' => '8b3e2f',
|
60 |
+
'cornflowerblue' => '6495ed',
|
61 |
+
'cornsilk1' => 'fff8dc',
|
62 |
+
'cornsilk2' => 'eee8cd',
|
63 |
+
'cornsilk3' => 'cdc8b1',
|
64 |
+
'cornsilk4' => '8b8878',
|
65 |
+
'cyan1' => '00ffff',
|
66 |
+
'cyan2' => '00eeee',
|
67 |
+
'cyan3' => '00cdcd',
|
68 |
+
'cyan4' => '008b8b',
|
69 |
+
'darkgoldenrod' => 'b8860b',
|
70 |
+
'darkgoldenrod1' => 'ffb90f',
|
71 |
+
'darkgoldenrod2' => 'eead0e',
|
72 |
+
'darkgoldenrod3' => 'cd950c',
|
73 |
+
'darkgoldenrod4' => '8b6508',
|
74 |
+
'darkgreen' => '006400',
|
75 |
+
'darkkhaki' => 'bdb76b',
|
76 |
+
'darkolivegreen' => '556b2f',
|
77 |
+
'darkolivegreen1' => 'caff70',
|
78 |
+
'darkolivegreen2' => 'bcee68',
|
79 |
+
'darkolivegreen3' => 'a2cd5a',
|
80 |
+
'darkolivegreen4' => '6e8b3d',
|
81 |
+
'darkorange' => 'ff8c00',
|
82 |
+
'darkorange1' => 'ff7f00',
|
83 |
+
'darkorange2' => 'ee7600',
|
84 |
+
'darkorange3' => 'cd6600',
|
85 |
+
'darkorange4' => '8b4500',
|
86 |
+
'darkorchid' => '9932cc',
|
87 |
+
'darkorchid1' => 'bf3eff',
|
88 |
+
'darkorchid2' => 'b23aee',
|
89 |
+
'darkorchid3' => '9a32cd',
|
90 |
+
'darkorchid4' => '68228b',
|
91 |
+
'darksalmon' => 'e9967a',
|
92 |
+
'darkseagreen' => '8fbc8f',
|
93 |
+
'darkseagreen1' => 'c1ffc1',
|
94 |
+
'darkseagreen2' => 'b4eeb4',
|
95 |
+
'darkseagreen3' => '9bcd9b',
|
96 |
+
'darkseagreen4' => '698b69',
|
97 |
+
'darkslateblue' => '483d8b',
|
98 |
+
'darkslategray' => '2f4f4f',
|
99 |
+
'darkslategray1' => '97ffff',
|
100 |
+
'darkslategray2' => '8deeee',
|
101 |
+
'darkslategray3' => '79cdcd',
|
102 |
+
'darkslategray4' => '528b8b',
|
103 |
+
'darkturquoise' => '00ced1',
|
104 |
+
'darkviolet' => '9400d3',
|
105 |
+
'deeppink1' => 'ff1493',
|
106 |
+
'deeppink2' => 'ee1289',
|
107 |
+
'deeppink3' => 'cd1076',
|
108 |
+
'deeppink4' => '8b0a50',
|
109 |
+
'deepskyblue1' => '00bfff',
|
110 |
+
'deepskyblue2' => '00b2ee',
|
111 |
+
'deepskyblue3' => '009acd',
|
112 |
+
'deepskyblue4' => '00688b',
|
113 |
+
'dimgray' => '696969',
|
114 |
+
'dodgerblue1' => '1e90ff',
|
115 |
+
'dodgerblue2' => '1c86ee',
|
116 |
+
'dodgerblue3' => '1874cd',
|
117 |
+
'dodgerblue4' => '104e8b',
|
118 |
+
'firebrick' => 'b22222',
|
119 |
+
'firebrick1' => 'ff3030',
|
120 |
+
'firebrick2' => 'ee2c2c',
|
121 |
+
'firebrick3' => 'cd2626',
|
122 |
+
'firebrick4' => '8b1a1a',
|
123 |
+
'floralwhite' => 'fffaf0',
|
124 |
+
'forestgreen' => '228b22',
|
125 |
+
'fuchsia' => 'ff00ff',
|
126 |
+
'gainsboro' => 'dcdcdc',
|
127 |
+
'ghostwhite' => 'f8f8ff',
|
128 |
+
'gold1' => 'ffd700',
|
129 |
+
'gold2' => 'eec900',
|
130 |
+
'gold3' => 'cdad00',
|
131 |
+
'gold4' => '8b7500',
|
132 |
+
'goldenrod' => 'daa520',
|
133 |
+
'goldenrod1' => 'ffc125',
|
134 |
+
'goldenrod2' => 'eeb422',
|
135 |
+
'goldenrod3' => 'cd9b1d',
|
136 |
+
'goldenrod4' => '8b6914',
|
137 |
+
'gray' => 'bebebe',
|
138 |
+
'gray1' => '030303',
|
139 |
+
'gray10' => '1a1a1a',
|
140 |
+
'gray11' => '1c1c1c',
|
141 |
+
'gray12' => '1f1f1f',
|
142 |
+
'gray13' => '212121',
|
143 |
+
'gray14' => '242424',
|
144 |
+
'gray15' => '262626',
|
145 |
+
'gray16' => '292929',
|
146 |
+
'gray17' => '2b2b2b',
|
147 |
+
'gray18' => '2e2e2e',
|
148 |
+
'gray19' => '303030',
|
149 |
+
'gray2' => '050505',
|
150 |
+
'gray20' => '333333',
|
151 |
+
'gray21' => '363636',
|
152 |
+
'gray22' => '383838',
|
153 |
+
'gray23' => '3b3b3b',
|
154 |
+
'gray24' => '3d3d3d',
|
155 |
+
'gray25' => '404040',
|
156 |
+
'gray26' => '424242',
|
157 |
+
'gray27' => '454545',
|
158 |
+
'gray28' => '474747',
|
159 |
+
'gray29' => '4a4a4a',
|
160 |
+
'gray3' => '080808',
|
161 |
+
'gray30' => '4d4d4d',
|
162 |
+
'gray31' => '4f4f4f',
|
163 |
+
'gray32' => '525252',
|
164 |
+
'gray33' => '545454',
|
165 |
+
'gray34' => '575757',
|
166 |
+
'gray35' => '595959',
|
167 |
+
'gray36' => '5c5c5c',
|
168 |
+
'gray37' => '5e5e5e',
|
169 |
+
'gray38' => '616161',
|
170 |
+
'gray39' => '636363',
|
171 |
+
'gray4' => '0a0a0a',
|
172 |
+
'gray40' => '666666',
|
173 |
+
'gray41' => '696969',
|
174 |
+
'gray42' => '6b6b6b',
|
175 |
+
'gray43' => '6e6e6e',
|
176 |
+
'gray44' => '707070',
|
177 |
+
'gray45' => '737373',
|
178 |
+
'gray46' => '757575',
|
179 |
+
'gray47' => '787878',
|
180 |
+
'gray48' => '7a7a7a',
|
181 |
+
'gray49' => '7d7d7d',
|
182 |
+
'gray5' => '0d0d0d',
|
183 |
+
'gray50' => '7f7f7f',
|
184 |
+
'gray51' => '828282',
|
185 |
+
'gray52' => '858585',
|
186 |
+
'gray53' => '878787',
|
187 |
+
'gray54' => '8a8a8a',
|
188 |
+
'gray55' => '8c8c8c',
|
189 |
+
'gray56' => '8f8f8f',
|
190 |
+
'gray57' => '919191',
|
191 |
+
'gray58' => '949494',
|
192 |
+
'gray59' => '969696',
|
193 |
+
'gray6' => '0f0f0f',
|
194 |
+
'gray60' => '999999',
|
195 |
+
'gray61' => '9c9c9c',
|
196 |
+
'gray62' => '9e9e9e',
|
197 |
+
'gray63' => 'a1a1a1',
|
198 |
+
'gray64' => 'a3a3a3',
|
199 |
+
'gray65' => 'a6a6a6',
|
200 |
+
'gray66' => 'a8a8a8',
|
201 |
+
'gray67' => 'ababab',
|
202 |
+
'gray68' => 'adadad',
|
203 |
+
'gray69' => 'b0b0b0',
|
204 |
+
'gray7' => '121212',
|
205 |
+
'gray70' => 'b3b3b3',
|
206 |
+
'gray71' => 'b5b5b5',
|
207 |
+
'gray72' => 'b8b8b8',
|
208 |
+
'gray73' => 'bababa',
|
209 |
+
'gray74' => 'bdbdbd',
|
210 |
+
'gray75' => 'bfbfbf',
|
211 |
+
'gray76' => 'c2c2c2',
|
212 |
+
'gray77' => 'c4c4c4',
|
213 |
+
'gray78' => 'c7c7c7',
|
214 |
+
'gray79' => 'c9c9c9',
|
215 |
+
'gray8' => '141414',
|
216 |
+
'gray80' => 'cccccc',
|
217 |
+
'gray81' => 'cfcfcf',
|
218 |
+
'gray82' => 'd1d1d1',
|
219 |
+
'gray83' => 'd4d4d4',
|
220 |
+
'gray84' => 'd6d6d6',
|
221 |
+
'gray85' => 'd9d9d9',
|
222 |
+
'gray86' => 'dbdbdb',
|
223 |
+
'gray87' => 'dedede',
|
224 |
+
'gray88' => 'e0e0e0',
|
225 |
+
'gray89' => 'e3e3e3',
|
226 |
+
'gray9' => '171717',
|
227 |
+
'gray90' => 'e5e5e5',
|
228 |
+
'gray91' => 'e8e8e8',
|
229 |
+
'gray92' => 'ebebeb',
|
230 |
+
'gray93' => 'ededed',
|
231 |
+
'gray94' => 'f0f0f0',
|
232 |
+
'gray95' => 'f2f2f2',
|
233 |
+
'gray97' => 'f7f7f7',
|
234 |
+
'gray98' => 'fafafa',
|
235 |
+
'gray99' => 'fcfcfc',
|
236 |
+
'green' => '00ff00',
|
237 |
+
'green1' => '00ff00',
|
238 |
+
'green2' => '00ee00',
|
239 |
+
'green3' => '00cd00',
|
240 |
+
'green4' => '008b00',
|
241 |
+
'greenyellow' => 'adff2f',
|
242 |
+
'honeydew1' => 'f0fff0',
|
243 |
+
'honeydew2' => 'e0eee0',
|
244 |
+
'honeydew3' => 'c1cdc1',
|
245 |
+
'honeydew4' => '838b83',
|
246 |
+
'hotpink' => 'ff69b4',
|
247 |
+
'hotpink1' => 'ff6eb4',
|
248 |
+
'hotpink2' => 'ee6aa7',
|
249 |
+
'hotpink3' => 'cd6090',
|
250 |
+
'hotpink4' => '8b3a62',
|
251 |
+
'indianred' => 'cd5c5c',
|
252 |
+
'indianred1' => 'ff6a6a',
|
253 |
+
'indianred2' => 'ee6363',
|
254 |
+
'indianred3' => 'cd5555',
|
255 |
+
'indianred4' => '8b3a3a',
|
256 |
+
'ivory1' => 'fffff0',
|
257 |
+
'ivory2' => 'eeeee0',
|
258 |
+
'ivory3' => 'cdcdc1',
|
259 |
+
'ivory4' => '8b8b83',
|
260 |
+
'khaki' => 'f0e68c',
|
261 |
+
'khaki1' => 'fff68f',
|
262 |
+
'khaki2' => 'eee685',
|
263 |
+
'khaki3' => 'cdc673',
|
264 |
+
'khaki4' => '8b864e',
|
265 |
+
'lavender' => 'e6e6fa',
|
266 |
+
'lavenderblush1' => 'fff0f5',
|
267 |
+
'lavenderblush2' => 'eee0e5',
|
268 |
+
'lavenderblush3' => 'cdc1c5',
|
269 |
+
'lavenderblush4' => '8b8386',
|
270 |
+
'lawngreen' => '7cfc00',
|
271 |
+
'lemonchiffon1' => 'fffacd',
|
272 |
+
'lemonchiffon2' => 'eee9bf',
|
273 |
+
'lemonchiffon3' => 'cdc9a5',
|
274 |
+
'lemonchiffon4' => '8b8970',
|
275 |
+
'light' => 'eedd82',
|
276 |
+
'lightblue' => 'add8e6',
|
277 |
+
'lightblue1' => 'bfefff',
|
278 |
+
'lightblue2' => 'b2dfee',
|
279 |
+
'lightblue3' => '9ac0cd',
|
280 |
+
'lightblue4' => '68838b',
|
281 |
+
'lightcoral' => 'f08080',
|
282 |
+
'lightcyan1' => 'e0ffff',
|
283 |
+
'lightcyan2' => 'd1eeee',
|
284 |
+
'lightcyan3' => 'b4cdcd',
|
285 |
+
'lightcyan4' => '7a8b8b',
|
286 |
+
'lightgoldenrod1' => 'ffec8b',
|
287 |
+
'lightgoldenrod2' => 'eedc82',
|
288 |
+
'lightgoldenrod3' => 'cdbe70',
|
289 |
+
'lightgoldenrod4' => '8b814c',
|
290 |
+
'lightgoldenrodyellow' => 'fafad2',
|
291 |
+
'lightgray' => 'd3d3d3',
|
292 |
+
'lightpink' => 'ffb6c1',
|
293 |
+
'lightpink1' => 'ffaeb9',
|
294 |
+
'lightpink2' => 'eea2ad',
|
295 |
+
'lightpink3' => 'cd8c95',
|
296 |
+
'lightpink4' => '8b5f65',
|
297 |
+
'lightsalmon1' => 'ffa07a',
|
298 |
+
'lightsalmon2' => 'ee9572',
|
299 |
+
'lightsalmon3' => 'cd8162',
|
300 |
+
'lightsalmon4' => '8b5742',
|
301 |
+
'lightseagreen' => '20b2aa',
|
302 |
+
'lightskyblue' => '87cefa',
|
303 |
+
'lightskyblue1' => 'b0e2ff',
|
304 |
+
'lightskyblue2' => 'a4d3ee',
|
305 |
+
'lightskyblue3' => '8db6cd',
|
306 |
+
'lightskyblue4' => '607b8b',
|
307 |
+
'lightslateblue' => '8470ff',
|
308 |
+
'lightslategray' => '778899',
|
309 |
+
'lightsteelblue' => 'b0c4de',
|
310 |
+
'lightsteelblue1' => 'cae1ff',
|
311 |
+
'lightsteelblue2' => 'bcd2ee',
|
312 |
+
'lightsteelblue3' => 'a2b5cd',
|
313 |
+
'lightsteelblue4' => '6e7b8b',
|
314 |
+
'lightyellow1' => 'ffffe0',
|
315 |
+
'lightyellow2' => 'eeeed1',
|
316 |
+
'lightyellow3' => 'cdcdb4',
|
317 |
+
'lightyellow4' => '8b8b7a',
|
318 |
+
'lime' => '00ff00',
|
319 |
+
'limegreen' => '32cd32',
|
320 |
+
'linen' => 'faf0e6',
|
321 |
+
'magenta' => 'ff00ff',
|
322 |
+
'magenta2' => 'ee00ee',
|
323 |
+
'magenta3' => 'cd00cd',
|
324 |
+
'magenta4' => '8b008b',
|
325 |
+
'maroon' => 'b03060',
|
326 |
+
'maroon1' => 'ff34b3',
|
327 |
+
'maroon2' => 'ee30a7',
|
328 |
+
'maroon3' => 'cd2990',
|
329 |
+
'maroon4' => '8b1c62',
|
330 |
+
'medium' => '66cdaa',
|
331 |
+
'mediumaquamarine' => '66cdaa',
|
332 |
+
'mediumblue' => '0000cd',
|
333 |
+
'mediumorchid' => 'ba55d3',
|
334 |
+
'mediumorchid1' => 'e066ff',
|
335 |
+
'mediumorchid2' => 'd15fee',
|
336 |
+
'mediumorchid3' => 'b452cd',
|
337 |
+
'mediumorchid4' => '7a378b',
|
338 |
+
'mediumpurple' => '9370db',
|
339 |
+
'mediumpurple1' => 'ab82ff',
|
340 |
+
'mediumpurple2' => '9f79ee',
|
341 |
+
'mediumpurple3' => '8968cd',
|
342 |
+
'mediumpurple4' => '5d478b',
|
343 |
+
'mediumseagreen' => '3cb371',
|
344 |
+
'mediumslateblue' => '7b68ee',
|
345 |
+
'mediumspringgreen' => '00fa9a',
|
346 |
+
'mediumturquoise' => '48d1cc',
|
347 |
+
'mediumvioletred' => 'c71585',
|
348 |
+
'midnightblue' => '191970',
|
349 |
+
'mintcream' => 'f5fffa',
|
350 |
+
'mistyrose1' => 'ffe4e1',
|
351 |
+
'mistyrose2' => 'eed5d2',
|
352 |
+
'mistyrose3' => 'cdb7b5',
|
353 |
+
'mistyrose4' => '8b7d7b',
|
354 |
+
'moccasin' => 'ffe4b5',
|
355 |
+
'navajowhite1' => 'ffdead',
|
356 |
+
'navajowhite2' => 'eecfa1',
|
357 |
+
'navajowhite3' => 'cdb38b',
|
358 |
+
'navajowhite4' => '8b795e',
|
359 |
+
'navy' => '000080',
|
360 |
+
'navyblue' => '000080',
|
361 |
+
'oldlace' => 'fdf5e6',
|
362 |
+
'olive' => '808000',
|
363 |
+
'olivedrab' => '6b8e23',
|
364 |
+
'olivedrab1' => 'c0ff3e',
|
365 |
+
'olivedrab2' => 'b3ee3a',
|
366 |
+
'olivedrab4' => '698b22',
|
367 |
+
'orange' => 'ffa500',
|
368 |
+
'orange1' => 'ffa500',
|
369 |
+
'orange2' => 'ee9a00',
|
370 |
+
'orange3' => 'cd8500',
|
371 |
+
'orange4' => '8b5a00',
|
372 |
+
'orangered1' => 'ff4500',
|
373 |
+
'orangered2' => 'ee4000',
|
374 |
+
'orangered3' => 'cd3700',
|
375 |
+
'orangered4' => '8b2500',
|
376 |
+
'orchid' => 'da70d6',
|
377 |
+
'orchid1' => 'ff83fa',
|
378 |
+
'orchid2' => 'ee7ae9',
|
379 |
+
'orchid3' => 'cd69c9',
|
380 |
+
'orchid4' => '8b4789',
|
381 |
+
'pale' => 'db7093',
|
382 |
+
'palegoldenrod' => 'eee8aa',
|
383 |
+
'palegreen' => '98fb98',
|
384 |
+
'palegreen1' => '9aff9a',
|
385 |
+
'palegreen2' => '90ee90',
|
386 |
+
'palegreen3' => '7ccd7c',
|
387 |
+
'palegreen4' => '548b54',
|
388 |
+
'paleturquoise' => 'afeeee',
|
389 |
+
'paleturquoise1' => 'bbffff',
|
390 |
+
'paleturquoise2' => 'aeeeee',
|
391 |
+
'paleturquoise3' => '96cdcd',
|
392 |
+
'paleturquoise4' => '668b8b',
|
393 |
+
'palevioletred' => 'db7093',
|
394 |
+
'palevioletred1' => 'ff82ab',
|
395 |
+
'palevioletred2' => 'ee799f',
|
396 |
+
'palevioletred3' => 'cd6889',
|
397 |
+
'palevioletred4' => '8b475d',
|
398 |
+
'papayawhip' => 'ffefd5',
|
399 |
+
'peachpuff1' => 'ffdab9',
|
400 |
+
'peachpuff2' => 'eecbad',
|
401 |
+
'peachpuff3' => 'cdaf95',
|
402 |
+
'peachpuff4' => '8b7765',
|
403 |
+
'pink' => 'ffc0cb',
|
404 |
+
'pink1' => 'ffb5c5',
|
405 |
+
'pink2' => 'eea9b8',
|
406 |
+
'pink3' => 'cd919e',
|
407 |
+
'pink4' => '8b636c',
|
408 |
+
'plum' => 'dda0dd',
|
409 |
+
'plum1' => 'ffbbff',
|
410 |
+
'plum2' => 'eeaeee',
|
411 |
+
'plum3' => 'cd96cd',
|
412 |
+
'plum4' => '8b668b',
|
413 |
+
'powderblue' => 'b0e0e6',
|
414 |
+
'purple' => 'a020f0',
|
415 |
+
'rebeccapurple' => '663399',
|
416 |
+
'purple1' => '9b30ff',
|
417 |
+
'purple2' => '912cee',
|
418 |
+
'purple3' => '7d26cd',
|
419 |
+
'purple4' => '551a8b',
|
420 |
+
'red' => 'ff0000',
|
421 |
+
'red1' => 'ff0000',
|
422 |
+
'red2' => 'ee0000',
|
423 |
+
'red3' => 'cd0000',
|
424 |
+
'red4' => '8b0000',
|
425 |
+
'rosybrown' => 'bc8f8f',
|
426 |
+
'rosybrown1' => 'ffc1c1',
|
427 |
+
'rosybrown2' => 'eeb4b4',
|
428 |
+
'rosybrown3' => 'cd9b9b',
|
429 |
+
'rosybrown4' => '8b6969',
|
430 |
+
'royalblue' => '4169e1',
|
431 |
+
'royalblue1' => '4876ff',
|
432 |
+
'royalblue2' => '436eee',
|
433 |
+
'royalblue3' => '3a5fcd',
|
434 |
+
'royalblue4' => '27408b',
|
435 |
+
'saddlebrown' => '8b4513',
|
436 |
+
'salmon' => 'fa8072',
|
437 |
+
'salmon1' => 'ff8c69',
|
438 |
+
'salmon2' => 'ee8262',
|
439 |
+
'salmon3' => 'cd7054',
|
440 |
+
'salmon4' => '8b4c39',
|
441 |
+
'sandybrown' => 'f4a460',
|
442 |
+
'seagreen1' => '54ff9f',
|
443 |
+
'seagreen2' => '4eee94',
|
444 |
+
'seagreen3' => '43cd80',
|
445 |
+
'seagreen4' => '2e8b57',
|
446 |
+
'seashell1' => 'fff5ee',
|
447 |
+
'seashell2' => 'eee5de',
|
448 |
+
'seashell3' => 'cdc5bf',
|
449 |
+
'seashell4' => '8b8682',
|
450 |
+
'sienna' => 'a0522d',
|
451 |
+
'sienna1' => 'ff8247',
|
452 |
+
'sienna2' => 'ee7942',
|
453 |
+
'sienna3' => 'cd6839',
|
454 |
+
'sienna4' => '8b4726',
|
455 |
+
'silver' => 'c0c0c0',
|
456 |
+
'skyblue' => '87ceeb',
|
457 |
+
'skyblue1' => '87ceff',
|
458 |
+
'skyblue2' => '7ec0ee',
|
459 |
+
'skyblue3' => '6ca6cd',
|
460 |
+
'skyblue4' => '4a708b',
|
461 |
+
'slateblue' => '6a5acd',
|
462 |
+
'slateblue1' => '836fff',
|
463 |
+
'slateblue2' => '7a67ee',
|
464 |
+
'slateblue3' => '6959cd',
|
465 |
+
'slateblue4' => '473c8b',
|
466 |
+
'slategray' => '708090',
|
467 |
+
'slategray1' => 'c6e2ff',
|
468 |
+
'slategray2' => 'b9d3ee',
|
469 |
+
'slategray3' => '9fb6cd',
|
470 |
+
'slategray4' => '6c7b8b',
|
471 |
+
'snow1' => 'fffafa',
|
472 |
+
'snow2' => 'eee9e9',
|
473 |
+
'snow3' => 'cdc9c9',
|
474 |
+
'snow4' => '8b8989',
|
475 |
+
'springgreen1' => '00ff7f',
|
476 |
+
'springgreen2' => '00ee76',
|
477 |
+
'springgreen3' => '00cd66',
|
478 |
+
'springgreen4' => '008b45',
|
479 |
+
'steelblue' => '4682b4',
|
480 |
+
'steelblue1' => '63b8ff',
|
481 |
+
'steelblue2' => '5cacee',
|
482 |
+
'steelblue3' => '4f94cd',
|
483 |
+
'steelblue4' => '36648b',
|
484 |
+
'tan' => 'd2b48c',
|
485 |
+
'tan1' => 'ffa54f',
|
486 |
+
'tan2' => 'ee9a49',
|
487 |
+
'tan3' => 'cd853f',
|
488 |
+
'tan4' => '8b5a2b',
|
489 |
+
'teal' => '008080',
|
490 |
+
'thistle' => 'd8bfd8',
|
491 |
+
'thistle1' => 'ffe1ff',
|
492 |
+
'thistle2' => 'eed2ee',
|
493 |
+
'thistle3' => 'cdb5cd',
|
494 |
+
'thistle4' => '8b7b8b',
|
495 |
+
'tomato1' => 'ff6347',
|
496 |
+
'tomato2' => 'ee5c42',
|
497 |
+
'tomato3' => 'cd4f39',
|
498 |
+
'tomato4' => '8b3626',
|
499 |
+
'turquoise' => '40e0d0',
|
500 |
+
'turquoise1' => '00f5ff',
|
501 |
+
'turquoise2' => '00e5ee',
|
502 |
+
'turquoise3' => '00c5cd',
|
503 |
+
'turquoise4' => '00868b',
|
504 |
+
'violet' => 'ee82ee',
|
505 |
+
'violetred' => 'd02090',
|
506 |
+
'violetred1' => 'ff3e96',
|
507 |
+
'violetred2' => 'ee3a8c',
|
508 |
+
'violetred3' => 'cd3278',
|
509 |
+
'violetred4' => '8b2252',
|
510 |
+
'wheat' => 'f5deb3',
|
511 |
+
'wheat1' => 'ffe7ba',
|
512 |
+
'wheat2' => 'eed8ae',
|
513 |
+
'wheat3' => 'cdba96',
|
514 |
+
'wheat4' => '8b7e66',
|
515 |
+
'white' => 'ffffff',
|
516 |
+
'whitesmoke' => 'f5f5f5',
|
517 |
+
'yellow' => 'ffff00',
|
518 |
+
'yellow1' => 'ffff00',
|
519 |
+
'yellow2' => 'eeee00',
|
520 |
+
'yellow3' => 'cdcd00',
|
521 |
+
'yellow4' => '8b8b00',
|
522 |
+
'yellowgreen' => '9acd32',
|
523 |
+
);
|
524 |
+
|
525 |
+
protected $face;
|
526 |
+
protected $size;
|
527 |
+
protected $color;
|
528 |
+
|
529 |
+
protected $bold = false;
|
530 |
+
protected $italic = false;
|
531 |
+
protected $underline = false;
|
532 |
+
protected $superscript = false;
|
533 |
+
protected $subscript = false;
|
534 |
+
protected $strikethrough = false;
|
535 |
+
|
536 |
+
protected $startTagCallbacks = array(
|
537 |
+
'font' => 'startFontTag',
|
538 |
+
'b' => 'startBoldTag',
|
539 |
+
'strong' => 'startBoldTag',
|
540 |
+
'i' => 'startItalicTag',
|
541 |
+
'em' => 'startItalicTag',
|
542 |
+
'u' => 'startUnderlineTag',
|
543 |
+
'ins' => 'startUnderlineTag',
|
544 |
+
'del' => 'startStrikethruTag',
|
545 |
+
'sup' => 'startSuperscriptTag',
|
546 |
+
'sub' => 'startSubscriptTag',
|
547 |
+
);
|
548 |
+
|
549 |
+
protected $endTagCallbacks = array(
|
550 |
+
'font' => 'endFontTag',
|
551 |
+
'b' => 'endBoldTag',
|
552 |
+
'strong' => 'endBoldTag',
|
553 |
+
'i' => 'endItalicTag',
|
554 |
+
'em' => 'endItalicTag',
|
555 |
+
'u' => 'endUnderlineTag',
|
556 |
+
'ins' => 'endUnderlineTag',
|
557 |
+
'del' => 'endStrikethruTag',
|
558 |
+
'sup' => 'endSuperscriptTag',
|
559 |
+
'sub' => 'endSubscriptTag',
|
560 |
+
'br' => 'breakTag',
|
561 |
+
'p' => 'breakTag',
|
562 |
+
'h1' => 'breakTag',
|
563 |
+
'h2' => 'breakTag',
|
564 |
+
'h3' => 'breakTag',
|
565 |
+
'h4' => 'breakTag',
|
566 |
+
'h5' => 'breakTag',
|
567 |
+
'h6' => 'breakTag',
|
568 |
+
);
|
569 |
+
|
570 |
+
protected $stack = array();
|
571 |
+
|
572 |
+
protected $stringData = '';
|
573 |
+
|
574 |
+
protected $richTextObject;
|
575 |
+
|
576 |
+
protected function initialise()
|
577 |
+
{
|
578 |
+
$this->face = $this->size = $this->color = null;
|
579 |
+
$this->bold = $this->italic = $this->underline = $this->superscript = $this->subscript = $this->strikethrough = false;
|
580 |
+
|
581 |
+
$this->stack = array();
|
582 |
+
|
583 |
+
$this->stringData = '';
|
584 |
+
}
|
585 |
+
|
586 |
+
public function toRichTextObject($html)
|
587 |
+
{
|
588 |
+
$this->initialise();
|
589 |
+
|
590 |
+
// Create a new DOM object
|
591 |
+
$dom = new \DOMDocument;
|
592 |
+
// Load the HTML file into the DOM object
|
593 |
+
// Note the use of error suppression, because typically this will be an html fragment, so not fully valid markup
|
594 |
+
$loaded = @$dom->loadHTML($html);
|
595 |
+
|
596 |
+
// Discard excess white space
|
597 |
+
$dom->preserveWhiteSpace = false;
|
598 |
+
|
599 |
+
$this->richTextObject = new PHPExcel_RichText();;
|
600 |
+
$this->parseElements($dom);
|
601 |
+
|
602 |
+
// Clean any further spurious whitespace
|
603 |
+
$this->cleanWhitespace();
|
604 |
+
|
605 |
+
return $this->richTextObject;
|
606 |
+
}
|
607 |
+
|
608 |
+
protected function cleanWhitespace()
|
609 |
+
{
|
610 |
+
foreach ($this->richTextObject->getRichTextElements() as $key => $element) {
|
611 |
+
$text = $element->getText();
|
612 |
+
// Trim any leading spaces on the first run
|
613 |
+
if ($key == 0) {
|
614 |
+
$text = ltrim($text);
|
615 |
+
}
|
616 |
+
// Trim any spaces immediately after a line break
|
617 |
+
$text = preg_replace('/\n */mu', "\n", $text);
|
618 |
+
$element->setText($text);
|
619 |
+
}
|
620 |
+
}
|
621 |
+
|
622 |
+
protected function buildTextRun()
|
623 |
+
{
|
624 |
+
$text = $this->stringData;
|
625 |
+
if (trim($text) === '') {
|
626 |
+
return;
|
627 |
+
}
|
628 |
+
|
629 |
+
$richtextRun = $this->richTextObject->createTextRun($this->stringData);
|
630 |
+
if ($this->face) {
|
631 |
+
$richtextRun->getFont()->setName($this->face);
|
632 |
+
}
|
633 |
+
if ($this->size) {
|
634 |
+
$richtextRun->getFont()->setSize($this->size);
|
635 |
+
}
|
636 |
+
if ($this->color) {
|
637 |
+
$richtextRun->getFont()->setColor(new PHPExcel_Style_Color('ff' . $this->color));
|
638 |
+
}
|
639 |
+
if ($this->bold) {
|
640 |
+
$richtextRun->getFont()->setBold(true);
|
641 |
+
}
|
642 |
+
if ($this->italic) {
|
643 |
+
$richtextRun->getFont()->setItalic(true);
|
644 |
+
}
|
645 |
+
if ($this->underline) {
|
646 |
+
$richtextRun->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
|
647 |
+
}
|
648 |
+
if ($this->superscript) {
|
649 |
+
$richtextRun->getFont()->setSuperScript(true);
|
650 |
+
}
|
651 |
+
if ($this->subscript) {
|
652 |
+
$richtextRun->getFont()->setSubScript(true);
|
653 |
+
}
|
654 |
+
if ($this->strikethrough) {
|
655 |
+
$richtextRun->getFont()->setStrikethrough(true);
|
656 |
+
}
|
657 |
+
$this->stringData = '';
|
658 |
+
}
|
659 |
+
|
660 |
+
protected function rgbToColour($rgb)
|
661 |
+
{
|
662 |
+
preg_match_all('/\d+/', $rgb, $values);
|
663 |
+
foreach ($values[0] as &$value) {
|
664 |
+
$value = str_pad(dechex($value), 2, '0', STR_PAD_LEFT);
|
665 |
+
}
|
666 |
+
return implode($values[0]);
|
667 |
+
}
|
668 |
+
|
669 |
+
protected function colourNameLookup($rgb)
|
670 |
+
{
|
671 |
+
return self::$colourMap[$rgb];
|
672 |
+
}
|
673 |
+
|
674 |
+
protected function startFontTag($tag)
|
675 |
+
{
|
676 |
+
foreach ($tag->attributes as $attribute) {
|
677 |
+
$attributeName = strtolower($attribute->name);
|
678 |
+
$attributeValue = $attribute->value;
|
679 |
+
|
680 |
+
if ($attributeName == 'color') {
|
681 |
+
if (preg_match('/rgb\s*\(/', $attributeValue)) {
|
682 |
+
$this->$attributeName = $this->rgbToColour($attributeValue);
|
683 |
+
} elseif (strpos(trim($attributeValue), '#') === 0) {
|
684 |
+
$this->$attributeName = ltrim($attributeValue, '#');
|
685 |
+
} else {
|
686 |
+
$this->$attributeName = $this->colourNameLookup($attributeValue);
|
687 |
+
}
|
688 |
+
} else {
|
689 |
+
$this->$attributeName = $attributeValue;
|
690 |
+
}
|
691 |
+
}
|
692 |
+
}
|
693 |
+
|
694 |
+
protected function endFontTag()
|
695 |
+
{
|
696 |
+
$this->face = $this->size = $this->color = null;
|
697 |
+
}
|
698 |
+
|
699 |
+
protected function startBoldTag()
|
700 |
+
{
|
701 |
+
$this->bold = true;
|
702 |
+
}
|
703 |
+
|
704 |
+
protected function endBoldTag()
|
705 |
+
{
|
706 |
+
$this->bold = false;
|
707 |
+
}
|
708 |
+
|
709 |
+
protected function startItalicTag()
|
710 |
+
{
|
711 |
+
$this->italic = true;
|
712 |
+
}
|
713 |
+
|
714 |
+
protected function endItalicTag()
|
715 |
+
{
|
716 |
+
$this->italic = false;
|
717 |
+
}
|
718 |
+
|
719 |
+
protected function startUnderlineTag()
|
720 |
+
{
|
721 |
+
$this->underline = true;
|
722 |
+
}
|
723 |
+
|
724 |
+
protected function endUnderlineTag()
|
725 |
+
{
|
726 |
+
$this->underline = false;
|
727 |
+
}
|
728 |
+
|
729 |
+
protected function startSubscriptTag()
|
730 |
+
{
|
731 |
+
$this->subscript = true;
|
732 |
+
}
|
733 |
+
|
734 |
+
protected function endSubscriptTag()
|
735 |
+
{
|
736 |
+
$this->subscript = false;
|
737 |
+
}
|
738 |
+
|
739 |
+
protected function startSuperscriptTag()
|
740 |
+
{
|
741 |
+
$this->superscript = true;
|
742 |
+
}
|
743 |
+
|
744 |
+
protected function endSuperscriptTag()
|
745 |
+
{
|
746 |
+
$this->superscript = false;
|
747 |
+
}
|
748 |
+
|
749 |
+
protected function startStrikethruTag()
|
750 |
+
{
|
751 |
+
$this->strikethrough = true;
|
752 |
+
}
|
753 |
+
|
754 |
+
protected function endStrikethruTag()
|
755 |
+
{
|
756 |
+
$this->strikethrough = false;
|
757 |
+
}
|
758 |
+
|
759 |
+
protected function breakTag()
|
760 |
+
{
|
761 |
+
$this->stringData .= "\n";
|
762 |
+
}
|
763 |
+
|
764 |
+
protected function parseTextNode(DOMText $textNode)
|
765 |
+
{
|
766 |
+
$domText = preg_replace(
|
767 |
+
'/\s+/u',
|
768 |
+
' ',
|
769 |
+
str_replace(array("\r", "\n"), ' ', $textNode->nodeValue)
|
770 |
+
);
|
771 |
+
$this->stringData .= $domText;
|
772 |
+
$this->buildTextRun();
|
773 |
+
}
|
774 |
+
|
775 |
+
protected function handleCallback($element, $callbackTag, $callbacks)
|
776 |
+
{
|
777 |
+
if (isset($callbacks[$callbackTag])) {
|
778 |
+
$elementHandler = $callbacks[$callbackTag];
|
779 |
+
if (method_exists($this, $elementHandler)) {
|
780 |
+
call_user_func(array($this, $elementHandler), $element);
|
781 |
+
}
|
782 |
+
}
|
783 |
+
}
|
784 |
+
|
785 |
+
protected function parseElementNode(DOMElement $element)
|
786 |
+
{
|
787 |
+
$callbackTag = strtolower($element->nodeName);
|
788 |
+
$this->stack[] = $callbackTag;
|
789 |
+
|
790 |
+
$this->handleCallback($element, $callbackTag, $this->startTagCallbacks);
|
791 |
+
|
792 |
+
$this->parseElements($element);
|
793 |
+
array_pop($this->stack);
|
794 |
+
|
795 |
+
$this->handleCallback($element, $callbackTag, $this->endTagCallbacks);
|
796 |
+
}
|
797 |
+
|
798 |
+
protected function parseElements(DOMNode $element)
|
799 |
+
{
|
800 |
+
foreach ($element->childNodes as $child) {
|
801 |
+
if ($child instanceof DOMText) {
|
802 |
+
$this->parseTextNode($child);
|
803 |
+
} elseif ($child instanceof DOMElement) {
|
804 |
+
$this->parseElementNode($child);
|
805 |
+
}
|
806 |
+
}
|
807 |
+
}
|
808 |
+
}
|
PHPExcel/Classes/PHPExcel/Reader/Excel5/Color.php
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class PHPExcel_Reader_Excel5_Color
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* Read color
|
7 |
-
*
|
8 |
-
* @param int $color Indexed color
|
9 |
-
* @param array $palette Color palette
|
10 |
-
* @return array RGB color value, example: array('rgb' => 'FF0000')
|
11 |
-
*/
|
12 |
-
public static function map($color, $palette, $version)
|
13 |
-
{
|
14 |
-
if ($color <= 0x07 || $color >= 0x40) {
|
15 |
-
// special built-in color
|
16 |
-
return PHPExcel_Reader_Excel5_Color_BuiltIn::lookup($color);
|
17 |
-
} elseif (isset($palette) && isset($palette[$color - 8])) {
|
18 |
-
// palette color, color index 0x08 maps to pallete index 0
|
19 |
-
return $palette[$color - 8];
|
20 |
-
} else {
|
21 |
-
// default color table
|
22 |
-
if ($version == PHPExcel_Reader_Excel5::XLS_BIFF8) {
|
23 |
-
return PHPExcel_Reader_Excel5_Color_BIFF8::lookup($color);
|
24 |
-
} else {
|
25 |
-
// BIFF5
|
26 |
-
return PHPExcel_Reader_Excel5_Color_BIFF5::lookup($color);
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
return $color;
|
31 |
-
}
|
32 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PHPExcel_Reader_Excel5_Color
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Read color
|
7 |
+
*
|
8 |
+
* @param int $color Indexed color
|
9 |
+
* @param array $palette Color palette
|
10 |
+
* @return array RGB color value, example: array('rgb' => 'FF0000')
|
11 |
+
*/
|
12 |
+
public static function map($color, $palette, $version)
|
13 |
+
{
|
14 |
+
if ($color <= 0x07 || $color >= 0x40) {
|
15 |
+
// special built-in color
|
16 |
+
return PHPExcel_Reader_Excel5_Color_BuiltIn::lookup($color);
|
17 |
+
} elseif (isset($palette) && isset($palette[$color - 8])) {
|
18 |
+
// palette color, color index 0x08 maps to pallete index 0
|
19 |
+
return $palette[$color - 8];
|
20 |
+
} else {
|
21 |
+
// default color table
|
22 |
+
if ($version == PHPExcel_Reader_Excel5::XLS_BIFF8) {
|
23 |
+
return PHPExcel_Reader_Excel5_Color_BIFF8::lookup($color);
|
24 |
+
} else {
|
25 |
+
// BIFF5
|
26 |
+
return PHPExcel_Reader_Excel5_Color_BIFF5::lookup($color);
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
return $color;
|
31 |
+
}
|
32 |
}
|
PHPExcel/Classes/PHPExcel/Reader/Excel5/Color/BIFF5.php
CHANGED
@@ -1,77 +1,77 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class PHPExcel_Reader_Excel5_Color_BIFF5
|
4 |
-
{
|
5 |
-
protected static $map = array(
|
6 |
-
0x08 => '000000',
|
7 |
-
0x09 => 'FFFFFF',
|
8 |
-
0x0A => 'FF0000',
|
9 |
-
0x0B => '00FF00',
|
10 |
-
0x0C => '0000FF',
|
11 |
-
0x0D => 'FFFF00',
|
12 |
-
0x0E => 'FF00FF',
|
13 |
-
0x0F => '00FFFF',
|
14 |
-
0x10 => '800000',
|
15 |
-
0x11 => '008000',
|
16 |
-
0x12 => '000080',
|
17 |
-
0x13 => '808000',
|
18 |
-
0x14 => '800080',
|
19 |
-
0x15 => '008080',
|
20 |
-
0x16 => 'C0C0C0',
|
21 |
-
0x17 => '808080',
|
22 |
-
0x18 => '8080FF',
|
23 |
-
0x19 => '802060',
|
24 |
-
0x1A => 'FFFFC0',
|
25 |
-
0x1B => 'A0E0F0',
|
26 |
-
0x1C => '600080',
|
27 |
-
0x1D => 'FF8080',
|
28 |
-
0x1E => '0080C0',
|
29 |
-
0x1F => 'C0C0FF',
|
30 |
-
0x20 => '000080',
|
31 |
-
0x21 => 'FF00FF',
|
32 |
-
0x22 => 'FFFF00',
|
33 |
-
0x23 => '00FFFF',
|
34 |
-
0x24 => '800080',
|
35 |
-
0x25 => '800000',
|
36 |
-
0x26 => '008080',
|
37 |
-
0x27 => '0000FF',
|
38 |
-
0x28 => '00CFFF',
|
39 |
-
0x29 => '69FFFF',
|
40 |
-
0x2A => 'E0FFE0',
|
41 |
-
0x2B => 'FFFF80',
|
42 |
-
0x2C => 'A6CAF0',
|
43 |
-
0x2D => 'DD9CB3',
|
44 |
-
0x2E => 'B38FEE',
|
45 |
-
0x2F => 'E3E3E3',
|
46 |
-
0x30 => '2A6FF9',
|
47 |
-
0x31 => '3FB8CD',
|
48 |
-
0x32 => '488436',
|
49 |
-
0x33 => '958C41',
|
50 |
-
0x34 => '8E5E42',
|
51 |
-
0x35 => 'A0627A',
|
52 |
-
0x36 => '624FAC',
|
53 |
-
0x37 => '969696',
|
54 |
-
0x38 => '1D2FBE',
|
55 |
-
0x39 => '286676',
|
56 |
-
0x3A => '004500',
|
57 |
-
0x3B => '453E01',
|
58 |
-
0x3C => '6A2813',
|
59 |
-
0x3D => '85396A',
|
60 |
-
0x3E => '4A3285',
|
61 |
-
0x3F => '424242',
|
62 |
-
);
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Map color array from BIFF5 built-in color index
|
66 |
-
*
|
67 |
-
* @param int $color
|
68 |
-
* @return array
|
69 |
-
*/
|
70 |
-
public static function lookup($color)
|
71 |
-
{
|
72 |
-
if (isset(self::$map[$color])) {
|
73 |
-
return array('rgb' => self::$map[$color]);
|
74 |
-
}
|
75 |
-
return array('rgb' => '000000');
|
76 |
-
}
|
77 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PHPExcel_Reader_Excel5_Color_BIFF5
|
4 |
+
{
|
5 |
+
protected static $map = array(
|
6 |
+
0x08 => '000000',
|
7 |
+
0x09 => 'FFFFFF',
|
8 |
+
0x0A => 'FF0000',
|
9 |
+
0x0B => '00FF00',
|
10 |
+
0x0C => '0000FF',
|
11 |
+
0x0D => 'FFFF00',
|
12 |
+
0x0E => 'FF00FF',
|
13 |
+
0x0F => '00FFFF',
|
14 |
+
0x10 => '800000',
|
15 |
+
0x11 => '008000',
|
16 |
+
0x12 => '000080',
|
17 |
+
0x13 => '808000',
|
18 |
+
0x14 => '800080',
|
19 |
+
0x15 => '008080',
|
20 |
+
0x16 => 'C0C0C0',
|
21 |
+
0x17 => '808080',
|
22 |
+
0x18 => '8080FF',
|
23 |
+
0x19 => '802060',
|
24 |
+
0x1A => 'FFFFC0',
|
25 |
+
0x1B => 'A0E0F0',
|
26 |
+
0x1C => '600080',
|
27 |
+
0x1D => 'FF8080',
|
28 |
+
0x1E => '0080C0',
|
29 |
+
0x1F => 'C0C0FF',
|
30 |
+
0x20 => '000080',
|
31 |
+
0x21 => 'FF00FF',
|
32 |
+
0x22 => 'FFFF00',
|
33 |
+
0x23 => '00FFFF',
|
34 |
+
0x24 => '800080',
|
35 |
+
0x25 => '800000',
|
36 |
+
0x26 => '008080',
|
37 |
+
0x27 => '0000FF',
|
38 |
+
0x28 => '00CFFF',
|
39 |
+
0x29 => '69FFFF',
|
40 |
+
0x2A => 'E0FFE0',
|
41 |
+
0x2B => 'FFFF80',
|
42 |
+
0x2C => 'A6CAF0',
|
43 |
+
0x2D => 'DD9CB3',
|
44 |
+
0x2E => 'B38FEE',
|
45 |
+
0x2F => 'E3E3E3',
|
46 |
+
0x30 => '2A6FF9',
|
47 |
+
0x31 => '3FB8CD',
|
48 |
+
0x32 => '488436',
|
49 |
+
0x33 => '958C41',
|
50 |
+
0x34 => '8E5E42',
|
51 |
+
0x35 => 'A0627A',
|
52 |
+
0x36 => '624FAC',
|
53 |
+
0x37 => '969696',
|
54 |
+
0x38 => '1D2FBE',
|
55 |
+
0x39 => '286676',
|
56 |
+
0x3A => '004500',
|
57 |
+
0x3B => '453E01',
|
58 |
+
0x3C => '6A2813',
|
59 |
+
0x3D => '85396A',
|
60 |
+
0x3E => '4A3285',
|
61 |
+
0x3F => '424242',
|
62 |
+
);
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Map color array from BIFF5 built-in color index
|
66 |
+
*
|
67 |
+
* @param int $color
|
68 |
+
* @return array
|
69 |
+
*/
|
70 |
+
public static function lookup($color)
|
71 |
+
{
|
72 |
+
if (isset(self::$map[$color])) {
|
73 |
+
return array('rgb' => self::$map[$color]);
|
74 |
+
}
|
75 |
+
return array('rgb' => '000000');
|
76 |
+
}
|
77 |
}
|
PHPExcel/Classes/PHPExcel/Reader/Excel5/Color/BIFF8.php
CHANGED
@@ -1,77 +1,77 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class PHPExcel_Reader_Excel5_Color_BIFF8
|
4 |
-
{
|
5 |
-
protected static $map = array(
|
6 |
-
0x08 => '000000',
|
7 |
-
0x09 => 'FFFFFF',
|
8 |
-
0x0A => 'FF0000',
|
9 |
-
0x0B => '00FF00',
|
10 |
-
0x0C => '0000FF',
|
11 |
-
0x0D => 'FFFF00',
|
12 |
-
0x0E => 'FF00FF',
|
13 |
-
0x0F => '00FFFF',
|
14 |
-
0x10 => '800000',
|
15 |
-
0x11 => '008000',
|
16 |
-
0x12 => '000080',
|
17 |
-
0x13 => '808000',
|
18 |
-
0x14 => '800080',
|
19 |
-
0x15 => '008080',
|
20 |
-
0x16 => 'C0C0C0',
|
21 |
-
0x17 => '808080',
|
22 |
-
0x18 => '9999FF',
|
23 |
-
0x19 => '993366',
|
24 |
-
0x1A => 'FFFFCC',
|
25 |
-
0x1B => 'CCFFFF',
|
26 |
-
0x1C => '660066',
|
27 |
-
0x1D => 'FF8080',
|
28 |
-
0x1E => '0066CC',
|
29 |
-
0x1F => 'CCCCFF',
|
30 |
-
0x20 => '000080',
|
31 |
-
0x21 => 'FF00FF',
|
32 |
-
0x22 => 'FFFF00',
|
33 |
-
0x23 => '00FFFF',
|
34 |
-
0x24 => '800080',
|
35 |
-
0x25 => '800000',
|
36 |
-
0x26 => '008080',
|
37 |
-
0x27 => '0000FF',
|
38 |
-
0x28 => '00CCFF',
|
39 |
-
0x29 => 'CCFFFF',
|
40 |
-
0x2A => 'CCFFCC',
|
41 |
-
0x2B => 'FFFF99',
|
42 |
-
0x2C => '99CCFF',
|
43 |
-
0x2D => 'FF99CC',
|
44 |
-
0x2E => 'CC99FF',
|
45 |
-
0x2F => 'FFCC99',
|
46 |
-
0x30 => '3366FF',
|
47 |
-
0x31 => '33CCCC',
|
48 |
-
0x32 => '99CC00',
|
49 |
-
0x33 => 'FFCC00',
|
50 |
-
0x34 => 'FF9900',
|
51 |
-
0x35 => 'FF6600',
|
52 |
-
0x36 => '666699',
|
53 |
-
0x37 => '969696',
|
54 |
-
0x38 => '003366',
|
55 |
-
0x39 => '339966',
|
56 |
-
0x3A => '003300',
|
57 |
-
0x3B => '333300',
|
58 |
-
0x3C => '993300',
|
59 |
-
0x3D => '993366',
|
60 |
-
0x3E => '333399',
|
61 |
-
0x3F => '333333',
|
62 |
-
);
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Map color array from BIFF8 built-in color index
|
66 |
-
*
|
67 |
-
* @param int $color
|
68 |
-
* @return array
|
69 |
-
*/
|
70 |
-
public static function lookup($color)
|
71 |
-
{
|
72 |
-
if (isset(self::$map[$color])) {
|
73 |
-
return array('rgb' => self::$map[$color]);
|
74 |
-
}
|
75 |
-
return array('rgb' => '000000');
|
76 |
-
}
|
77 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PHPExcel_Reader_Excel5_Color_BIFF8
|
4 |
+
{
|
5 |
+
protected static $map = array(
|
6 |
+
0x08 => '000000',
|
7 |
+
0x09 => 'FFFFFF',
|
8 |
+
0x0A => 'FF0000',
|
9 |
+
0x0B => '00FF00',
|
10 |
+
0x0C => '0000FF',
|
11 |
+
0x0D => 'FFFF00',
|
12 |
+
0x0E => 'FF00FF',
|
13 |
+
0x0F => '00FFFF',
|
14 |
+
0x10 => '800000',
|
15 |
+
0x11 => '008000',
|
16 |
+
0x12 => '000080',
|
17 |
+
0x13 => '808000',
|
18 |
+
0x14 => '800080',
|
19 |
+
0x15 => '008080',
|
20 |
+
0x16 => 'C0C0C0',
|
21 |
+
0x17 => '808080',
|
22 |
+
0x18 => '9999FF',
|
23 |
+
0x19 => '993366',
|
24 |
+
0x1A => 'FFFFCC',
|
25 |
+
0x1B => 'CCFFFF',
|
26 |
+
0x1C => '660066',
|
27 |
+
0x1D => 'FF8080',
|
28 |
+
0x1E => '0066CC',
|
29 |
+
0x1F => 'CCCCFF',
|
30 |
+
0x20 => '000080',
|
31 |
+
0x21 => 'FF00FF',
|
32 |
+
0x22 => 'FFFF00',
|
33 |
+
0x23 => '00FFFF',
|
34 |
+
0x24 => '800080',
|
35 |
+
0x25 => '800000',
|
36 |
+
0x26 => '008080',
|
37 |
+
0x27 => '0000FF',
|
38 |
+
0x28 => '00CCFF',
|
39 |
+
0x29 => 'CCFFFF',
|
40 |
+
0x2A => 'CCFFCC',
|
41 |
+
0x2B => 'FFFF99',
|
42 |
+
0x2C => '99CCFF',
|
43 |
+
0x2D => 'FF99CC',
|
44 |
+
0x2E => 'CC99FF',
|
45 |
+
0x2F => 'FFCC99',
|
46 |
+
0x30 => '3366FF',
|
47 |
+
0x31 => '33CCCC',
|
48 |
+
0x32 => '99CC00',
|
49 |
+
0x33 => 'FFCC00',
|
50 |
+
0x34 => 'FF9900',
|
51 |
+
0x35 => 'FF6600',
|
52 |
+
0x36 => '666699',
|
53 |
+
0x37 => '969696',
|
54 |
+
0x38 => '003366',
|
55 |
+
0x39 => '339966',
|
56 |
+
0x3A => '003300',
|
57 |
+
0x3B => '333300',
|
58 |
+
0x3C => '993300',
|
59 |
+
0x3D => '993366',
|
60 |
+
0x3E => '333399',
|
61 |
+
0x3F => '333333',
|
62 |
+
);
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Map color array from BIFF8 built-in color index
|
66 |
+
*
|
67 |
+
* @param int $color
|
68 |
+
* @return array
|
69 |
+
*/
|
70 |
+
public static function lookup($color)
|
71 |
+
{
|
72 |
+
if (isset(self::$map[$color])) {
|
73 |
+
return array('rgb' => self::$map[$color]);
|
74 |
+
}
|
75 |
+
return array('rgb' => '000000');
|
76 |
+
}
|
77 |
}
|
PHPExcel/Classes/PHPExcel/Reader/Excel5/Color/BuiltIn.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class PHPExcel_Reader_Excel5_Color_BuiltIn
|
4 |
-
{
|
5 |
-
protected static $map = array(
|
6 |
-
0x00 => '000000',
|
7 |
-
0x01 => 'FFFFFF',
|
8 |
-
0x02 => 'FF0000',
|
9 |
-
0x03 => '00FF00',
|
10 |
-
0x04 => '0000FF',
|
11 |
-
0x05 => 'FFFF00',
|
12 |
-
0x06 => 'FF00FF',
|
13 |
-
0x07 => '00FFFF',
|
14 |
-
0x40 => '000000', // system window text color
|
15 |
-
0x41 => 'FFFFFF', // system window background color
|
16 |
-
);
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Map built-in color to RGB value
|
20 |
-
*
|
21 |
-
* @param int $color Indexed color
|
22 |
-
* @return array
|
23 |
-
*/
|
24 |
-
public static function lookup($color)
|
25 |
-
{
|
26 |
-
if (isset(self::$map[$color])) {
|
27 |
-
return array('rgb' => self::$map[$color]);
|
28 |
-
}
|
29 |
-
return array('rgb' => '000000');
|
30 |
-
}
|
31 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PHPExcel_Reader_Excel5_Color_BuiltIn
|
4 |
+
{
|
5 |
+
protected static $map = array(
|
6 |
+
0x00 => '000000',
|
7 |
+
0x01 => 'FFFFFF',
|
8 |
+
0x02 => 'FF0000',
|
9 |
+
0x03 => '00FF00',
|
10 |
+
0x04 => '0000FF',
|
11 |
+
0x05 => 'FFFF00',
|
12 |
+
0x06 => 'FF00FF',
|
13 |
+
0x07 => '00FFFF',
|
14 |
+
0x40 => '000000', // system window text color
|
15 |
+
0x41 => 'FFFFFF', // system window background color
|
16 |
+
);
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Map built-in color to RGB value
|
20 |
+
*
|
21 |
+
* @param int $color Indexed color
|
22 |
+
* @return array
|
23 |
+
*/
|
24 |
+
public static function lookup($color)
|
25 |
+
{
|
26 |
+
if (isset(self::$map[$color])) {
|
27 |
+
return array('rgb' => self::$map[$color]);
|
28 |
+
}
|
29 |
+
return array('rgb' => '000000');
|
30 |
+
}
|
31 |
}
|
PHPExcel/Classes/PHPExcel/Reader/Excel5/ErrorCode.php
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class PHPExcel_Reader_Excel5_ErrorCode
|
4 |
-
{
|
5 |
-
protected static $map = array(
|
6 |
-
0x00 => '#NULL!',
|
7 |
-
0x07 => '#DIV/0!',
|
8 |
-
0x0F => '#VALUE!',
|
9 |
-
0x17 => '#REF!',
|
10 |
-
0x1D => '#NAME?',
|
11 |
-
0x24 => '#NUM!',
|
12 |
-
0x2A => '#N/A',
|
13 |
-
);
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Map error code, e.g. '#N/A'
|
17 |
-
*
|
18 |
-
* @param int $code
|
19 |
-
* @return string
|
20 |
-
*/
|
21 |
-
public static function lookup($code)
|
22 |
-
{
|
23 |
-
if (isset(self::$map[$code])) {
|
24 |
-
return self::$map[$code];
|
25 |
-
}
|
26 |
-
return false;
|
27 |
-
}
|
28 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PHPExcel_Reader_Excel5_ErrorCode
|
4 |
+
{
|
5 |
+
protected static $map = array(
|
6 |
+
0x00 => '#NULL!',
|
7 |
+
0x07 => '#DIV/0!',
|
8 |
+
0x0F => '#VALUE!',
|
9 |
+
0x17 => '#REF!',
|
10 |
+
0x1D => '#NAME?',
|
11 |
+
0x24 => '#NUM!',
|
12 |
+
0x2A => '#N/A',
|
13 |
+
);
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Map error code, e.g. '#N/A'
|
17 |
+
*
|
18 |
+
* @param int $code
|
19 |
+
* @return string
|
20 |
+
*/
|
21 |
+
public static function lookup($code)
|
22 |
+
{
|
23 |
+
if (isset(self::$map[$code])) {
|
24 |
+
return self::$map[$code];
|
25 |
+
}
|
26 |
+
return false;
|
27 |
+
}
|
28 |
}
|
PHPExcel/Classes/PHPExcel/Reader/Excel5/Style/Border.php
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class PHPExcel_Reader_Excel5_Style_Border
|
4 |
-
{
|
5 |
-
protected static $map = array(
|
6 |
-
0x00 => PHPExcel_Style_Border::BORDER_NONE,
|
7 |
-
0x01 => PHPExcel_Style_Border::BORDER_THIN,
|
8 |
-
0x02 => PHPExcel_Style_Border::BORDER_MEDIUM,
|
9 |
-
0x03 => PHPExcel_Style_Border::BORDER_DASHED,
|
10 |
-
0x04 => PHPExcel_Style_Border::BORDER_DOTTED,
|
11 |
-
0x05 => PHPExcel_Style_Border::BORDER_THICK,
|
12 |
-
0x06 => PHPExcel_Style_Border::BORDER_DOUBLE,
|
13 |
-
0x07 => PHPExcel_Style_Border::BORDER_HAIR,
|
14 |
-
0x08 => PHPExcel_Style_Border::BORDER_MEDIUMDASHED,
|
15 |
-
0x09 => PHPExcel_Style_Border::BORDER_DASHDOT,
|
16 |
-
0x0A => PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT,
|
17 |
-
0x0B => PHPExcel_Style_Border::BORDER_DASHDOTDOT,
|
18 |
-
0x0C => PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT,
|
19 |
-
0x0D => PHPExcel_Style_Border::BORDER_SLANTDASHDOT,
|
20 |
-
);
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Map border style
|
24 |
-
* OpenOffice documentation: 2.5.11
|
25 |
-
*
|
26 |
-
* @param int $index
|
27 |
-
* @return string
|
28 |
-
*/
|
29 |
-
public static function lookup($index)
|
30 |
-
{
|
31 |
-
if (isset(self::$map[$index])) {
|
32 |
-
return self::$map[$index];
|
33 |
-
}
|
34 |
-
return PHPExcel_Style_Border::BORDER_NONE;
|
35 |
-
}
|
36 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PHPExcel_Reader_Excel5_Style_Border
|
4 |
+
{
|
5 |
+
protected static $map = array(
|
6 |
+
0x00 => PHPExcel_Style_Border::BORDER_NONE,
|
7 |
+
0x01 => PHPExcel_Style_Border::BORDER_THIN,
|
8 |
+
0x02 => PHPExcel_Style_Border::BORDER_MEDIUM,
|
9 |
+
0x03 => PHPExcel_Style_Border::BORDER_DASHED,
|
10 |
+
0x04 => PHPExcel_Style_Border::BORDER_DOTTED,
|
11 |
+
0x05 => PHPExcel_Style_Border::BORDER_THICK,
|
12 |
+
0x06 => PHPExcel_Style_Border::BORDER_DOUBLE,
|
13 |
+
0x07 => PHPExcel_Style_Border::BORDER_HAIR,
|
14 |
+
0x08 => PHPExcel_Style_Border::BORDER_MEDIUMDASHED,
|
15 |
+
0x09 => PHPExcel_Style_Border::BORDER_DASHDOT,
|
16 |
+
0x0A => PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT,
|
17 |
+
0x0B => PHPExcel_Style_Border::BORDER_DASHDOTDOT,
|
18 |
+
0x0C => PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT,
|
19 |
+
0x0D => PHPExcel_Style_Border::BORDER_SLANTDASHDOT,
|
20 |
+
);
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Map border style
|
24 |
+
* OpenOffice documentation: 2.5.11
|
25 |
+
*
|
26 |
+
* @param int $index
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
public static function lookup($index)
|
30 |
+
{
|
31 |
+
if (isset(self::$map[$index])) {
|
32 |
+
return self::$map[$index];
|
33 |
+
}
|
34 |
+
return PHPExcel_Style_Border::BORDER_NONE;
|
35 |
+
}
|
36 |
}
|
PHPExcel/Classes/PHPExcel/Reader/Excel5/Style/FillPattern.php
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class PHPExcel_Reader_Excel5_Style_FillPattern
|
4 |
-
{
|
5 |
-
protected static $map = array(
|
6 |
-
0x00 => PHPExcel_Style_Fill::FILL_NONE,
|
7 |
-
0x01 => PHPExcel_Style_Fill::FILL_SOLID,
|
8 |
-
0x02 => PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY,
|
9 |
-
0x03 => PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY,
|
10 |
-
0x04 => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY,
|
11 |
-
0x05 => PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL,
|
12 |
-
0x06 => PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL,
|
13 |
-
0x07 => PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN,
|
14 |
-
0x08 => PHPExcel_Style_Fill::FILL_PATTERN_DARKUP,
|
15 |
-
0x09 => PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID,
|
16 |
-
0x0A => PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS,
|
17 |
-
0x0B => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL,
|
18 |
-
0x0C => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL,
|
19 |
-
0x0D => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN,
|
20 |
-
0x0E => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP,
|
21 |
-
0x0F => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID,
|
22 |
-
0x10 => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS,
|
23 |
-
0x11 => PHPExcel_Style_Fill::FILL_PATTERN_GRAY125,
|
24 |
-
0x12 => PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625,
|
25 |
-
);
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Get fill pattern from index
|
29 |
-
* OpenOffice documentation: 2.5.12
|
30 |
-
*
|
31 |
-
* @param int $index
|
32 |
-
* @return string
|
33 |
-
*/
|
34 |
-
public static function lookup($index)
|
35 |
-
{
|
36 |
-
if (isset(self::$map[$index])) {
|
37 |
-
return self::$map[$index];
|
38 |
-
}
|
39 |
-
return PHPExcel_Style_Fill::FILL_NONE;
|
40 |
-
}
|
41 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PHPExcel_Reader_Excel5_Style_FillPattern
|
4 |
+
{
|
5 |
+
protected static $map = array(
|
6 |
+
0x00 => PHPExcel_Style_Fill::FILL_NONE,
|
7 |
+
0x01 => PHPExcel_Style_Fill::FILL_SOLID,
|
8 |
+
0x02 => PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY,
|
9 |
+
0x03 => PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY,
|
10 |
+
0x04 => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY,
|
11 |
+
0x05 => PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL,
|
12 |
+
0x06 => PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL,
|
13 |
+
0x07 => PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN,
|
14 |
+
0x08 => PHPExcel_Style_Fill::FILL_PATTERN_DARKUP,
|
15 |
+
0x09 => PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID,
|
16 |
+
0x0A => PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS,
|
17 |
+
0x0B => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL,
|
18 |
+
0x0C => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL,
|
19 |
+
0x0D => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN,
|
20 |
+
0x0E => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP,
|
21 |
+
0x0F => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID,
|
22 |
+
0x10 => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS,
|
23 |
+
0x11 => PHPExcel_Style_Fill::FILL_PATTERN_GRAY125,
|
24 |
+
0x12 => PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625,
|
25 |
+
);
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get fill pattern from index
|
29 |
+
* OpenOffice documentation: 2.5.12
|
30 |
+
*
|
31 |
+
* @param int $index
|
32 |
+
* @return string
|
33 |
+
*/
|
34 |
+
public static function lookup($index)
|
35 |
+
{
|
36 |
+
if (isset(self::$map[$index])) {
|
37 |
+
return self::$map[$index];
|
38 |
+
}
|
39 |
+
return PHPExcel_Style_Fill::FILL_NONE;
|
40 |
+
}
|
41 |
}
|
PHPExcel/Classes/PHPExcel/Worksheet/Column.php
CHANGED
@@ -1,86 +1,86 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Worksheet_Column
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Worksheet
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Worksheet_Column
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* PHPExcel_Worksheet
|
32 |
-
*
|
33 |
-
* @var PHPExcel_Worksheet
|
34 |
-
*/
|
35 |
-
private $parent;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Column index
|
39 |
-
*
|
40 |
-
* @var string
|
41 |
-
*/
|
42 |
-
private $columnIndex;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Create a new column
|
46 |
-
*
|
47 |
-
* @param PHPExcel_Worksheet $parent
|
48 |
-
* @param string $columnIndex
|
49 |
-
*/
|
50 |
-
public function __construct(PHPExcel_Worksheet $parent = null, $columnIndex = 'A')
|
51 |
-
{
|
52 |
-
// Set parent and column index
|
53 |
-
$this->parent = $parent;
|
54 |
-
$this->columnIndex = $columnIndex;
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Destructor
|
59 |
-
*/
|
60 |
-
public function __destruct()
|
61 |
-
{
|
62 |
-
unset($this->parent);
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Get column index
|
67 |
-
*
|
68 |
-
* @return string
|
69 |
-
*/
|
70 |
-
public function getColumnIndex()
|
71 |
-
{
|
72 |
-
return $this->columnIndex;
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Get cell iterator
|
77 |
-
*
|
78 |
-
* @param integer $startRow The row number at which to start iterating
|
79 |
-
* @param integer $endRow Optionally, the row number at which to stop iterating
|
80 |
-
* @return PHPExcel_Worksheet_CellIterator
|
81 |
-
*/
|
82 |
-
public function getCellIterator($startRow = 1, $endRow = null)
|
83 |
-
{
|
84 |
-
return new PHPExcel_Worksheet_ColumnCellIterator($this->parent, $this->columnIndex, $startRow, $endRow);
|
85 |
-
}
|
86 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Worksheet_Column
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Worksheet
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Worksheet_Column
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* PHPExcel_Worksheet
|
32 |
+
*
|
33 |
+
* @var PHPExcel_Worksheet
|
34 |
+
*/
|
35 |
+
private $parent;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Column index
|
39 |
+
*
|
40 |
+
* @var string
|
41 |
+
*/
|
42 |
+
private $columnIndex;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Create a new column
|
46 |
+
*
|
47 |
+
* @param PHPExcel_Worksheet $parent
|
48 |
+
* @param string $columnIndex
|
49 |
+
*/
|
50 |
+
public function __construct(PHPExcel_Worksheet $parent = null, $columnIndex = 'A')
|
51 |
+
{
|
52 |
+
// Set parent and column index
|
53 |
+
$this->parent = $parent;
|
54 |
+
$this->columnIndex = $columnIndex;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Destructor
|
59 |
+
*/
|
60 |
+
public function __destruct()
|
61 |
+
{
|
62 |
+
unset($this->parent);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Get column index
|
67 |
+
*
|
68 |
+
* @return string
|
69 |
+
*/
|
70 |
+
public function getColumnIndex()
|
71 |
+
{
|
72 |
+
return $this->columnIndex;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Get cell iterator
|
77 |
+
*
|
78 |
+
* @param integer $startRow The row number at which to start iterating
|
79 |
+
* @param integer $endRow Optionally, the row number at which to stop iterating
|
80 |
+
* @return PHPExcel_Worksheet_CellIterator
|
81 |
+
*/
|
82 |
+
public function getCellIterator($startRow = 1, $endRow = null)
|
83 |
+
{
|
84 |
+
return new PHPExcel_Worksheet_ColumnCellIterator($this->parent, $this->columnIndex, $startRow, $endRow);
|
85 |
+
}
|
86 |
+
}
|
PHPExcel/Classes/PHPExcel/Worksheet/ColumnCellIterator.php
CHANGED
@@ -1,216 +1,216 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Worksheet_ColumnCellIterator
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Worksheet
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Worksheet_ColumnCellIterator extends PHPExcel_Worksheet_CellIterator implements Iterator
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Column index
|
32 |
-
*
|
33 |
-
* @var string
|
34 |
-
*/
|
35 |
-
protected $columnIndex;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Start position
|
39 |
-
*
|
40 |
-
* @var int
|
41 |
-
*/
|
42 |
-
protected $startRow = 1;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* End position
|
46 |
-
*
|
47 |
-
* @var int
|
48 |
-
*/
|
49 |
-
protected $endRow = 1;
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Create a new row iterator
|
53 |
-
*
|
54 |
-
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
55 |
-
* @param string $columnIndex The column that we want to iterate
|
56 |
-
* @param integer $startRow The row number at which to start iterating
|
57 |
-
* @param integer $endRow Optionally, the row number at which to stop iterating
|
58 |
-
*/
|
59 |
-
public function __construct(PHPExcel_Worksheet $subject = null, $columnIndex = 'A', $startRow = 1, $endRow = null)
|
60 |
-
{
|
61 |
-
// Set subject
|
62 |
-
$this->subject = $subject;
|
63 |
-
$this->columnIndex = PHPExcel_Cell::columnIndexFromString($columnIndex) - 1;
|
64 |
-
$this->resetEnd($endRow);
|
65 |
-
$this->resetStart($startRow);
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Destructor
|
70 |
-
*/
|
71 |
-
public function __destruct()
|
72 |
-
{
|
73 |
-
unset($this->subject);
|
74 |
-
}
|
75 |
-
|
76 |
-
/**
|
77 |
-
* (Re)Set the start row and the current row pointer
|
78 |
-
*
|
79 |
-
* @param integer $startRow The row number at which to start iterating
|
80 |
-
* @return PHPExcel_Worksheet_ColumnCellIterator
|
81 |
-
* @throws PHPExcel_Exception
|
82 |
-
*/
|
83 |
-
public function resetStart($startRow = 1)
|
84 |
-
{
|
85 |
-
$this->startRow = $startRow;
|
86 |
-
$this->adjustForExistingOnlyRange();
|
87 |
-
$this->seek($startRow);
|
88 |
-
|
89 |
-
return $this;
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* (Re)Set the end row
|
94 |
-
*
|
95 |
-
* @param integer $endRow The row number at which to stop iterating
|
96 |
-
* @return PHPExcel_Worksheet_ColumnCellIterator
|
97 |
-
* @throws PHPExcel_Exception
|
98 |
-
*/
|
99 |
-
public function resetEnd($endRow = null)
|
100 |
-
{
|
101 |
-
$this->endRow = ($endRow) ? $endRow : $this->subject->getHighestRow();
|
102 |
-
$this->adjustForExistingOnlyRange();
|
103 |
-
|
104 |
-
return $this;
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Set the row pointer to the selected row
|
109 |
-
*
|
110 |
-
* @param integer $row The row number to set the current pointer at
|
111 |
-
* @return PHPExcel_Worksheet_ColumnCellIterator
|
112 |
-
* @throws PHPExcel_Exception
|
113 |
-
*/
|
114 |
-
public function seek($row = 1)
|
115 |
-
{
|
116 |
-
if (($row < $this->startRow) || ($row > $this->endRow)) {
|
117 |
-
throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
|
118 |
-
} elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($this->columnIndex, $row))) {
|
119 |
-
throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
|
120 |
-
}
|
121 |
-
$this->position = $row;
|
122 |
-
|
123 |
-
return $this;
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Rewind the iterator to the starting row
|
128 |
-
*/
|
129 |
-
public function rewind()
|
130 |
-
{
|
131 |
-
$this->position = $this->startRow;
|
132 |
-
}
|
133 |
-
|
134 |
-
/**
|
135 |
-
* Return the current cell in this worksheet column
|
136 |
-
*
|
137 |
-
* @return PHPExcel_Worksheet_Row
|
138 |
-
*/
|
139 |
-
public function current()
|
140 |
-
{
|
141 |
-
return $this->subject->getCellByColumnAndRow($this->columnIndex, $this->position);
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* Return the current iterator key
|
146 |
-
*
|
147 |
-
* @return int
|
148 |
-
*/
|
149 |
-
public function key()
|
150 |
-
{
|
151 |
-
return $this->position;
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Set the iterator to its next value
|
156 |
-
*/
|
157 |
-
public function next()
|
158 |
-
{
|
159 |
-
do {
|
160 |
-
++$this->position;
|
161 |
-
} while (($this->onlyExistingCells) &&
|
162 |
-
(!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->position)) &&
|
163 |
-
($this->position <= $this->endRow));
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Set the iterator to its previous value
|
168 |
-
*/
|
169 |
-
public function prev()
|
170 |
-
{
|
171 |
-
if ($this->position <= $this->startRow) {
|
172 |
-
throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
|
173 |
-
}
|
174 |
-
|
175 |
-
do {
|
176 |
-
--$this->position;
|
177 |
-
} while (($this->onlyExistingCells) &&
|
178 |
-
(!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->position)) &&
|
179 |
-
($this->position >= $this->startRow));
|
180 |
-
}
|
181 |
-
|
182 |
-
/**
|
183 |
-
* Indicate if more rows exist in the worksheet range of rows that we're iterating
|
184 |
-
*
|
185 |
-
* @return boolean
|
186 |
-
*/
|
187 |
-
public function valid()
|
188 |
-
{
|
189 |
-
return $this->position <= $this->endRow;
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
|
194 |
-
*
|
195 |
-
* @throws PHPExcel_Exception
|
196 |
-
*/
|
197 |
-
protected function adjustForExistingOnlyRange()
|
198 |
-
{
|
199 |
-
if ($this->onlyExistingCells) {
|
200 |
-
while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->startRow)) &&
|
201 |
-
($this->startRow <= $this->endRow)) {
|
202 |
-
++$this->startRow;
|
203 |
-
}
|
204 |
-
if ($this->startRow > $this->endRow) {
|
205 |
-
throw new PHPExcel_Exception('No cells exist within the specified range');
|
206 |
-
}
|
207 |
-
while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->endRow)) &&
|
208 |
-
($this->endRow >= $this->startRow)) {
|
209 |
-
--$this->endRow;
|
210 |
-
}
|
211 |
-
if ($this->endRow < $this->startRow) {
|
212 |
-
throw new PHPExcel_Exception('No cells exist within the specified range');
|
213 |
-
}
|
214 |
-
}
|
215 |
-
}
|
216 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Worksheet_ColumnCellIterator
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Worksheet
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Worksheet_ColumnCellIterator extends PHPExcel_Worksheet_CellIterator implements Iterator
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Column index
|
32 |
+
*
|
33 |
+
* @var string
|
34 |
+
*/
|
35 |
+
protected $columnIndex;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Start position
|
39 |
+
*
|
40 |
+
* @var int
|
41 |
+
*/
|
42 |
+
protected $startRow = 1;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* End position
|
46 |
+
*
|
47 |
+
* @var int
|
48 |
+
*/
|
49 |
+
protected $endRow = 1;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Create a new row iterator
|
53 |
+
*
|
54 |
+
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
55 |
+
* @param string $columnIndex The column that we want to iterate
|
56 |
+
* @param integer $startRow The row number at which to start iterating
|
57 |
+
* @param integer $endRow Optionally, the row number at which to stop iterating
|
58 |
+
*/
|
59 |
+
public function __construct(PHPExcel_Worksheet $subject = null, $columnIndex = 'A', $startRow = 1, $endRow = null)
|
60 |
+
{
|
61 |
+
// Set subject
|
62 |
+
$this->subject = $subject;
|
63 |
+
$this->columnIndex = PHPExcel_Cell::columnIndexFromString($columnIndex) - 1;
|
64 |
+
$this->resetEnd($endRow);
|
65 |
+
$this->resetStart($startRow);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Destructor
|
70 |
+
*/
|
71 |
+
public function __destruct()
|
72 |
+
{
|
73 |
+
unset($this->subject);
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* (Re)Set the start row and the current row pointer
|
78 |
+
*
|
79 |
+
* @param integer $startRow The row number at which to start iterating
|
80 |
+
* @return PHPExcel_Worksheet_ColumnCellIterator
|
81 |
+
* @throws PHPExcel_Exception
|
82 |
+
*/
|
83 |
+
public function resetStart($startRow = 1)
|
84 |
+
{
|
85 |
+
$this->startRow = $startRow;
|
86 |
+
$this->adjustForExistingOnlyRange();
|
87 |
+
$this->seek($startRow);
|
88 |
+
|
89 |
+
return $this;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* (Re)Set the end row
|
94 |
+
*
|
95 |
+
* @param integer $endRow The row number at which to stop iterating
|
96 |
+
* @return PHPExcel_Worksheet_ColumnCellIterator
|
97 |
+
* @throws PHPExcel_Exception
|
98 |
+
*/
|
99 |
+
public function resetEnd($endRow = null)
|
100 |
+
{
|
101 |
+
$this->endRow = ($endRow) ? $endRow : $this->subject->getHighestRow();
|
102 |
+
$this->adjustForExistingOnlyRange();
|
103 |
+
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Set the row pointer to the selected row
|
109 |
+
*
|
110 |
+
* @param integer $row The row number to set the current pointer at
|
111 |
+
* @return PHPExcel_Worksheet_ColumnCellIterator
|
112 |
+
* @throws PHPExcel_Exception
|
113 |
+
*/
|
114 |
+
public function seek($row = 1)
|
115 |
+
{
|
116 |
+
if (($row < $this->startRow) || ($row > $this->endRow)) {
|
117 |
+
throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
|
118 |
+
} elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($this->columnIndex, $row))) {
|
119 |
+
throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
|
120 |
+
}
|
121 |
+
$this->position = $row;
|
122 |
+
|
123 |
+
return $this;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Rewind the iterator to the starting row
|
128 |
+
*/
|
129 |
+
public function rewind()
|
130 |
+
{
|
131 |
+
$this->position = $this->startRow;
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Return the current cell in this worksheet column
|
136 |
+
*
|
137 |
+
* @return PHPExcel_Worksheet_Row
|
138 |
+
*/
|
139 |
+
public function current()
|
140 |
+
{
|
141 |
+
return $this->subject->getCellByColumnAndRow($this->columnIndex, $this->position);
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Return the current iterator key
|
146 |
+
*
|
147 |
+
* @return int
|
148 |
+
*/
|
149 |
+
public function key()
|
150 |
+
{
|
151 |
+
return $this->position;
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Set the iterator to its next value
|
156 |
+
*/
|
157 |
+
public function next()
|
158 |
+
{
|
159 |
+
do {
|
160 |
+
++$this->position;
|
161 |
+
} while (($this->onlyExistingCells) &&
|
162 |
+
(!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->position)) &&
|
163 |
+
($this->position <= $this->endRow));
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Set the iterator to its previous value
|
168 |
+
*/
|
169 |
+
public function prev()
|
170 |
+
{
|
171 |
+
if ($this->position <= $this->startRow) {
|
172 |
+
throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
|
173 |
+
}
|
174 |
+
|
175 |
+
do {
|
176 |
+
--$this->position;
|
177 |
+
} while (($this->onlyExistingCells) &&
|
178 |
+
(!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->position)) &&
|
179 |
+
($this->position >= $this->startRow));
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Indicate if more rows exist in the worksheet range of rows that we're iterating
|
184 |
+
*
|
185 |
+
* @return boolean
|
186 |
+
*/
|
187 |
+
public function valid()
|
188 |
+
{
|
189 |
+
return $this->position <= $this->endRow;
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
|
194 |
+
*
|
195 |
+
* @throws PHPExcel_Exception
|
196 |
+
*/
|
197 |
+
protected function adjustForExistingOnlyRange()
|
198 |
+
{
|
199 |
+
if ($this->onlyExistingCells) {
|
200 |
+
while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->startRow)) &&
|
201 |
+
($this->startRow <= $this->endRow)) {
|
202 |
+
++$this->startRow;
|
203 |
+
}
|
204 |
+
if ($this->startRow > $this->endRow) {
|
205 |
+
throw new PHPExcel_Exception('No cells exist within the specified range');
|
206 |
+
}
|
207 |
+
while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->endRow)) &&
|
208 |
+
($this->endRow >= $this->startRow)) {
|
209 |
+
--$this->endRow;
|
210 |
+
}
|
211 |
+
if ($this->endRow < $this->startRow) {
|
212 |
+
throw new PHPExcel_Exception('No cells exist within the specified range');
|
213 |
+
}
|
214 |
+
}
|
215 |
+
}
|
216 |
+
}
|
PHPExcel/Classes/PHPExcel/Worksheet/ColumnIterator.php
CHANGED
@@ -1,201 +1,201 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Worksheet_ColumnIterator
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Worksheet
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Worksheet_ColumnIterator implements Iterator
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* PHPExcel_Worksheet to iterate
|
32 |
-
*
|
33 |
-
* @var PHPExcel_Worksheet
|
34 |
-
*/
|
35 |
-
private $subject;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Current iterator position
|
39 |
-
*
|
40 |
-
* @var int
|
41 |
-
*/
|
42 |
-
private $position = 0;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Start position
|
46 |
-
*
|
47 |
-
* @var int
|
48 |
-
*/
|
49 |
-
private $startColumn = 0;
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
* End position
|
54 |
-
*
|
55 |
-
* @var int
|
56 |
-
*/
|
57 |
-
private $endColumn = 0;
|
58 |
-
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Create a new column iterator
|
62 |
-
*
|
63 |
-
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
64 |
-
* @param string $startColumn The column address at which to start iterating
|
65 |
-
* @param string $endColumn Optionally, the column address at which to stop iterating
|
66 |
-
*/
|
67 |
-
public function __construct(PHPExcel_Worksheet $subject = null, $startColumn = 'A', $endColumn = null)
|
68 |
-
{
|
69 |
-
// Set subject
|
70 |
-
$this->subject = $subject;
|
71 |
-
$this->resetEnd($endColumn);
|
72 |
-
$this->resetStart($startColumn);
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Destructor
|
77 |
-
*/
|
78 |
-
public function __destruct()
|
79 |
-
{
|
80 |
-
unset($this->subject);
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* (Re)Set the start column and the current column pointer
|
85 |
-
*
|
86 |
-
* @param integer $startColumn The column address at which to start iterating
|
87 |
-
* @return PHPExcel_Worksheet_ColumnIterator
|
88 |
-
* @throws PHPExcel_Exception
|
89 |
-
*/
|
90 |
-
public function resetStart($startColumn = 'A')
|
91 |
-
{
|
92 |
-
$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
|
93 |
-
if ($startColumnIndex > PHPExcel_Cell::columnIndexFromString($this->subject->getHighestColumn()) - 1) {
|
94 |
-
throw new PHPExcel_Exception("Start column ({$startColumn}) is beyond highest column ({$this->subject->getHighestColumn()})");
|
95 |
-
}
|
96 |
-
|
97 |
-
$this->startColumn = $startColumnIndex;
|
98 |
-
if ($this->endColumn < $this->startColumn) {
|
99 |
-
$this->endColumn = $this->startColumn;
|
100 |
-
}
|
101 |
-
$this->seek($startColumn);
|
102 |
-
|
103 |
-
return $this;
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* (Re)Set the end column
|
108 |
-
*
|
109 |
-
* @param string $endColumn The column address at which to stop iterating
|
110 |
-
* @return PHPExcel_Worksheet_ColumnIterator
|
111 |
-
*/
|
112 |
-
public function resetEnd($endColumn = null)
|
113 |
-
{
|
114 |
-
$endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn();
|
115 |
-
$this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
|
116 |
-
|
117 |
-
return $this;
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Set the column pointer to the selected column
|
122 |
-
*
|
123 |
-
* @param string $column The column address to set the current pointer at
|
124 |
-
* @return PHPExcel_Worksheet_ColumnIterator
|
125 |
-
* @throws PHPExcel_Exception
|
126 |
-
*/
|
127 |
-
public function seek($column = 'A')
|
128 |
-
{
|
129 |
-
$column = PHPExcel_Cell::columnIndexFromString($column) - 1;
|
130 |
-
if (($column < $this->startColumn) || ($column > $this->endColumn)) {
|
131 |
-
throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
|
132 |
-
}
|
133 |
-
$this->position = $column;
|
134 |
-
|
135 |
-
return $this;
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Rewind the iterator to the starting column
|
140 |
-
*/
|
141 |
-
public function rewind()
|
142 |
-
{
|
143 |
-
$this->position = $this->startColumn;
|
144 |
-
}
|
145 |
-
|
146 |
-
/**
|
147 |
-
* Return the current column in this worksheet
|
148 |
-
*
|
149 |
-
* @return PHPExcel_Worksheet_Column
|
150 |
-
*/
|
151 |
-
public function current()
|
152 |
-
{
|
153 |
-
return new PHPExcel_Worksheet_Column($this->subject, PHPExcel_Cell::stringFromColumnIndex($this->position));
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* Return the current iterator key
|
158 |
-
*
|
159 |
-
* @return string
|
160 |
-
*/
|
161 |
-
public function key()
|
162 |
-
{
|
163 |
-
return PHPExcel_Cell::stringFromColumnIndex($this->position);
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Set the iterator to its next value
|
168 |
-
*/
|
169 |
-
public function next()
|
170 |
-
{
|
171 |
-
++$this->position;
|
172 |
-
}
|
173 |
-
|
174 |
-
/**
|
175 |
-
* Set the iterator to its previous value
|
176 |
-
*
|
177 |
-
* @throws PHPExcel_Exception
|
178 |
-
*/
|
179 |
-
public function prev()
|
180 |
-
{
|
181 |
-
if ($this->position <= $this->startColumn) {
|
182 |
-
throw new PHPExcel_Exception(
|
183 |
-
"Column is already at the beginning of range (" .
|
184 |
-
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
|
185 |
-
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
|
186 |
-
);
|
187 |
-
}
|
188 |
-
|
189 |
-
--$this->position;
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* Indicate if more columns exist in the worksheet range of columns that we're iterating
|
194 |
-
*
|
195 |
-
* @return boolean
|
196 |
-
*/
|
197 |
-
public function valid()
|
198 |
-
{
|
199 |
-
return $this->position <= $this->endColumn;
|
200 |
-
}
|
201 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Worksheet_ColumnIterator
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Worksheet
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Worksheet_ColumnIterator implements Iterator
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* PHPExcel_Worksheet to iterate
|
32 |
+
*
|
33 |
+
* @var PHPExcel_Worksheet
|
34 |
+
*/
|
35 |
+
private $subject;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Current iterator position
|
39 |
+
*
|
40 |
+
* @var int
|
41 |
+
*/
|
42 |
+
private $position = 0;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Start position
|
46 |
+
*
|
47 |
+
* @var int
|
48 |
+
*/
|
49 |
+
private $startColumn = 0;
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* End position
|
54 |
+
*
|
55 |
+
* @var int
|
56 |
+
*/
|
57 |
+
private $endColumn = 0;
|
58 |
+
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Create a new column iterator
|
62 |
+
*
|
63 |
+
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
64 |
+
* @param string $startColumn The column address at which to start iterating
|
65 |
+
* @param string $endColumn Optionally, the column address at which to stop iterating
|
66 |
+
*/
|
67 |
+
public function __construct(PHPExcel_Worksheet $subject = null, $startColumn = 'A', $endColumn = null)
|
68 |
+
{
|
69 |
+
// Set subject
|
70 |
+
$this->subject = $subject;
|
71 |
+
$this->resetEnd($endColumn);
|
72 |
+
$this->resetStart($startColumn);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Destructor
|
77 |
+
*/
|
78 |
+
public function __destruct()
|
79 |
+
{
|
80 |
+
unset($this->subject);
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* (Re)Set the start column and the current column pointer
|
85 |
+
*
|
86 |
+
* @param integer $startColumn The column address at which to start iterating
|
87 |
+
* @return PHPExcel_Worksheet_ColumnIterator
|
88 |
+
* @throws PHPExcel_Exception
|
89 |
+
*/
|
90 |
+
public function resetStart($startColumn = 'A')
|
91 |
+
{
|
92 |
+
$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
|
93 |
+
if ($startColumnIndex > PHPExcel_Cell::columnIndexFromString($this->subject->getHighestColumn()) - 1) {
|
94 |
+
throw new PHPExcel_Exception("Start column ({$startColumn}) is beyond highest column ({$this->subject->getHighestColumn()})");
|
95 |
+
}
|
96 |
+
|
97 |
+
$this->startColumn = $startColumnIndex;
|
98 |
+
if ($this->endColumn < $this->startColumn) {
|
99 |
+
$this->endColumn = $this->startColumn;
|
100 |
+
}
|
101 |
+
$this->seek($startColumn);
|
102 |
+
|
103 |
+
return $this;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* (Re)Set the end column
|
108 |
+
*
|
109 |
+
* @param string $endColumn The column address at which to stop iterating
|
110 |
+
* @return PHPExcel_Worksheet_ColumnIterator
|
111 |
+
*/
|
112 |
+
public function resetEnd($endColumn = null)
|
113 |
+
{
|
114 |
+
$endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn();
|
115 |
+
$this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
|
116 |
+
|
117 |
+
return $this;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Set the column pointer to the selected column
|
122 |
+
*
|
123 |
+
* @param string $column The column address to set the current pointer at
|
124 |
+
* @return PHPExcel_Worksheet_ColumnIterator
|
125 |
+
* @throws PHPExcel_Exception
|
126 |
+
*/
|
127 |
+
public function seek($column = 'A')
|
128 |
+
{
|
129 |
+
$column = PHPExcel_Cell::columnIndexFromString($column) - 1;
|
130 |
+
if (($column < $this->startColumn) || ($column > $this->endColumn)) {
|
131 |
+
throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
|
132 |
+
}
|
133 |
+
$this->position = $column;
|
134 |
+
|
135 |
+
return $this;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Rewind the iterator to the starting column
|
140 |
+
*/
|
141 |
+
public function rewind()
|
142 |
+
{
|
143 |
+
$this->position = $this->startColumn;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Return the current column in this worksheet
|
148 |
+
*
|
149 |
+
* @return PHPExcel_Worksheet_Column
|
150 |
+
*/
|
151 |
+
public function current()
|
152 |
+
{
|
153 |
+
return new PHPExcel_Worksheet_Column($this->subject, PHPExcel_Cell::stringFromColumnIndex($this->position));
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Return the current iterator key
|
158 |
+
*
|
159 |
+
* @return string
|
160 |
+
*/
|
161 |
+
public function key()
|
162 |
+
{
|
163 |
+
return PHPExcel_Cell::stringFromColumnIndex($this->position);
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Set the iterator to its next value
|
168 |
+
*/
|
169 |
+
public function next()
|
170 |
+
{
|
171 |
+
++$this->position;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Set the iterator to its previous value
|
176 |
+
*
|
177 |
+
* @throws PHPExcel_Exception
|
178 |
+
*/
|
179 |
+
public function prev()
|
180 |
+
{
|
181 |
+
if ($this->position <= $this->startColumn) {
|
182 |
+
throw new PHPExcel_Exception(
|
183 |
+
"Column is already at the beginning of range (" .
|
184 |
+
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
|
185 |
+
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
|
186 |
+
);
|
187 |
+
}
|
188 |
+
|
189 |
+
--$this->position;
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Indicate if more columns exist in the worksheet range of columns that we're iterating
|
194 |
+
*
|
195 |
+
* @return boolean
|
196 |
+
*/
|
197 |
+
public function valid()
|
198 |
+
{
|
199 |
+
return $this->position <= $this->endColumn;
|
200 |
+
}
|
201 |
+
}
|
PHPExcel/Classes/PHPExcel/Worksheet/Dimension.php
CHANGED
@@ -1,178 +1,178 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Worksheet_Dimension
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Worksheet
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
abstract class PHPExcel_Worksheet_Dimension
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Visible?
|
32 |
-
*
|
33 |
-
* @var bool
|
34 |
-
*/
|
35 |
-
private $visible = true;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Outline level
|
39 |
-
*
|
40 |
-
* @var int
|
41 |
-
*/
|
42 |
-
private $outlineLevel = 0;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Collapsed
|
46 |
-
*
|
47 |
-
* @var bool
|
48 |
-
*/
|
49 |
-
private $collapsed = false;
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Index to cellXf. Null value means row has no explicit cellXf format.
|
53 |
-
*
|
54 |
-
* @var int|null
|
55 |
-
*/
|
56 |
-
private $xfIndex;
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Create a new PHPExcel_Worksheet_Dimension
|
60 |
-
*
|
61 |
-
* @param int $pIndex Numeric row index
|
62 |
-
*/
|
63 |
-
public function __construct($initialValue = null)
|
64 |
-
{
|
65 |
-
// set dimension as unformatted by default
|
66 |
-
$this->xfIndex = $initialValue;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Get Visible
|
71 |
-
*
|
72 |
-
* @return bool
|
73 |
-
*/
|
74 |
-
public function getVisible()
|
75 |
-
{
|
76 |
-
return $this->visible;
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Set Visible
|
81 |
-
*
|
82 |
-
* @param bool $pValue
|
83 |
-
* @return PHPExcel_Worksheet_Dimension
|
84 |
-
*/
|
85 |
-
public function setVisible($pValue = true)
|
86 |
-
{
|
87 |
-
$this->visible = $pValue;
|
88 |
-
return $this;
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Get Outline Level
|
93 |
-
*
|
94 |
-
* @return int
|
95 |
-
*/
|
96 |
-
public function getOutlineLevel()
|
97 |
-
{
|
98 |
-
return $this->outlineLevel;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Set Outline Level
|
103 |
-
*
|
104 |
-
* Value must be between 0 and 7
|
105 |
-
*
|
106 |
-
* @param int $pValue
|
107 |
-
* @throws PHPExcel_Exception
|
108 |
-
* @return PHPExcel_Worksheet_Dimension
|
109 |
-
*/
|
110 |
-
public function setOutlineLevel($pValue)
|
111 |
-
{
|
112 |
-
if ($pValue < 0 || $pValue > 7) {
|
113 |
-
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
|
114 |
-
}
|
115 |
-
|
116 |
-
$this->outlineLevel = $pValue;
|
117 |
-
return $this;
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Get Collapsed
|
122 |
-
*
|
123 |
-
* @return bool
|
124 |
-
*/
|
125 |
-
public function getCollapsed()
|
126 |
-
{
|
127 |
-
return $this->collapsed;
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Set Collapsed
|
132 |
-
*
|
133 |
-
* @param bool $pValue
|
134 |
-
* @return PHPExcel_Worksheet_Dimension
|
135 |
-
*/
|
136 |
-
public function setCollapsed($pValue = true)
|
137 |
-
{
|
138 |
-
$this->collapsed = $pValue;
|
139 |
-
return $this;
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Get index to cellXf
|
144 |
-
*
|
145 |
-
* @return int
|
146 |
-
*/
|
147 |
-
public function getXfIndex()
|
148 |
-
{
|
149 |
-
return $this->xfIndex;
|
150 |
-
}
|
151 |
-
|
152 |
-
/**
|
153 |
-
* Set index to cellXf
|
154 |
-
*
|
155 |
-
* @param int $pValue
|
156 |
-
* @return PHPExcel_Worksheet_Dimension
|
157 |
-
*/
|
158 |
-
public function setXfIndex($pValue = 0)
|
159 |
-
{
|
160 |
-
$this->xfIndex = $pValue;
|
161 |
-
return $this;
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
166 |
-
*/
|
167 |
-
public function __clone()
|
168 |
-
{
|
169 |
-
$vars = get_object_vars($this);
|
170 |
-
foreach ($vars as $key => $value) {
|
171 |
-
if (is_object($value)) {
|
172 |
-
$this->$key = clone $value;
|
173 |
-
} else {
|
174 |
-
$this->$key = $value;
|
175 |
-
}
|
176 |
-
}
|
177 |
-
}
|
178 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Worksheet_Dimension
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Worksheet
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
abstract class PHPExcel_Worksheet_Dimension
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Visible?
|
32 |
+
*
|
33 |
+
* @var bool
|
34 |
+
*/
|
35 |
+
private $visible = true;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Outline level
|
39 |
+
*
|
40 |
+
* @var int
|
41 |
+
*/
|
42 |
+
private $outlineLevel = 0;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Collapsed
|
46 |
+
*
|
47 |
+
* @var bool
|
48 |
+
*/
|
49 |
+
private $collapsed = false;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Index to cellXf. Null value means row has no explicit cellXf format.
|
53 |
+
*
|
54 |
+
* @var int|null
|
55 |
+
*/
|
56 |
+
private $xfIndex;
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Create a new PHPExcel_Worksheet_Dimension
|
60 |
+
*
|
61 |
+
* @param int $pIndex Numeric row index
|
62 |
+
*/
|
63 |
+
public function __construct($initialValue = null)
|
64 |
+
{
|
65 |
+
// set dimension as unformatted by default
|
66 |
+
$this->xfIndex = $initialValue;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Get Visible
|
71 |
+
*
|
72 |
+
* @return bool
|
73 |
+
*/
|
74 |
+
public function getVisible()
|
75 |
+
{
|
76 |
+
return $this->visible;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Set Visible
|
81 |
+
*
|
82 |
+
* @param bool $pValue
|
83 |
+
* @return PHPExcel_Worksheet_Dimension
|
84 |
+
*/
|
85 |
+
public function setVisible($pValue = true)
|
86 |
+
{
|
87 |
+
$this->visible = $pValue;
|
88 |
+
return $this;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Get Outline Level
|
93 |
+
*
|
94 |
+
* @return int
|
95 |
+
*/
|
96 |
+
public function getOutlineLevel()
|
97 |
+
{
|
98 |
+
return $this->outlineLevel;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Set Outline Level
|
103 |
+
*
|
104 |
+
* Value must be between 0 and 7
|
105 |
+
*
|
106 |
+
* @param int $pValue
|
107 |
+
* @throws PHPExcel_Exception
|
108 |
+
* @return PHPExcel_Worksheet_Dimension
|
109 |
+
*/
|
110 |
+
public function setOutlineLevel($pValue)
|
111 |
+
{
|
112 |
+
if ($pValue < 0 || $pValue > 7) {
|
113 |
+
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
|
114 |
+
}
|
115 |
+
|
116 |
+
$this->outlineLevel = $pValue;
|
117 |
+
return $this;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Get Collapsed
|
122 |
+
*
|
123 |
+
* @return bool
|
124 |
+
*/
|
125 |
+
public function getCollapsed()
|
126 |
+
{
|
127 |
+
return $this->collapsed;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Set Collapsed
|
132 |
+
*
|
133 |
+
* @param bool $pValue
|
134 |
+
* @return PHPExcel_Worksheet_Dimension
|
135 |
+
*/
|
136 |
+
public function setCollapsed($pValue = true)
|
137 |
+
{
|
138 |
+
$this->collapsed = $pValue;
|
139 |
+
return $this;
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Get index to cellXf
|
144 |
+
*
|
145 |
+
* @return int
|
146 |
+
*/
|
147 |
+
public function getXfIndex()
|
148 |
+
{
|
149 |
+
return $this->xfIndex;
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Set index to cellXf
|
154 |
+
*
|
155 |
+
* @param int $pValue
|
156 |
+
* @return PHPExcel_Worksheet_Dimension
|
157 |
+
*/
|
158 |
+
public function setXfIndex($pValue = 0)
|
159 |
+
{
|
160 |
+
$this->xfIndex = $pValue;
|
161 |
+
return $this;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
166 |
+
*/
|
167 |
+
public function __clone()
|
168 |
+
{
|
169 |
+
$vars = get_object_vars($this);
|
170 |
+
foreach ($vars as $key => $value) {
|
171 |
+
if (is_object($value)) {
|
172 |
+
$this->$key = clone $value;
|
173 |
+
} else {
|
174 |
+
$this->$key = $value;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
}
|
178 |
+
}
|
PHPExcel/Classes/PHPExcel/Worksheet/RowCellIterator.php
CHANGED
@@ -1,225 +1,225 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Worksheet_RowCellIterator
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Worksheet
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Worksheet_RowCellIterator extends PHPExcel_Worksheet_CellIterator implements Iterator
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Row index
|
32 |
-
*
|
33 |
-
* @var int
|
34 |
-
*/
|
35 |
-
protected $rowIndex;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Start position
|
39 |
-
*
|
40 |
-
* @var int
|
41 |
-
*/
|
42 |
-
protected $startColumn = 0;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* End position
|
46 |
-
*
|
47 |
-
* @var int
|
48 |
-
*/
|
49 |
-
protected $endColumn = 0;
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Create a new column iterator
|
53 |
-
*
|
54 |
-
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
55 |
-
* @param integer $rowIndex The row that we want to iterate
|
56 |
-
* @param string $startColumn The column address at which to start iterating
|
57 |
-
* @param string $endColumn Optionally, the column address at which to stop iterating
|
58 |
-
*/
|
59 |
-
public function __construct(PHPExcel_Worksheet $subject = null, $rowIndex = 1, $startColumn = 'A', $endColumn = null)
|
60 |
-
{
|
61 |
-
// Set subject and row index
|
62 |
-
$this->subject = $subject;
|
63 |
-
$this->rowIndex = $rowIndex;
|
64 |
-
$this->resetEnd($endColumn);
|
65 |
-
$this->resetStart($startColumn);
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Destructor
|
70 |
-
*/
|
71 |
-
public function __destruct()
|
72 |
-
{
|
73 |
-
unset($this->subject);
|
74 |
-
}
|
75 |
-
|
76 |
-
/**
|
77 |
-
* (Re)Set the start column and the current column pointer
|
78 |
-
*
|
79 |
-
* @param integer $startColumn The column address at which to start iterating
|
80 |
-
* @return PHPExcel_Worksheet_RowCellIterator
|
81 |
-
* @throws PHPExcel_Exception
|
82 |
-
*/
|
83 |
-
public function resetStart($startColumn = 'A')
|
84 |
-
{
|
85 |
-
$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
|
86 |
-
$this->startColumn = $startColumnIndex;
|
87 |
-
$this->adjustForExistingOnlyRange();
|
88 |
-
$this->seek(PHPExcel_Cell::stringFromColumnIndex($this->startColumn));
|
89 |
-
|
90 |
-
return $this;
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* (Re)Set the end column
|
95 |
-
*
|
96 |
-
* @param string $endColumn The column address at which to stop iterating
|
97 |
-
* @return PHPExcel_Worksheet_RowCellIterator
|
98 |
-
* @throws PHPExcel_Exception
|
99 |
-
*/
|
100 |
-
public function resetEnd($endColumn = null)
|
101 |
-
{
|
102 |
-
$endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn();
|
103 |
-
$this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
|
104 |
-
$this->adjustForExistingOnlyRange();
|
105 |
-
|
106 |
-
return $this;
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Set the column pointer to the selected column
|
111 |
-
*
|
112 |
-
* @param string $column The column address to set the current pointer at
|
113 |
-
* @return PHPExcel_Worksheet_RowCellIterator
|
114 |
-
* @throws PHPExcel_Exception
|
115 |
-
*/
|
116 |
-
public function seek($column = 'A')
|
117 |
-
{
|
118 |
-
$column = PHPExcel_Cell::columnIndexFromString($column) - 1;
|
119 |
-
if (($column < $this->startColumn) || ($column > $this->endColumn)) {
|
120 |
-
throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
|
121 |
-
} elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($column, $this->rowIndex))) {
|
122 |
-
throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
|
123 |
-
}
|
124 |
-
$this->position = $column;
|
125 |
-
|
126 |
-
return $this;
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Rewind the iterator to the starting column
|
131 |
-
*/
|
132 |
-
public function rewind()
|
133 |
-
{
|
134 |
-
$this->position = $this->startColumn;
|
135 |
-
}
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Return the current cell in this worksheet row
|
139 |
-
*
|
140 |
-
* @return PHPExcel_Cell
|
141 |
-
*/
|
142 |
-
public function current()
|
143 |
-
{
|
144 |
-
return $this->subject->getCellByColumnAndRow($this->position, $this->rowIndex);
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Return the current iterator key
|
149 |
-
*
|
150 |
-
* @return string
|
151 |
-
*/
|
152 |
-
public function key()
|
153 |
-
{
|
154 |
-
return PHPExcel_Cell::stringFromColumnIndex($this->position);
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Set the iterator to its next value
|
159 |
-
*/
|
160 |
-
public function next()
|
161 |
-
{
|
162 |
-
do {
|
163 |
-
++$this->position;
|
164 |
-
} while (($this->onlyExistingCells) &&
|
165 |
-
(!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) &&
|
166 |
-
($this->position <= $this->endColumn));
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Set the iterator to its previous value
|
171 |
-
*
|
172 |
-
* @throws PHPExcel_Exception
|
173 |
-
*/
|
174 |
-
public function prev()
|
175 |
-
{
|
176 |
-
if ($this->position <= $this->startColumn) {
|
177 |
-
throw new PHPExcel_Exception(
|
178 |
-
"Column is already at the beginning of range (" .
|
179 |
-
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
|
180 |
-
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
|
181 |
-
);
|
182 |
-
}
|
183 |
-
|
184 |
-
do {
|
185 |
-
--$this->position;
|
186 |
-
} while (($this->onlyExistingCells) &&
|
187 |
-
(!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) &&
|
188 |
-
($this->position >= $this->startColumn));
|
189 |
-
}
|
190 |
-
|
191 |
-
/**
|
192 |
-
* Indicate if more columns exist in the worksheet range of columns that we're iterating
|
193 |
-
*
|
194 |
-
* @return boolean
|
195 |
-
*/
|
196 |
-
public function valid()
|
197 |
-
{
|
198 |
-
return $this->position <= $this->endColumn;
|
199 |
-
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
|
203 |
-
*
|
204 |
-
* @throws PHPExcel_Exception
|
205 |
-
*/
|
206 |
-
protected function adjustForExistingOnlyRange()
|
207 |
-
{
|
208 |
-
if ($this->onlyExistingCells) {
|
209 |
-
while ((!$this->subject->cellExistsByColumnAndRow($this->startColumn, $this->rowIndex)) &&
|
210 |
-
($this->startColumn <= $this->endColumn)) {
|
211 |
-
++$this->startColumn;
|
212 |
-
}
|
213 |
-
if ($this->startColumn > $this->endColumn) {
|
214 |
-
throw new PHPExcel_Exception('No cells exist within the specified range');
|
215 |
-
}
|
216 |
-
while ((!$this->subject->cellExistsByColumnAndRow($this->endColumn, $this->rowIndex)) &&
|
217 |
-
($this->endColumn >= $this->startColumn)) {
|
218 |
-
--$this->endColumn;
|
219 |
-
}
|
220 |
-
if ($this->endColumn < $this->startColumn) {
|
221 |
-
throw new PHPExcel_Exception('No cells exist within the specified range');
|
222 |
-
}
|
223 |
-
}
|
224 |
-
}
|
225 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Worksheet_RowCellIterator
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Worksheet
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Worksheet_RowCellIterator extends PHPExcel_Worksheet_CellIterator implements Iterator
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Row index
|
32 |
+
*
|
33 |
+
* @var int
|
34 |
+
*/
|
35 |
+
protected $rowIndex;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Start position
|
39 |
+
*
|
40 |
+
* @var int
|
41 |
+
*/
|
42 |
+
protected $startColumn = 0;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* End position
|
46 |
+
*
|
47 |
+
* @var int
|
48 |
+
*/
|
49 |
+
protected $endColumn = 0;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Create a new column iterator
|
53 |
+
*
|
54 |
+
* @param PHPExcel_Worksheet $subject The worksheet to iterate over
|
55 |
+
* @param integer $rowIndex The row that we want to iterate
|
56 |
+
* @param string $startColumn The column address at which to start iterating
|
57 |
+
* @param string $endColumn Optionally, the column address at which to stop iterating
|
58 |
+
*/
|
59 |
+
public function __construct(PHPExcel_Worksheet $subject = null, $rowIndex = 1, $startColumn = 'A', $endColumn = null)
|
60 |
+
{
|
61 |
+
// Set subject and row index
|
62 |
+
$this->subject = $subject;
|
63 |
+
$this->rowIndex = $rowIndex;
|
64 |
+
$this->resetEnd($endColumn);
|
65 |
+
$this->resetStart($startColumn);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Destructor
|
70 |
+
*/
|
71 |
+
public function __destruct()
|
72 |
+
{
|
73 |
+
unset($this->subject);
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* (Re)Set the start column and the current column pointer
|
78 |
+
*
|
79 |
+
* @param integer $startColumn The column address at which to start iterating
|
80 |
+
* @return PHPExcel_Worksheet_RowCellIterator
|
81 |
+
* @throws PHPExcel_Exception
|
82 |
+
*/
|
83 |
+
public function resetStart($startColumn = 'A')
|
84 |
+
{
|
85 |
+
$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
|
86 |
+
$this->startColumn = $startColumnIndex;
|
87 |
+
$this->adjustForExistingOnlyRange();
|
88 |
+
$this->seek(PHPExcel_Cell::stringFromColumnIndex($this->startColumn));
|
89 |
+
|
90 |
+
return $this;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* (Re)Set the end column
|
95 |
+
*
|
96 |
+
* @param string $endColumn The column address at which to stop iterating
|
97 |
+
* @return PHPExcel_Worksheet_RowCellIterator
|
98 |
+
* @throws PHPExcel_Exception
|
99 |
+
*/
|
100 |
+
public function resetEnd($endColumn = null)
|
101 |
+
{
|
102 |
+
$endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn();
|
103 |
+
$this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
|
104 |
+
$this->adjustForExistingOnlyRange();
|
105 |
+
|
106 |
+
return $this;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Set the column pointer to the selected column
|
111 |
+
*
|
112 |
+
* @param string $column The column address to set the current pointer at
|
113 |
+
* @return PHPExcel_Worksheet_RowCellIterator
|
114 |
+
* @throws PHPExcel_Exception
|
115 |
+
*/
|
116 |
+
public function seek($column = 'A')
|
117 |
+
{
|
118 |
+
$column = PHPExcel_Cell::columnIndexFromString($column) - 1;
|
119 |
+
if (($column < $this->startColumn) || ($column > $this->endColumn)) {
|
120 |
+
throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
|
121 |
+
} elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($column, $this->rowIndex))) {
|
122 |
+
throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
|
123 |
+
}
|
124 |
+
$this->position = $column;
|
125 |
+
|
126 |
+
return $this;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Rewind the iterator to the starting column
|
131 |
+
*/
|
132 |
+
public function rewind()
|
133 |
+
{
|
134 |
+
$this->position = $this->startColumn;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Return the current cell in this worksheet row
|
139 |
+
*
|
140 |
+
* @return PHPExcel_Cell
|
141 |
+
*/
|
142 |
+
public function current()
|
143 |
+
{
|
144 |
+
return $this->subject->getCellByColumnAndRow($this->position, $this->rowIndex);
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Return the current iterator key
|
149 |
+
*
|
150 |
+
* @return string
|
151 |
+
*/
|
152 |
+
public function key()
|
153 |
+
{
|
154 |
+
return PHPExcel_Cell::stringFromColumnIndex($this->position);
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Set the iterator to its next value
|
159 |
+
*/
|
160 |
+
public function next()
|
161 |
+
{
|
162 |
+
do {
|
163 |
+
++$this->position;
|
164 |
+
} while (($this->onlyExistingCells) &&
|
165 |
+
(!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) &&
|
166 |
+
($this->position <= $this->endColumn));
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Set the iterator to its previous value
|
171 |
+
*
|
172 |
+
* @throws PHPExcel_Exception
|
173 |
+
*/
|
174 |
+
public function prev()
|
175 |
+
{
|
176 |
+
if ($this->position <= $this->startColumn) {
|
177 |
+
throw new PHPExcel_Exception(
|
178 |
+
"Column is already at the beginning of range (" .
|
179 |
+
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
|
180 |
+
PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
|
181 |
+
);
|
182 |
+
}
|
183 |
+
|
184 |
+
do {
|
185 |
+
--$this->position;
|
186 |
+
} while (($this->onlyExistingCells) &&
|
187 |
+
(!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) &&
|
188 |
+
($this->position >= $this->startColumn));
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Indicate if more columns exist in the worksheet range of columns that we're iterating
|
193 |
+
*
|
194 |
+
* @return boolean
|
195 |
+
*/
|
196 |
+
public function valid()
|
197 |
+
{
|
198 |
+
return $this->position <= $this->endColumn;
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
|
203 |
+
*
|
204 |
+
* @throws PHPExcel_Exception
|
205 |
+
*/
|
206 |
+
protected function adjustForExistingOnlyRange()
|
207 |
+
{
|
208 |
+
if ($this->onlyExistingCells) {
|
209 |
+
while ((!$this->subject->cellExistsByColumnAndRow($this->startColumn, $this->rowIndex)) &&
|
210 |
+
($this->startColumn <= $this->endColumn)) {
|
211 |
+
++$this->startColumn;
|
212 |
+
}
|
213 |
+
if ($this->startColumn > $this->endColumn) {
|
214 |
+
throw new PHPExcel_Exception('No cells exist within the specified range');
|
215 |
+
}
|
216 |
+
while ((!$this->subject->cellExistsByColumnAndRow($this->endColumn, $this->rowIndex)) &&
|
217 |
+
($this->endColumn >= $this->startColumn)) {
|
218 |
+
--$this->endColumn;
|
219 |
+
}
|
220 |
+
if ($this->endColumn < $this->startColumn) {
|
221 |
+
throw new PHPExcel_Exception('No cells exist within the specified range');
|
222 |
+
}
|
223 |
+
}
|
224 |
+
}
|
225 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument.php
CHANGED
@@ -1,190 +1,190 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Writer_OpenDocument
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Writer_OpenDocument
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Private writer parts
|
32 |
-
*
|
33 |
-
* @var PHPExcel_Writer_OpenDocument_WriterPart[]
|
34 |
-
*/
|
35 |
-
private $writerParts = array();
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Private PHPExcel
|
39 |
-
*
|
40 |
-
* @var PHPExcel
|
41 |
-
*/
|
42 |
-
private $spreadSheet;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Create a new PHPExcel_Writer_OpenDocument
|
46 |
-
*
|
47 |
-
* @param PHPExcel $pPHPExcel
|
48 |
-
*/
|
49 |
-
public function __construct(PHPExcel $pPHPExcel = null)
|
50 |
-
{
|
51 |
-
$this->setPHPExcel($pPHPExcel);
|
52 |
-
|
53 |
-
$writerPartsArray = array(
|
54 |
-
'content' => 'PHPExcel_Writer_OpenDocument_Content',
|
55 |
-
'meta' => 'PHPExcel_Writer_OpenDocument_Meta',
|
56 |
-
'meta_inf' => 'PHPExcel_Writer_OpenDocument_MetaInf',
|
57 |
-
'mimetype' => 'PHPExcel_Writer_OpenDocument_Mimetype',
|
58 |
-
'settings' => 'PHPExcel_Writer_OpenDocument_Settings',
|
59 |
-
'styles' => 'PHPExcel_Writer_OpenDocument_Styles',
|
60 |
-
'thumbnails' => 'PHPExcel_Writer_OpenDocument_Thumbnails'
|
61 |
-
);
|
62 |
-
|
63 |
-
foreach ($writerPartsArray as $writer => $class) {
|
64 |
-
$this->writerParts[$writer] = new $class($this);
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Get writer part
|
70 |
-
*
|
71 |
-
* @param string $pPartName Writer part name
|
72 |
-
* @return PHPExcel_Writer_Excel2007_WriterPart
|
73 |
-
*/
|
74 |
-
public function getWriterPart($pPartName = '')
|
75 |
-
{
|
76 |
-
if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
|
77 |
-
return $this->writerParts[strtolower($pPartName)];
|
78 |
-
} else {
|
79 |
-
return null;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Save PHPExcel to file
|
85 |
-
*
|
86 |
-
* @param string $pFilename
|
87 |
-
* @throws PHPExcel_Writer_Exception
|
88 |
-
*/
|
89 |
-
public function save($pFilename = null)
|
90 |
-
{
|
91 |
-
if (!$this->spreadSheet) {
|
92 |
-
throw new PHPExcel_Writer_Exception('PHPExcel object unassigned.');
|
93 |
-
}
|
94 |
-
|
95 |
-
// garbage collect
|
96 |
-
$this->spreadSheet->garbageCollect();
|
97 |
-
|
98 |
-
// If $pFilename is php://output or php://stdout, make it a temporary file...
|
99 |
-
$originalFilename = $pFilename;
|
100 |
-
if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
|
101 |
-
$pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp');
|
102 |
-
if ($pFilename == '') {
|
103 |
-
$pFilename = $originalFilename;
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
$objZip = $this->createZip($pFilename);
|
108 |
-
|
109 |
-
$objZip->addFromString('META-INF/manifest.xml', $this->getWriterPart('meta_inf')->writeManifest());
|
110 |
-
$objZip->addFromString('Thumbnails/thumbnail.png', $this->getWriterPart('thumbnails')->writeThumbnail());
|
111 |
-
$objZip->addFromString('content.xml', $this->getWriterPart('content')->write());
|
112 |
-
$objZip->addFromString('meta.xml', $this->getWriterPart('meta')->write());
|
113 |
-
$objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->write());
|
114 |
-
$objZip->addFromString('settings.xml', $this->getWriterPart('settings')->write());
|
115 |
-
$objZip->addFromString('styles.xml', $this->getWriterPart('styles')->write());
|
116 |
-
|
117 |
-
// Close file
|
118 |
-
if ($objZip->close() === false) {
|
119 |
-
throw new PHPExcel_Writer_Exception("Could not close zip file $pFilename.");
|
120 |
-
}
|
121 |
-
|
122 |
-
// If a temporary file was used, copy it to the correct file stream
|
123 |
-
if ($originalFilename != $pFilename) {
|
124 |
-
if (copy($pFilename, $originalFilename) === false) {
|
125 |
-
throw new PHPExcel_Writer_Exception("Could not copy temporary zip file $pFilename to $originalFilename.");
|
126 |
-
}
|
127 |
-
@unlink($pFilename);
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Create zip object
|
133 |
-
*
|
134 |
-
* @param string $pFilename
|
135 |
-
* @throws PHPExcel_Writer_Exception
|
136 |
-
* @return ZipArchive
|
137 |
-
*/
|
138 |
-
private function createZip($pFilename)
|
139 |
-
{
|
140 |
-
// Create new ZIP file and open it for writing
|
141 |
-
$zipClass = PHPExcel_Settings::getZipClass();
|
142 |
-
$objZip = new $zipClass();
|
143 |
-
|
144 |
-
// Retrieve OVERWRITE and CREATE constants from the instantiated zip class
|
145 |
-
// This method of accessing constant values from a dynamic class should work with all appropriate versions of PHP
|
146 |
-
$ro = new ReflectionObject($objZip);
|
147 |
-
$zipOverWrite = $ro->getConstant('OVERWRITE');
|
148 |
-
$zipCreate = $ro->getConstant('CREATE');
|
149 |
-
|
150 |
-
if (file_exists($pFilename)) {
|
151 |
-
unlink($pFilename);
|
152 |
-
}
|
153 |
-
// Try opening the ZIP file
|
154 |
-
if ($objZip->open($pFilename, $zipOverWrite) !== true) {
|
155 |
-
if ($objZip->open($pFilename, $zipCreate) !== true) {
|
156 |
-
throw new PHPExcel_Writer_Exception("Could not open $pFilename for writing.");
|
157 |
-
}
|
158 |
-
}
|
159 |
-
|
160 |
-
return $objZip;
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Get PHPExcel object
|
165 |
-
*
|
166 |
-
* @return PHPExcel
|
167 |
-
* @throws PHPExcel_Writer_Exception
|
168 |
-
*/
|
169 |
-
public function getPHPExcel()
|
170 |
-
{
|
171 |
-
if ($this->spreadSheet !== null) {
|
172 |
-
return $this->spreadSheet;
|
173 |
-
} else {
|
174 |
-
throw new PHPExcel_Writer_Exception('No PHPExcel assigned.');
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Set PHPExcel object
|
180 |
-
*
|
181 |
-
* @param PHPExcel $pPHPExcel PHPExcel object
|
182 |
-
* @throws PHPExcel_Writer_Exception
|
183 |
-
* @return PHPExcel_Writer_Excel2007
|
184 |
-
*/
|
185 |
-
public function setPHPExcel(PHPExcel $pPHPExcel = null)
|
186 |
-
{
|
187 |
-
$this->spreadSheet = $pPHPExcel;
|
188 |
-
return $this;
|
189 |
-
}
|
190 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Writer_OpenDocument
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Writer_OpenDocument
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Private writer parts
|
32 |
+
*
|
33 |
+
* @var PHPExcel_Writer_OpenDocument_WriterPart[]
|
34 |
+
*/
|
35 |
+
private $writerParts = array();
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Private PHPExcel
|
39 |
+
*
|
40 |
+
* @var PHPExcel
|
41 |
+
*/
|
42 |
+
private $spreadSheet;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Create a new PHPExcel_Writer_OpenDocument
|
46 |
+
*
|
47 |
+
* @param PHPExcel $pPHPExcel
|
48 |
+
*/
|
49 |
+
public function __construct(PHPExcel $pPHPExcel = null)
|
50 |
+
{
|
51 |
+
$this->setPHPExcel($pPHPExcel);
|
52 |
+
|
53 |
+
$writerPartsArray = array(
|
54 |
+
'content' => 'PHPExcel_Writer_OpenDocument_Content',
|
55 |
+
'meta' => 'PHPExcel_Writer_OpenDocument_Meta',
|
56 |
+
'meta_inf' => 'PHPExcel_Writer_OpenDocument_MetaInf',
|
57 |
+
'mimetype' => 'PHPExcel_Writer_OpenDocument_Mimetype',
|
58 |
+
'settings' => 'PHPExcel_Writer_OpenDocument_Settings',
|
59 |
+
'styles' => 'PHPExcel_Writer_OpenDocument_Styles',
|
60 |
+
'thumbnails' => 'PHPExcel_Writer_OpenDocument_Thumbnails'
|
61 |
+
);
|
62 |
+
|
63 |
+
foreach ($writerPartsArray as $writer => $class) {
|
64 |
+
$this->writerParts[$writer] = new $class($this);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get writer part
|
70 |
+
*
|
71 |
+
* @param string $pPartName Writer part name
|
72 |
+
* @return PHPExcel_Writer_Excel2007_WriterPart
|
73 |
+
*/
|
74 |
+
public function getWriterPart($pPartName = '')
|
75 |
+
{
|
76 |
+
if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
|
77 |
+
return $this->writerParts[strtolower($pPartName)];
|
78 |
+
} else {
|
79 |
+
return null;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Save PHPExcel to file
|
85 |
+
*
|
86 |
+
* @param string $pFilename
|
87 |
+
* @throws PHPExcel_Writer_Exception
|
88 |
+
*/
|
89 |
+
public function save($pFilename = null)
|
90 |
+
{
|
91 |
+
if (!$this->spreadSheet) {
|
92 |
+
throw new PHPExcel_Writer_Exception('PHPExcel object unassigned.');
|
93 |
+
}
|
94 |
+
|
95 |
+
// garbage collect
|
96 |
+
$this->spreadSheet->garbageCollect();
|
97 |
+
|
98 |
+
// If $pFilename is php://output or php://stdout, make it a temporary file...
|
99 |
+
$originalFilename = $pFilename;
|
100 |
+
if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
|
101 |
+
$pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp');
|
102 |
+
if ($pFilename == '') {
|
103 |
+
$pFilename = $originalFilename;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
$objZip = $this->createZip($pFilename);
|
108 |
+
|
109 |
+
$objZip->addFromString('META-INF/manifest.xml', $this->getWriterPart('meta_inf')->writeManifest());
|
110 |
+
$objZip->addFromString('Thumbnails/thumbnail.png', $this->getWriterPart('thumbnails')->writeThumbnail());
|
111 |
+
$objZip->addFromString('content.xml', $this->getWriterPart('content')->write());
|
112 |
+
$objZip->addFromString('meta.xml', $this->getWriterPart('meta')->write());
|
113 |
+
$objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->write());
|
114 |
+
$objZip->addFromString('settings.xml', $this->getWriterPart('settings')->write());
|
115 |
+
$objZip->addFromString('styles.xml', $this->getWriterPart('styles')->write());
|
116 |
+
|
117 |
+
// Close file
|
118 |
+
if ($objZip->close() === false) {
|
119 |
+
throw new PHPExcel_Writer_Exception("Could not close zip file $pFilename.");
|
120 |
+
}
|
121 |
+
|
122 |
+
// If a temporary file was used, copy it to the correct file stream
|
123 |
+
if ($originalFilename != $pFilename) {
|
124 |
+
if (copy($pFilename, $originalFilename) === false) {
|
125 |
+
throw new PHPExcel_Writer_Exception("Could not copy temporary zip file $pFilename to $originalFilename.");
|
126 |
+
}
|
127 |
+
@unlink($pFilename);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Create zip object
|
133 |
+
*
|
134 |
+
* @param string $pFilename
|
135 |
+
* @throws PHPExcel_Writer_Exception
|
136 |
+
* @return ZipArchive
|
137 |
+
*/
|
138 |
+
private function createZip($pFilename)
|
139 |
+
{
|
140 |
+
// Create new ZIP file and open it for writing
|
141 |
+
$zipClass = PHPExcel_Settings::getZipClass();
|
142 |
+
$objZip = new $zipClass();
|
143 |
+
|
144 |
+
// Retrieve OVERWRITE and CREATE constants from the instantiated zip class
|
145 |
+
// This method of accessing constant values from a dynamic class should work with all appropriate versions of PHP
|
146 |
+
$ro = new ReflectionObject($objZip);
|
147 |
+
$zipOverWrite = $ro->getConstant('OVERWRITE');
|
148 |
+
$zipCreate = $ro->getConstant('CREATE');
|
149 |
+
|
150 |
+
if (file_exists($pFilename)) {
|
151 |
+
unlink($pFilename);
|
152 |
+
}
|
153 |
+
// Try opening the ZIP file
|
154 |
+
if ($objZip->open($pFilename, $zipOverWrite) !== true) {
|
155 |
+
if ($objZip->open($pFilename, $zipCreate) !== true) {
|
156 |
+
throw new PHPExcel_Writer_Exception("Could not open $pFilename for writing.");
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
return $objZip;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Get PHPExcel object
|
165 |
+
*
|
166 |
+
* @return PHPExcel
|
167 |
+
* @throws PHPExcel_Writer_Exception
|
168 |
+
*/
|
169 |
+
public function getPHPExcel()
|
170 |
+
{
|
171 |
+
if ($this->spreadSheet !== null) {
|
172 |
+
return $this->spreadSheet;
|
173 |
+
} else {
|
174 |
+
throw new PHPExcel_Writer_Exception('No PHPExcel assigned.');
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Set PHPExcel object
|
180 |
+
*
|
181 |
+
* @param PHPExcel $pPHPExcel PHPExcel object
|
182 |
+
* @throws PHPExcel_Writer_Exception
|
183 |
+
* @return PHPExcel_Writer_Excel2007
|
184 |
+
*/
|
185 |
+
public function setPHPExcel(PHPExcel $pPHPExcel = null)
|
186 |
+
{
|
187 |
+
$this->spreadSheet = $pPHPExcel;
|
188 |
+
return $this;
|
189 |
+
}
|
190 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Cell/Comment.php
CHANGED
@@ -1,63 +1,63 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHPExcel
|
4 |
-
*
|
5 |
-
* Copyright (c) 2006 - 2015 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_OpenDocument
|
23 |
-
* @copyright Copyright (c) 2006 - 2015 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_OpenDocument_Cell_Comment
|
31 |
-
*
|
32 |
-
* @category PHPExcel
|
33 |
-
* @package PHPExcel_Writer_OpenDocument
|
34 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
35 |
-
* @author Alexander Pervakov <frost-nzcr4@jagmort.com>
|
36 |
-
*/
|
37 |
-
class PHPExcel_Writer_OpenDocument_Cell_Comment
|
38 |
-
{
|
39 |
-
public static function write(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Cell $cell)
|
40 |
-
{
|
41 |
-
$comments = $cell->getWorksheet()->getComments();
|
42 |
-
if (!isset($comments[$cell->getCoordinate()])) {
|
43 |
-
return;
|
44 |
-
}
|
45 |
-
$comment = $comments[$cell->getCoordinate()];
|
46 |
-
|
47 |
-
$objWriter->startElement('office:annotation');
|
48 |
-
//$objWriter->writeAttribute('draw:style-name', 'gr1');
|
49 |
-
//$objWriter->writeAttribute('draw:text-style-name', 'P1');
|
50 |
-
$objWriter->writeAttribute('svg:width', $comment->getWidth());
|
51 |
-
$objWriter->writeAttribute('svg:height', $comment->getHeight());
|
52 |
-
$objWriter->writeAttribute('svg:x', $comment->getMarginLeft());
|
53 |
-
$objWriter->writeAttribute('svg:y', $comment->getMarginTop());
|
54 |
-
//$objWriter->writeAttribute('draw:caption-point-x', $comment->getMarginLeft());
|
55 |
-
//$objWriter->writeAttribute('draw:caption-point-y', $comment->getMarginTop());
|
56 |
-
$objWriter->writeElement('dc:creator', $comment->getAuthor());
|
57 |
-
// TODO: Not realized in PHPExcel_Comment yet.
|
58 |
-
//$objWriter->writeElement('dc:date', $comment->getDate());
|
59 |
-
$objWriter->writeElement('text:p', $comment->getText()->getPlainText());
|
60 |
-
//$objWriter->writeAttribute('draw:text-style-name', 'P1');
|
61 |
-
$objWriter->endElement();
|
62 |
-
}
|
63 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* PHPExcel
|
4 |
+
*
|
5 |
+
* Copyright (c) 2006 - 2015 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_OpenDocument
|
23 |
+
* @copyright Copyright (c) 2006 - 2015 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_OpenDocument_Cell_Comment
|
31 |
+
*
|
32 |
+
* @category PHPExcel
|
33 |
+
* @package PHPExcel_Writer_OpenDocument
|
34 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
35 |
+
* @author Alexander Pervakov <frost-nzcr4@jagmort.com>
|
36 |
+
*/
|
37 |
+
class PHPExcel_Writer_OpenDocument_Cell_Comment
|
38 |
+
{
|
39 |
+
public static function write(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Cell $cell)
|
40 |
+
{
|
41 |
+
$comments = $cell->getWorksheet()->getComments();
|
42 |
+
if (!isset($comments[$cell->getCoordinate()])) {
|
43 |
+
return;
|
44 |
+
}
|
45 |
+
$comment = $comments[$cell->getCoordinate()];
|
46 |
+
|
47 |
+
$objWriter->startElement('office:annotation');
|
48 |
+
//$objWriter->writeAttribute('draw:style-name', 'gr1');
|
49 |
+
//$objWriter->writeAttribute('draw:text-style-name', 'P1');
|
50 |
+
$objWriter->writeAttribute('svg:width', $comment->getWidth());
|
51 |
+
$objWriter->writeAttribute('svg:height', $comment->getHeight());
|
52 |
+
$objWriter->writeAttribute('svg:x', $comment->getMarginLeft());
|
53 |
+
$objWriter->writeAttribute('svg:y', $comment->getMarginTop());
|
54 |
+
//$objWriter->writeAttribute('draw:caption-point-x', $comment->getMarginLeft());
|
55 |
+
//$objWriter->writeAttribute('draw:caption-point-y', $comment->getMarginTop());
|
56 |
+
$objWriter->writeElement('dc:creator', $comment->getAuthor());
|
57 |
+
// TODO: Not realized in PHPExcel_Comment yet.
|
58 |
+
//$objWriter->writeElement('dc:date', $comment->getDate());
|
59 |
+
$objWriter->writeElement('text:p', $comment->getText()->getPlainText());
|
60 |
+
//$objWriter->writeAttribute('draw:text-style-name', 'P1');
|
61 |
+
$objWriter->endElement();
|
62 |
+
}
|
63 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Content.php
CHANGED
@@ -1,272 +1,272 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHPExcel
|
4 |
-
*
|
5 |
-
* Copyright (c) 2006 - 2015 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_OpenDocument
|
23 |
-
* @copyright Copyright (c) 2006 - 2015 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_OpenDocument_Content
|
31 |
-
*
|
32 |
-
* @category PHPExcel
|
33 |
-
* @package PHPExcel_Writer_OpenDocument
|
34 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
35 |
-
* @author Alexander Pervakov <frost-nzcr4@jagmort.com>
|
36 |
-
*/
|
37 |
-
class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_WriterPart
|
38 |
-
{
|
39 |
-
const NUMBER_COLS_REPEATED_MAX = 1024;
|
40 |
-
const NUMBER_ROWS_REPEATED_MAX = 1048576;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Write content.xml to XML format
|
44 |
-
*
|
45 |
-
* @param PHPExcel $pPHPExcel
|
46 |
-
* @return string XML Output
|
47 |
-
* @throws PHPExcel_Writer_Exception
|
48 |
-
*/
|
49 |
-
public function write(PHPExcel $pPHPExcel = null)
|
50 |
-
{
|
51 |
-
if (!$pPHPExcel) {
|
52 |
-
$pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
|
53 |
-
}
|
54 |
-
|
55 |
-
$objWriter = null;
|
56 |
-
if ($this->getParentWriter()->getUseDiskCaching()) {
|
57 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
58 |
-
} else {
|
59 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
60 |
-
}
|
61 |
-
|
62 |
-
// XML header
|
63 |
-
$objWriter->startDocument('1.0', 'UTF-8');
|
64 |
-
|
65 |
-
// Content
|
66 |
-
$objWriter->startElement('office:document-content');
|
67 |
-
$objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
|
68 |
-
$objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
|
69 |
-
$objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
|
70 |
-
$objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
|
71 |
-
$objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
|
72 |
-
$objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
|
73 |
-
$objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
74 |
-
$objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
|
75 |
-
$objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
|
76 |
-
$objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
|
77 |
-
$objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
|
78 |
-
$objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
|
79 |
-
$objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
|
80 |
-
$objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
|
81 |
-
$objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
|
82 |
-
$objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
|
83 |
-
$objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
|
84 |
-
$objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
|
85 |
-
$objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
|
86 |
-
$objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
|
87 |
-
$objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
|
88 |
-
$objWriter->writeAttribute('xmlns:xforms', 'http://www.w3.org/2002/xforms');
|
89 |
-
$objWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
90 |
-
$objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
91 |
-
$objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
|
92 |
-
$objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
|
93 |
-
$objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
|
94 |
-
$objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
|
95 |
-
$objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
|
96 |
-
$objWriter->writeAttribute('xmlns:field', 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0');
|
97 |
-
$objWriter->writeAttribute('xmlns:formx', 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0');
|
98 |
-
$objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
|
99 |
-
$objWriter->writeAttribute('office:version', '1.2');
|
100 |
-
|
101 |
-
$objWriter->writeElement('office:scripts');
|
102 |
-
$objWriter->writeElement('office:font-face-decls');
|
103 |
-
$objWriter->writeElement('office:automatic-styles');
|
104 |
-
|
105 |
-
$objWriter->startElement('office:body');
|
106 |
-
$objWriter->startElement('office:spreadsheet');
|
107 |
-
$objWriter->writeElement('table:calculation-settings');
|
108 |
-
$this->writeSheets($objWriter);
|
109 |
-
$objWriter->writeElement('table:named-expressions');
|
110 |
-
$objWriter->endElement();
|
111 |
-
$objWriter->endElement();
|
112 |
-
$objWriter->endElement();
|
113 |
-
|
114 |
-
return $objWriter->getData();
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Write sheets
|
119 |
-
*
|
120 |
-
* @param PHPExcel_Shared_XMLWriter $objWriter
|
121 |
-
*/
|
122 |
-
private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter)
|
123 |
-
{
|
124 |
-
$pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
|
125 |
-
|
126 |
-
$sheet_count = $pPHPExcel->getSheetCount();
|
127 |
-
for ($i = 0; $i < $sheet_count; $i++) {
|
128 |
-
//$this->getWriterPart('Worksheet')->writeWorksheet());
|
129 |
-
$objWriter->startElement('table:table');
|
130 |
-
$objWriter->writeAttribute('table:name', $pPHPExcel->getSheet($i)->getTitle());
|
131 |
-
$objWriter->writeElement('office:forms');
|
132 |
-
$objWriter->startElement('table:table-column');
|
133 |
-
$objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
|
134 |
-
$objWriter->endElement();
|
135 |
-
$this->writeRows($objWriter, $pPHPExcel->getSheet($i));
|
136 |
-
$objWriter->endElement();
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Write rows of the specified sheet
|
142 |
-
*
|
143 |
-
* @param PHPExcel_Shared_XMLWriter $objWriter
|
144 |
-
* @param PHPExcel_Worksheet $sheet
|
145 |
-
*/
|
146 |
-
private function writeRows(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet $sheet)
|
147 |
-
{
|
148 |
-
$number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX;
|
149 |
-
$span_row = 0;
|
150 |
-
$rows = $sheet->getRowIterator();
|
151 |
-
while ($rows->valid()) {
|
152 |
-
$number_rows_repeated--;
|
153 |
-
$row = $rows->current();
|
154 |
-
if ($row->getCellIterator()->valid()) {
|
155 |
-
if ($span_row) {
|
156 |
-
$objWriter->startElement('table:table-row');
|
157 |
-
if ($span_row > 1) {
|
158 |
-
$objWriter->writeAttribute('table:number-rows-repeated', $span_row);
|
159 |
-
}
|
160 |
-
$objWriter->startElement('table:table-cell');
|
161 |
-
$objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
|
162 |
-
$objWriter->endElement();
|
163 |
-
$objWriter->endElement();
|
164 |
-
$span_row = 0;
|
165 |
-
}
|
166 |
-
$objWriter->startElement('table:table-row');
|
167 |
-
$this->writeCells($objWriter, $row);
|
168 |
-
$objWriter->endElement();
|
169 |
-
} else {
|
170 |
-
$span_row++;
|
171 |
-
}
|
172 |
-
$rows->next();
|
173 |
-
}
|
174 |
-
}
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Write cells of the specified row
|
178 |
-
*
|
179 |
-
* @param PHPExcel_Shared_XMLWriter $objWriter
|
180 |
-
* @param PHPExcel_Worksheet_Row $row
|
181 |
-
* @throws PHPExcel_Writer_Exception
|
182 |
-
*/
|
183 |
-
private function writeCells(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet_Row $row)
|
184 |
-
{
|
185 |
-
$number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX;
|
186 |
-
$prev_column = -1;
|
187 |
-
$cells = $row->getCellIterator();
|
188 |
-
while ($cells->valid()) {
|
189 |
-
$cell = $cells->current();
|
190 |
-
$column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1;
|
191 |
-
|
192 |
-
$this->writeCellSpan($objWriter, $column, $prev_column);
|
193 |
-
$objWriter->startElement('table:table-cell');
|
194 |
-
|
195 |
-
switch ($cell->getDataType()) {
|
196 |
-
case PHPExcel_Cell_DataType::TYPE_BOOL:
|
197 |
-
$objWriter->writeAttribute('office:value-type', 'boolean');
|
198 |
-
$objWriter->writeAttribute('office:value', $cell->getValue());
|
199 |
-
$objWriter->writeElement('text:p', $cell->getValue());
|
200 |
-
break;
|
201 |
-
|
202 |
-
case PHPExcel_Cell_DataType::TYPE_ERROR:
|
203 |
-
throw new PHPExcel_Writer_Exception('Writing of error not implemented yet.');
|
204 |
-
break;
|
205 |
-
|
206 |
-
case PHPExcel_Cell_DataType::TYPE_FORMULA:
|
207 |
-
try {
|
208 |
-
$formula_value = $cell->getCalculatedValue();
|
209 |
-
} catch (Exception $e) {
|
210 |
-
$formula_value = $cell->getValue();
|
211 |
-
}
|
212 |
-
$objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue());
|
213 |
-
if (is_numeric($formula_value)) {
|
214 |
-
$objWriter->writeAttribute('office:value-type', 'float');
|
215 |
-
} else {
|
216 |
-
$objWriter->writeAttribute('office:value-type', 'string');
|
217 |
-
}
|
218 |
-
$objWriter->writeAttribute('office:value', $formula_value);
|
219 |
-
$objWriter->writeElement('text:p', $formula_value);
|
220 |
-
break;
|
221 |
-
|
222 |
-
case PHPExcel_Cell_DataType::TYPE_INLINE:
|
223 |
-
throw new PHPExcel_Writer_Exception('Writing of inline not implemented yet.');
|
224 |
-
break;
|
225 |
-
|
226 |
-
case PHPExcel_Cell_DataType::TYPE_NUMERIC:
|
227 |
-
$objWriter->writeAttribute('office:value-type', 'float');
|
228 |
-
$objWriter->writeAttribute('office:value', $cell->getValue());
|
229 |
-
$objWriter->writeElement('text:p', $cell->getValue());
|
230 |
-
break;
|
231 |
-
|
232 |
-
case PHPExcel_Cell_DataType::TYPE_STRING:
|
233 |
-
$objWriter->writeAttribute('office:value-type', 'string');
|
234 |
-
$objWriter->writeElement('text:p', $cell->getValue());
|
235 |
-
break;
|
236 |
-
}
|
237 |
-
PHPExcel_Writer_OpenDocument_Cell_Comment::write($objWriter, $cell);
|
238 |
-
$objWriter->endElement();
|
239 |
-
$prev_column = $column;
|
240 |
-
$cells->next();
|
241 |
-
}
|
242 |
-
$number_cols_repeated = $number_cols_repeated - $prev_column - 1;
|
243 |
-
if ($number_cols_repeated > 0) {
|
244 |
-
if ($number_cols_repeated > 1) {
|
245 |
-
$objWriter->startElement('table:table-cell');
|
246 |
-
$objWriter->writeAttribute('table:number-columns-repeated', $number_cols_repeated);
|
247 |
-
$objWriter->endElement();
|
248 |
-
} else {
|
249 |
-
$objWriter->writeElement('table:table-cell');
|
250 |
-
}
|
251 |
-
}
|
252 |
-
}
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Write span
|
256 |
-
*
|
257 |
-
* @param PHPExcel_Shared_XMLWriter $objWriter
|
258 |
-
* @param integer $curColumn
|
259 |
-
* @param integer $prevColumn
|
260 |
-
*/
|
261 |
-
private function writeCellSpan(PHPExcel_Shared_XMLWriter $objWriter, $curColumn, $prevColumn)
|
262 |
-
{
|
263 |
-
$diff = $curColumn - $prevColumn - 1;
|
264 |
-
if (1 === $diff) {
|
265 |
-
$objWriter->writeElement('table:table-cell');
|
266 |
-
} elseif ($diff > 1) {
|
267 |
-
$objWriter->startElement('table:table-cell');
|
268 |
-
$objWriter->writeAttribute('table:number-columns-repeated', $diff);
|
269 |
-
$objWriter->endElement();
|
270 |
-
}
|
271 |
-
}
|
272 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* PHPExcel
|
4 |
+
*
|
5 |
+
* Copyright (c) 2006 - 2015 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_OpenDocument
|
23 |
+
* @copyright Copyright (c) 2006 - 2015 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_OpenDocument_Content
|
31 |
+
*
|
32 |
+
* @category PHPExcel
|
33 |
+
* @package PHPExcel_Writer_OpenDocument
|
34 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
35 |
+
* @author Alexander Pervakov <frost-nzcr4@jagmort.com>
|
36 |
+
*/
|
37 |
+
class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_WriterPart
|
38 |
+
{
|
39 |
+
const NUMBER_COLS_REPEATED_MAX = 1024;
|
40 |
+
const NUMBER_ROWS_REPEATED_MAX = 1048576;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Write content.xml to XML format
|
44 |
+
*
|
45 |
+
* @param PHPExcel $pPHPExcel
|
46 |
+
* @return string XML Output
|
47 |
+
* @throws PHPExcel_Writer_Exception
|
48 |
+
*/
|
49 |
+
public function write(PHPExcel $pPHPExcel = null)
|
50 |
+
{
|
51 |
+
if (!$pPHPExcel) {
|
52 |
+
$pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
|
53 |
+
}
|
54 |
+
|
55 |
+
$objWriter = null;
|
56 |
+
if ($this->getParentWriter()->getUseDiskCaching()) {
|
57 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
58 |
+
} else {
|
59 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
60 |
+
}
|
61 |
+
|
62 |
+
// XML header
|
63 |
+
$objWriter->startDocument('1.0', 'UTF-8');
|
64 |
+
|
65 |
+
// Content
|
66 |
+
$objWriter->startElement('office:document-content');
|
67 |
+
$objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
|
68 |
+
$objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
|
69 |
+
$objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
|
70 |
+
$objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
|
71 |
+
$objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
|
72 |
+
$objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
|
73 |
+
$objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
74 |
+
$objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
|
75 |
+
$objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
|
76 |
+
$objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
|
77 |
+
$objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
|
78 |
+
$objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
|
79 |
+
$objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
|
80 |
+
$objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
|
81 |
+
$objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
|
82 |
+
$objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
|
83 |
+
$objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
|
84 |
+
$objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
|
85 |
+
$objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
|
86 |
+
$objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
|
87 |
+
$objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
|
88 |
+
$objWriter->writeAttribute('xmlns:xforms', 'http://www.w3.org/2002/xforms');
|
89 |
+
$objWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
90 |
+
$objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
91 |
+
$objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
|
92 |
+
$objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
|
93 |
+
$objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
|
94 |
+
$objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
|
95 |
+
$objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
|
96 |
+
$objWriter->writeAttribute('xmlns:field', 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0');
|
97 |
+
$objWriter->writeAttribute('xmlns:formx', 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0');
|
98 |
+
$objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
|
99 |
+
$objWriter->writeAttribute('office:version', '1.2');
|
100 |
+
|
101 |
+
$objWriter->writeElement('office:scripts');
|
102 |
+
$objWriter->writeElement('office:font-face-decls');
|
103 |
+
$objWriter->writeElement('office:automatic-styles');
|
104 |
+
|
105 |
+
$objWriter->startElement('office:body');
|
106 |
+
$objWriter->startElement('office:spreadsheet');
|
107 |
+
$objWriter->writeElement('table:calculation-settings');
|
108 |
+
$this->writeSheets($objWriter);
|
109 |
+
$objWriter->writeElement('table:named-expressions');
|
110 |
+
$objWriter->endElement();
|
111 |
+
$objWriter->endElement();
|
112 |
+
$objWriter->endElement();
|
113 |
+
|
114 |
+
return $objWriter->getData();
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Write sheets
|
119 |
+
*
|
120 |
+
* @param PHPExcel_Shared_XMLWriter $objWriter
|
121 |
+
*/
|
122 |
+
private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter)
|
123 |
+
{
|
124 |
+
$pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
|
125 |
+
|
126 |
+
$sheet_count = $pPHPExcel->getSheetCount();
|
127 |
+
for ($i = 0; $i < $sheet_count; $i++) {
|
128 |
+
//$this->getWriterPart('Worksheet')->writeWorksheet());
|
129 |
+
$objWriter->startElement('table:table');
|
130 |
+
$objWriter->writeAttribute('table:name', $pPHPExcel->getSheet($i)->getTitle());
|
131 |
+
$objWriter->writeElement('office:forms');
|
132 |
+
$objWriter->startElement('table:table-column');
|
133 |
+
$objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
|
134 |
+
$objWriter->endElement();
|
135 |
+
$this->writeRows($objWriter, $pPHPExcel->getSheet($i));
|
136 |
+
$objWriter->endElement();
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Write rows of the specified sheet
|
142 |
+
*
|
143 |
+
* @param PHPExcel_Shared_XMLWriter $objWriter
|
144 |
+
* @param PHPExcel_Worksheet $sheet
|
145 |
+
*/
|
146 |
+
private function writeRows(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet $sheet)
|
147 |
+
{
|
148 |
+
$number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX;
|
149 |
+
$span_row = 0;
|
150 |
+
$rows = $sheet->getRowIterator();
|
151 |
+
while ($rows->valid()) {
|
152 |
+
$number_rows_repeated--;
|
153 |
+
$row = $rows->current();
|
154 |
+
if ($row->getCellIterator()->valid()) {
|
155 |
+
if ($span_row) {
|
156 |
+
$objWriter->startElement('table:table-row');
|
157 |
+
if ($span_row > 1) {
|
158 |
+
$objWriter->writeAttribute('table:number-rows-repeated', $span_row);
|
159 |
+
}
|
160 |
+
$objWriter->startElement('table:table-cell');
|
161 |
+
$objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
|
162 |
+
$objWriter->endElement();
|
163 |
+
$objWriter->endElement();
|
164 |
+
$span_row = 0;
|
165 |
+
}
|
166 |
+
$objWriter->startElement('table:table-row');
|
167 |
+
$this->writeCells($objWriter, $row);
|
168 |
+
$objWriter->endElement();
|
169 |
+
} else {
|
170 |
+
$span_row++;
|
171 |
+
}
|
172 |
+
$rows->next();
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Write cells of the specified row
|
178 |
+
*
|
179 |
+
* @param PHPExcel_Shared_XMLWriter $objWriter
|
180 |
+
* @param PHPExcel_Worksheet_Row $row
|
181 |
+
* @throws PHPExcel_Writer_Exception
|
182 |
+
*/
|
183 |
+
private function writeCells(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet_Row $row)
|
184 |
+
{
|
185 |
+
$number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX;
|
186 |
+
$prev_column = -1;
|
187 |
+
$cells = $row->getCellIterator();
|
188 |
+
while ($cells->valid()) {
|
189 |
+
$cell = $cells->current();
|
190 |
+
$column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1;
|
191 |
+
|
192 |
+
$this->writeCellSpan($objWriter, $column, $prev_column);
|
193 |
+
$objWriter->startElement('table:table-cell');
|
194 |
+
|
195 |
+
switch ($cell->getDataType()) {
|
196 |
+
case PHPExcel_Cell_DataType::TYPE_BOOL:
|
197 |
+
$objWriter->writeAttribute('office:value-type', 'boolean');
|
198 |
+
$objWriter->writeAttribute('office:value', $cell->getValue());
|
199 |
+
$objWriter->writeElement('text:p', $cell->getValue());
|
200 |
+
break;
|
201 |
+
|
202 |
+
case PHPExcel_Cell_DataType::TYPE_ERROR:
|
203 |
+
throw new PHPExcel_Writer_Exception('Writing of error not implemented yet.');
|
204 |
+
break;
|
205 |
+
|
206 |
+
case PHPExcel_Cell_DataType::TYPE_FORMULA:
|
207 |
+
try {
|
208 |
+
$formula_value = $cell->getCalculatedValue();
|
209 |
+
} catch (Exception $e) {
|
210 |
+
$formula_value = $cell->getValue();
|
211 |
+
}
|
212 |
+
$objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue());
|
213 |
+
if (is_numeric($formula_value)) {
|
214 |
+
$objWriter->writeAttribute('office:value-type', 'float');
|
215 |
+
} else {
|
216 |
+
$objWriter->writeAttribute('office:value-type', 'string');
|
217 |
+
}
|
218 |
+
$objWriter->writeAttribute('office:value', $formula_value);
|
219 |
+
$objWriter->writeElement('text:p', $formula_value);
|
220 |
+
break;
|
221 |
+
|
222 |
+
case PHPExcel_Cell_DataType::TYPE_INLINE:
|
223 |
+
throw new PHPExcel_Writer_Exception('Writing of inline not implemented yet.');
|
224 |
+
break;
|
225 |
+
|
226 |
+
case PHPExcel_Cell_DataType::TYPE_NUMERIC:
|
227 |
+
$objWriter->writeAttribute('office:value-type', 'float');
|
228 |
+
$objWriter->writeAttribute('office:value', $cell->getValue());
|
229 |
+
$objWriter->writeElement('text:p', $cell->getValue());
|
230 |
+
break;
|
231 |
+
|
232 |
+
case PHPExcel_Cell_DataType::TYPE_STRING:
|
233 |
+
$objWriter->writeAttribute('office:value-type', 'string');
|
234 |
+
$objWriter->writeElement('text:p', $cell->getValue());
|
235 |
+
break;
|
236 |
+
}
|
237 |
+
PHPExcel_Writer_OpenDocument_Cell_Comment::write($objWriter, $cell);
|
238 |
+
$objWriter->endElement();
|
239 |
+
$prev_column = $column;
|
240 |
+
$cells->next();
|
241 |
+
}
|
242 |
+
$number_cols_repeated = $number_cols_repeated - $prev_column - 1;
|
243 |
+
if ($number_cols_repeated > 0) {
|
244 |
+
if ($number_cols_repeated > 1) {
|
245 |
+
$objWriter->startElement('table:table-cell');
|
246 |
+
$objWriter->writeAttribute('table:number-columns-repeated', $number_cols_repeated);
|
247 |
+
$objWriter->endElement();
|
248 |
+
} else {
|
249 |
+
$objWriter->writeElement('table:table-cell');
|
250 |
+
}
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Write span
|
256 |
+
*
|
257 |
+
* @param PHPExcel_Shared_XMLWriter $objWriter
|
258 |
+
* @param integer $curColumn
|
259 |
+
* @param integer $prevColumn
|
260 |
+
*/
|
261 |
+
private function writeCellSpan(PHPExcel_Shared_XMLWriter $objWriter, $curColumn, $prevColumn)
|
262 |
+
{
|
263 |
+
$diff = $curColumn - $prevColumn - 1;
|
264 |
+
if (1 === $diff) {
|
265 |
+
$objWriter->writeElement('table:table-cell');
|
266 |
+
} elseif ($diff > 1) {
|
267 |
+
$objWriter->startElement('table:table-cell');
|
268 |
+
$objWriter->writeAttribute('table:number-columns-repeated', $diff);
|
269 |
+
$objWriter->endElement();
|
270 |
+
}
|
271 |
+
}
|
272 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Meta.php
CHANGED
@@ -1,95 +1,95 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Writer_OpenDocument_Meta
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Writer_OpenDocument
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Writer_OpenDocument_Meta extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Write meta.xml to XML format
|
32 |
-
*
|
33 |
-
* @param PHPExcel $pPHPExcel
|
34 |
-
* @return string XML Output
|
35 |
-
* @throws PHPExcel_Writer_Exception
|
36 |
-
*/
|
37 |
-
public function write(PHPExcel $pPHPExcel = null)
|
38 |
-
{
|
39 |
-
if (!$pPHPExcel) {
|
40 |
-
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
41 |
-
}
|
42 |
-
|
43 |
-
$objWriter = null;
|
44 |
-
if ($this->getParentWriter()->getUseDiskCaching()) {
|
45 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
46 |
-
} else {
|
47 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
48 |
-
}
|
49 |
-
|
50 |
-
// XML header
|
51 |
-
$objWriter->startDocument('1.0', 'UTF-8');
|
52 |
-
|
53 |
-
// Meta
|
54 |
-
$objWriter->startElement('office:document-meta');
|
55 |
-
|
56 |
-
$objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
|
57 |
-
$objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
58 |
-
$objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
|
59 |
-
$objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
|
60 |
-
$objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
|
61 |
-
$objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
|
62 |
-
$objWriter->writeAttribute('office:version', '1.2');
|
63 |
-
|
64 |
-
$objWriter->startElement('office:meta');
|
65 |
-
|
66 |
-
$objWriter->writeElement('meta:initial-creator', $pPHPExcel->getProperties()->getCreator());
|
67 |
-
$objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator());
|
68 |
-
$objWriter->writeElement('meta:creation-date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
|
69 |
-
$objWriter->writeElement('dc:date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
|
70 |
-
$objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle());
|
71 |
-
$objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription());
|
72 |
-
$objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject());
|
73 |
-
$keywords = explode(' ', $pPHPExcel->getProperties()->getKeywords());
|
74 |
-
foreach ($keywords as $keyword) {
|
75 |
-
$objWriter->writeElement('meta:keyword', $keyword);
|
76 |
-
}
|
77 |
-
|
78 |
-
//<meta:document-statistic meta:table-count="XXX" meta:cell-count="XXX" meta:object-count="XXX"/>
|
79 |
-
$objWriter->startElement('meta:user-defined');
|
80 |
-
$objWriter->writeAttribute('meta:name', 'Company');
|
81 |
-
$objWriter->writeRaw($pPHPExcel->getProperties()->getCompany());
|
82 |
-
$objWriter->endElement();
|
83 |
-
|
84 |
-
$objWriter->startElement('meta:user-defined');
|
85 |
-
$objWriter->writeAttribute('meta:name', 'category');
|
86 |
-
$objWriter->writeRaw($pPHPExcel->getProperties()->getCategory());
|
87 |
-
$objWriter->endElement();
|
88 |
-
|
89 |
-
$objWriter->endElement();
|
90 |
-
|
91 |
-
$objWriter->endElement();
|
92 |
-
|
93 |
-
return $objWriter->getData();
|
94 |
-
}
|
95 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Writer_OpenDocument_Meta
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Writer_OpenDocument
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Writer_OpenDocument_Meta extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Write meta.xml to XML format
|
32 |
+
*
|
33 |
+
* @param PHPExcel $pPHPExcel
|
34 |
+
* @return string XML Output
|
35 |
+
* @throws PHPExcel_Writer_Exception
|
36 |
+
*/
|
37 |
+
public function write(PHPExcel $pPHPExcel = null)
|
38 |
+
{
|
39 |
+
if (!$pPHPExcel) {
|
40 |
+
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
41 |
+
}
|
42 |
+
|
43 |
+
$objWriter = null;
|
44 |
+
if ($this->getParentWriter()->getUseDiskCaching()) {
|
45 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
46 |
+
} else {
|
47 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
48 |
+
}
|
49 |
+
|
50 |
+
// XML header
|
51 |
+
$objWriter->startDocument('1.0', 'UTF-8');
|
52 |
+
|
53 |
+
// Meta
|
54 |
+
$objWriter->startElement('office:document-meta');
|
55 |
+
|
56 |
+
$objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
|
57 |
+
$objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
58 |
+
$objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
|
59 |
+
$objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
|
60 |
+
$objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
|
61 |
+
$objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
|
62 |
+
$objWriter->writeAttribute('office:version', '1.2');
|
63 |
+
|
64 |
+
$objWriter->startElement('office:meta');
|
65 |
+
|
66 |
+
$objWriter->writeElement('meta:initial-creator', $pPHPExcel->getProperties()->getCreator());
|
67 |
+
$objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator());
|
68 |
+
$objWriter->writeElement('meta:creation-date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
|
69 |
+
$objWriter->writeElement('dc:date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
|
70 |
+
$objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle());
|
71 |
+
$objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription());
|
72 |
+
$objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject());
|
73 |
+
$keywords = explode(' ', $pPHPExcel->getProperties()->getKeywords());
|
74 |
+
foreach ($keywords as $keyword) {
|
75 |
+
$objWriter->writeElement('meta:keyword', $keyword);
|
76 |
+
}
|
77 |
+
|
78 |
+
//<meta:document-statistic meta:table-count="XXX" meta:cell-count="XXX" meta:object-count="XXX"/>
|
79 |
+
$objWriter->startElement('meta:user-defined');
|
80 |
+
$objWriter->writeAttribute('meta:name', 'Company');
|
81 |
+
$objWriter->writeRaw($pPHPExcel->getProperties()->getCompany());
|
82 |
+
$objWriter->endElement();
|
83 |
+
|
84 |
+
$objWriter->startElement('meta:user-defined');
|
85 |
+
$objWriter->writeAttribute('meta:name', 'category');
|
86 |
+
$objWriter->writeRaw($pPHPExcel->getProperties()->getCategory());
|
87 |
+
$objWriter->endElement();
|
88 |
+
|
89 |
+
$objWriter->endElement();
|
90 |
+
|
91 |
+
$objWriter->endElement();
|
92 |
+
|
93 |
+
return $objWriter->getData();
|
94 |
+
}
|
95 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/MetaInf.php
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Writer_OpenDocument_MetaInf
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Writer_OpenDocument
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Writer_OpenDocument_MetaInf extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Write META-INF/manifest.xml to XML format
|
32 |
-
*
|
33 |
-
* @param PHPExcel $pPHPExcel
|
34 |
-
* @return string XML Output
|
35 |
-
* @throws PHPExcel_Writer_Exception
|
36 |
-
*/
|
37 |
-
public function writeManifest(PHPExcel $pPHPExcel = null)
|
38 |
-
{
|
39 |
-
if (!$pPHPExcel) {
|
40 |
-
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
41 |
-
}
|
42 |
-
|
43 |
-
$objWriter = null;
|
44 |
-
if ($this->getParentWriter()->getUseDiskCaching()) {
|
45 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
46 |
-
} else {
|
47 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
48 |
-
}
|
49 |
-
|
50 |
-
// XML header
|
51 |
-
$objWriter->startDocument('1.0', 'UTF-8');
|
52 |
-
|
53 |
-
// Manifest
|
54 |
-
$objWriter->startElement('manifest:manifest');
|
55 |
-
$objWriter->writeAttribute('xmlns:manifest', 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0');
|
56 |
-
$objWriter->writeAttribute('manifest:version', '1.2');
|
57 |
-
|
58 |
-
$objWriter->startElement('manifest:file-entry');
|
59 |
-
$objWriter->writeAttribute('manifest:full-path', '/');
|
60 |
-
$objWriter->writeAttribute('manifest:version', '1.2');
|
61 |
-
$objWriter->writeAttribute('manifest:media-type', 'application/vnd.oasis.opendocument.spreadsheet');
|
62 |
-
$objWriter->endElement();
|
63 |
-
$objWriter->startElement('manifest:file-entry');
|
64 |
-
$objWriter->writeAttribute('manifest:full-path', 'meta.xml');
|
65 |
-
$objWriter->writeAttribute('manifest:media-type', 'text/xml');
|
66 |
-
$objWriter->endElement();
|
67 |
-
$objWriter->startElement('manifest:file-entry');
|
68 |
-
$objWriter->writeAttribute('manifest:full-path', 'settings.xml');
|
69 |
-
$objWriter->writeAttribute('manifest:media-type', 'text/xml');
|
70 |
-
$objWriter->endElement();
|
71 |
-
$objWriter->startElement('manifest:file-entry');
|
72 |
-
$objWriter->writeAttribute('manifest:full-path', 'content.xml');
|
73 |
-
$objWriter->writeAttribute('manifest:media-type', 'text/xml');
|
74 |
-
$objWriter->endElement();
|
75 |
-
$objWriter->startElement('manifest:file-entry');
|
76 |
-
$objWriter->writeAttribute('manifest:full-path', 'Thumbnails/thumbnail.png');
|
77 |
-
$objWriter->writeAttribute('manifest:media-type', 'image/png');
|
78 |
-
$objWriter->endElement();
|
79 |
-
$objWriter->startElement('manifest:file-entry');
|
80 |
-
$objWriter->writeAttribute('manifest:full-path', 'styles.xml');
|
81 |
-
$objWriter->writeAttribute('manifest:media-type', 'text/xml');
|
82 |
-
$objWriter->endElement();
|
83 |
-
$objWriter->endElement();
|
84 |
-
|
85 |
-
return $objWriter->getData();
|
86 |
-
}
|
87 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Writer_OpenDocument_MetaInf
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Writer_OpenDocument
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Writer_OpenDocument_MetaInf extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Write META-INF/manifest.xml to XML format
|
32 |
+
*
|
33 |
+
* @param PHPExcel $pPHPExcel
|
34 |
+
* @return string XML Output
|
35 |
+
* @throws PHPExcel_Writer_Exception
|
36 |
+
*/
|
37 |
+
public function writeManifest(PHPExcel $pPHPExcel = null)
|
38 |
+
{
|
39 |
+
if (!$pPHPExcel) {
|
40 |
+
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
41 |
+
}
|
42 |
+
|
43 |
+
$objWriter = null;
|
44 |
+
if ($this->getParentWriter()->getUseDiskCaching()) {
|
45 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
46 |
+
} else {
|
47 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
48 |
+
}
|
49 |
+
|
50 |
+
// XML header
|
51 |
+
$objWriter->startDocument('1.0', 'UTF-8');
|
52 |
+
|
53 |
+
// Manifest
|
54 |
+
$objWriter->startElement('manifest:manifest');
|
55 |
+
$objWriter->writeAttribute('xmlns:manifest', 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0');
|
56 |
+
$objWriter->writeAttribute('manifest:version', '1.2');
|
57 |
+
|
58 |
+
$objWriter->startElement('manifest:file-entry');
|
59 |
+
$objWriter->writeAttribute('manifest:full-path', '/');
|
60 |
+
$objWriter->writeAttribute('manifest:version', '1.2');
|
61 |
+
$objWriter->writeAttribute('manifest:media-type', 'application/vnd.oasis.opendocument.spreadsheet');
|
62 |
+
$objWriter->endElement();
|
63 |
+
$objWriter->startElement('manifest:file-entry');
|
64 |
+
$objWriter->writeAttribute('manifest:full-path', 'meta.xml');
|
65 |
+
$objWriter->writeAttribute('manifest:media-type', 'text/xml');
|
66 |
+
$objWriter->endElement();
|
67 |
+
$objWriter->startElement('manifest:file-entry');
|
68 |
+
$objWriter->writeAttribute('manifest:full-path', 'settings.xml');
|
69 |
+
$objWriter->writeAttribute('manifest:media-type', 'text/xml');
|
70 |
+
$objWriter->endElement();
|
71 |
+
$objWriter->startElement('manifest:file-entry');
|
72 |
+
$objWriter->writeAttribute('manifest:full-path', 'content.xml');
|
73 |
+
$objWriter->writeAttribute('manifest:media-type', 'text/xml');
|
74 |
+
$objWriter->endElement();
|
75 |
+
$objWriter->startElement('manifest:file-entry');
|
76 |
+
$objWriter->writeAttribute('manifest:full-path', 'Thumbnails/thumbnail.png');
|
77 |
+
$objWriter->writeAttribute('manifest:media-type', 'image/png');
|
78 |
+
$objWriter->endElement();
|
79 |
+
$objWriter->startElement('manifest:file-entry');
|
80 |
+
$objWriter->writeAttribute('manifest:full-path', 'styles.xml');
|
81 |
+
$objWriter->writeAttribute('manifest:media-type', 'text/xml');
|
82 |
+
$objWriter->endElement();
|
83 |
+
$objWriter->endElement();
|
84 |
+
|
85 |
+
return $objWriter->getData();
|
86 |
+
}
|
87 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Mimetype.php
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel
|
5 |
-
*
|
6 |
-
* PHPExcel_Writer_OpenDocument_Mimetype
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Writer_OpenDocument
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Writer_OpenDocument_Mimetype extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Write mimetype to plain text format
|
32 |
-
*
|
33 |
-
* @param PHPExcel $pPHPExcel
|
34 |
-
* @return string XML Output
|
35 |
-
* @throws PHPExcel_Writer_Exception
|
36 |
-
*/
|
37 |
-
public function write(PHPExcel $pPHPExcel = null)
|
38 |
-
{
|
39 |
-
return 'application/vnd.oasis.opendocument.spreadsheet';
|
40 |
-
}
|
41 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel
|
5 |
+
*
|
6 |
+
* PHPExcel_Writer_OpenDocument_Mimetype
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Writer_OpenDocument
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Writer_OpenDocument_Mimetype extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Write mimetype to plain text format
|
32 |
+
*
|
33 |
+
* @param PHPExcel $pPHPExcel
|
34 |
+
* @return string XML Output
|
35 |
+
* @throws PHPExcel_Writer_Exception
|
36 |
+
*/
|
37 |
+
public function write(PHPExcel $pPHPExcel = null)
|
38 |
+
{
|
39 |
+
return 'application/vnd.oasis.opendocument.spreadsheet';
|
40 |
+
}
|
41 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Settings.php
CHANGED
@@ -1,76 +1,76 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Writer_OpenDocument_Settings
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Writer_OpenDocument
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Writer_OpenDocument_Settings extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Write settings.xml to XML format
|
32 |
-
*
|
33 |
-
* @param PHPExcel $pPHPExcel
|
34 |
-
* @return string XML Output
|
35 |
-
* @throws PHPExcel_Writer_Exception
|
36 |
-
*/
|
37 |
-
public function write(PHPExcel $pPHPExcel = null)
|
38 |
-
{
|
39 |
-
if (!$pPHPExcel) {
|
40 |
-
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
41 |
-
}
|
42 |
-
|
43 |
-
$objWriter = null;
|
44 |
-
if ($this->getParentWriter()->getUseDiskCaching()) {
|
45 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
46 |
-
} else {
|
47 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
48 |
-
}
|
49 |
-
|
50 |
-
// XML header
|
51 |
-
$objWriter->startDocument('1.0', 'UTF-8');
|
52 |
-
|
53 |
-
// Settings
|
54 |
-
$objWriter->startElement('office:document-settings');
|
55 |
-
$objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
|
56 |
-
$objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
57 |
-
$objWriter->writeAttribute('xmlns:config', 'urn:oasis:names:tc:opendocument:xmlns:config:1.0');
|
58 |
-
$objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
|
59 |
-
$objWriter->writeAttribute('office:version', '1.2');
|
60 |
-
|
61 |
-
$objWriter->startElement('office:settings');
|
62 |
-
$objWriter->startElement('config:config-item-set');
|
63 |
-
$objWriter->writeAttribute('config:name', 'ooo:view-settings');
|
64 |
-
$objWriter->startElement('config:config-item-map-indexed');
|
65 |
-
$objWriter->writeAttribute('config:name', 'Views');
|
66 |
-
$objWriter->endElement();
|
67 |
-
$objWriter->endElement();
|
68 |
-
$objWriter->startElement('config:config-item-set');
|
69 |
-
$objWriter->writeAttribute('config:name', 'ooo:configuration-settings');
|
70 |
-
$objWriter->endElement();
|
71 |
-
$objWriter->endElement();
|
72 |
-
$objWriter->endElement();
|
73 |
-
|
74 |
-
return $objWriter->getData();
|
75 |
-
}
|
76 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Writer_OpenDocument_Settings
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Writer_OpenDocument
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Writer_OpenDocument_Settings extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Write settings.xml to XML format
|
32 |
+
*
|
33 |
+
* @param PHPExcel $pPHPExcel
|
34 |
+
* @return string XML Output
|
35 |
+
* @throws PHPExcel_Writer_Exception
|
36 |
+
*/
|
37 |
+
public function write(PHPExcel $pPHPExcel = null)
|
38 |
+
{
|
39 |
+
if (!$pPHPExcel) {
|
40 |
+
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
41 |
+
}
|
42 |
+
|
43 |
+
$objWriter = null;
|
44 |
+
if ($this->getParentWriter()->getUseDiskCaching()) {
|
45 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
46 |
+
} else {
|
47 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
48 |
+
}
|
49 |
+
|
50 |
+
// XML header
|
51 |
+
$objWriter->startDocument('1.0', 'UTF-8');
|
52 |
+
|
53 |
+
// Settings
|
54 |
+
$objWriter->startElement('office:document-settings');
|
55 |
+
$objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
|
56 |
+
$objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
57 |
+
$objWriter->writeAttribute('xmlns:config', 'urn:oasis:names:tc:opendocument:xmlns:config:1.0');
|
58 |
+
$objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
|
59 |
+
$objWriter->writeAttribute('office:version', '1.2');
|
60 |
+
|
61 |
+
$objWriter->startElement('office:settings');
|
62 |
+
$objWriter->startElement('config:config-item-set');
|
63 |
+
$objWriter->writeAttribute('config:name', 'ooo:view-settings');
|
64 |
+
$objWriter->startElement('config:config-item-map-indexed');
|
65 |
+
$objWriter->writeAttribute('config:name', 'Views');
|
66 |
+
$objWriter->endElement();
|
67 |
+
$objWriter->endElement();
|
68 |
+
$objWriter->startElement('config:config-item-set');
|
69 |
+
$objWriter->writeAttribute('config:name', 'ooo:configuration-settings');
|
70 |
+
$objWriter->endElement();
|
71 |
+
$objWriter->endElement();
|
72 |
+
$objWriter->endElement();
|
73 |
+
|
74 |
+
return $objWriter->getData();
|
75 |
+
}
|
76 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Styles.php
CHANGED
@@ -1,92 +1,92 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Writer_OpenDocument_Styles
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Writer_OpenDocument
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Writer_OpenDocument_Styles extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Write styles.xml to XML format
|
32 |
-
*
|
33 |
-
* @param PHPExcel $pPHPExcel
|
34 |
-
* @return string XML Output
|
35 |
-
* @throws PHPExcel_Writer_Exception
|
36 |
-
*/
|
37 |
-
public function write(PHPExcel $pPHPExcel = null)
|
38 |
-
{
|
39 |
-
if (!$pPHPExcel) {
|
40 |
-
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
41 |
-
}
|
42 |
-
|
43 |
-
$objWriter = null;
|
44 |
-
if ($this->getParentWriter()->getUseDiskCaching()) {
|
45 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
46 |
-
} else {
|
47 |
-
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
48 |
-
}
|
49 |
-
|
50 |
-
// XML header
|
51 |
-
$objWriter->startDocument('1.0', 'UTF-8');
|
52 |
-
|
53 |
-
// Content
|
54 |
-
$objWriter->startElement('office:document-styles');
|
55 |
-
$objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
|
56 |
-
$objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
|
57 |
-
$objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
|
58 |
-
$objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
|
59 |
-
$objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
|
60 |
-
$objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
|
61 |
-
$objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
62 |
-
$objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
|
63 |
-
$objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
|
64 |
-
$objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
|
65 |
-
$objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
|
66 |
-
$objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
|
67 |
-
$objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
|
68 |
-
$objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
|
69 |
-
$objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
|
70 |
-
$objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
|
71 |
-
$objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
|
72 |
-
$objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
|
73 |
-
$objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
|
74 |
-
$objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
|
75 |
-
$objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
|
76 |
-
$objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
|
77 |
-
$objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
|
78 |
-
$objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
|
79 |
-
$objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
|
80 |
-
$objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
|
81 |
-
$objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
|
82 |
-
$objWriter->writeAttribute('office:version', '1.2');
|
83 |
-
|
84 |
-
$objWriter->writeElement('office:font-face-decls');
|
85 |
-
$objWriter->writeElement('office:styles');
|
86 |
-
$objWriter->writeElement('office:automatic-styles');
|
87 |
-
$objWriter->writeElement('office:master-styles');
|
88 |
-
$objWriter->endElement();
|
89 |
-
|
90 |
-
return $objWriter->getData();
|
91 |
-
}
|
92 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Writer_OpenDocument_Styles
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Writer_OpenDocument
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Writer_OpenDocument_Styles extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Write styles.xml to XML format
|
32 |
+
*
|
33 |
+
* @param PHPExcel $pPHPExcel
|
34 |
+
* @return string XML Output
|
35 |
+
* @throws PHPExcel_Writer_Exception
|
36 |
+
*/
|
37 |
+
public function write(PHPExcel $pPHPExcel = null)
|
38 |
+
{
|
39 |
+
if (!$pPHPExcel) {
|
40 |
+
$pPHPExcel = $this->getParentWriter()->getPHPExcel();
|
41 |
+
}
|
42 |
+
|
43 |
+
$objWriter = null;
|
44 |
+
if ($this->getParentWriter()->getUseDiskCaching()) {
|
45 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
|
46 |
+
} else {
|
47 |
+
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
|
48 |
+
}
|
49 |
+
|
50 |
+
// XML header
|
51 |
+
$objWriter->startDocument('1.0', 'UTF-8');
|
52 |
+
|
53 |
+
// Content
|
54 |
+
$objWriter->startElement('office:document-styles');
|
55 |
+
$objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
|
56 |
+
$objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
|
57 |
+
$objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
|
58 |
+
$objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
|
59 |
+
$objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
|
60 |
+
$objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
|
61 |
+
$objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
62 |
+
$objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
|
63 |
+
$objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
|
64 |
+
$objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
|
65 |
+
$objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
|
66 |
+
$objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
|
67 |
+
$objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
|
68 |
+
$objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
|
69 |
+
$objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
|
70 |
+
$objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
|
71 |
+
$objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
|
72 |
+
$objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
|
73 |
+
$objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
|
74 |
+
$objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
|
75 |
+
$objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
|
76 |
+
$objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
|
77 |
+
$objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
|
78 |
+
$objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
|
79 |
+
$objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
|
80 |
+
$objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
|
81 |
+
$objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
|
82 |
+
$objWriter->writeAttribute('office:version', '1.2');
|
83 |
+
|
84 |
+
$objWriter->writeElement('office:font-face-decls');
|
85 |
+
$objWriter->writeElement('office:styles');
|
86 |
+
$objWriter->writeElement('office:automatic-styles');
|
87 |
+
$objWriter->writeElement('office:master-styles');
|
88 |
+
$objWriter->endElement();
|
89 |
+
|
90 |
+
return $objWriter->getData();
|
91 |
+
}
|
92 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Thumbnails.php
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Writer_OpenDocument_Thumbnails
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Writer_OpenDocument
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
class PHPExcel_Writer_OpenDocument_Thumbnails extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Write Thumbnails/thumbnail.png to PNG format
|
32 |
-
*
|
33 |
-
* @param PHPExcel $pPHPExcel
|
34 |
-
* @return string XML Output
|
35 |
-
* @throws PHPExcel_Writer_Exception
|
36 |
-
*/
|
37 |
-
public function writeThumbnail(PHPExcel $pPHPExcel = null)
|
38 |
-
{
|
39 |
-
return '';
|
40 |
-
}
|
41 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Writer_OpenDocument_Thumbnails
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Writer_OpenDocument
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
class PHPExcel_Writer_OpenDocument_Thumbnails extends PHPExcel_Writer_OpenDocument_WriterPart
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* Write Thumbnails/thumbnail.png to PNG format
|
32 |
+
*
|
33 |
+
* @param PHPExcel $pPHPExcel
|
34 |
+
* @return string XML Output
|
35 |
+
* @throws PHPExcel_Writer_Exception
|
36 |
+
*/
|
37 |
+
public function writeThumbnail(PHPExcel $pPHPExcel = null)
|
38 |
+
{
|
39 |
+
return '';
|
40 |
+
}
|
41 |
+
}
|
PHPExcel/Classes/PHPExcel/Writer/OpenDocument/WriterPart.php
CHANGED
@@ -1,30 +1,30 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* PHPExcel_Writer_OpenDocument_WriterPart
|
5 |
-
*
|
6 |
-
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
-
*
|
8 |
-
* This library is free software; you can redistribute it and/or
|
9 |
-
* modify it under the terms of the GNU Lesser General Public
|
10 |
-
* License as published by the Free Software Foundation; either
|
11 |
-
* version 2.1 of the License, or (at your option) any later version.
|
12 |
-
*
|
13 |
-
* This library is distributed in the hope that it will be useful,
|
14 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
-
* Lesser General Public License for more details.
|
17 |
-
*
|
18 |
-
* You should have received a copy of the GNU Lesser General Public
|
19 |
-
* License along with this library; if not, write to the Free Software
|
20 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
-
*
|
22 |
-
* @category PHPExcel
|
23 |
-
* @package PHPExcel_Writer_OpenDocument
|
24 |
-
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
-
* @version ##VERSION##, ##DATE##
|
27 |
-
*/
|
28 |
-
abstract class PHPExcel_Writer_OpenDocument_WriterPart extends PHPExcel_Writer_Excel2007_WriterPart
|
29 |
-
{
|
30 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* PHPExcel_Writer_OpenDocument_WriterPart
|
5 |
+
*
|
6 |
+
* Copyright (c) 2006 - 2015 PHPExcel
|
7 |
+
*
|
8 |
+
* This library is free software; you can redistribute it and/or
|
9 |
+
* modify it under the terms of the GNU Lesser General Public
|
10 |
+
* License as published by the Free Software Foundation; either
|
11 |
+
* version 2.1 of the License, or (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This library is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16 |
+
* Lesser General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU Lesser General Public
|
19 |
+
* License along with this library; if not, write to the Free Software
|
20 |
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
21 |
+
*
|
22 |
+
* @category PHPExcel
|
23 |
+
* @package PHPExcel_Writer_OpenDocument
|
24 |
+
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
25 |
+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
26 |
+
* @version ##VERSION##, ##DATE##
|
27 |
+
*/
|
28 |
+
abstract class PHPExcel_Writer_OpenDocument_WriterPart extends PHPExcel_Writer_Excel2007_WriterPart
|
29 |
+
{
|
30 |
+
}
|
PHPExcel/Classes/PHPExcel/locale/bg/config
CHANGED
@@ -1,49 +1,49 @@
|
|
1 |
-
##
|
2 |
-
## PHPExcel
|
3 |
-
##
|
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_Settings
|
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 |
-
ArgumentSeparator = ;
|
31 |
-
|
32 |
-
|
33 |
-
##
|
34 |
-
## (For future use)
|
35 |
-
##
|
36 |
-
currencySymbol = лв
|
37 |
-
|
38 |
-
|
39 |
-
##
|
40 |
-
## Excel Error Codes (For future use)
|
41 |
-
|
42 |
-
##
|
43 |
-
NULL = #ПРАЗНО!
|
44 |
-
DIV0 = #ДЕЛ/0!
|
45 |
-
VALUE = #СТОЙНОСТ!
|
46 |
-
REF = #РЕФ!
|
47 |
-
NAME = #ИМЕ?
|
48 |
-
NUM = #ЧИСЛО!
|
49 |
-
NA = #Н/Д
|
1 |
+
##
|
2 |
+
## PHPExcel
|
3 |
+
##
|
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_Settings
|
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 |
+
ArgumentSeparator = ;
|
31 |
+
|
32 |
+
|
33 |
+
##
|
34 |
+
## (For future use)
|
35 |
+
##
|
36 |
+
currencySymbol = лв
|
37 |
+
|
38 |
+
|
39 |
+
##
|
40 |
+
## Excel Error Codes (For future use)
|
41 |
+
|
42 |
+
##
|
43 |
+
NULL = #ПРАЗНО!
|
44 |
+
DIV0 = #ДЕЛ/0!
|
45 |
+
VALUE = #СТОЙНОСТ!
|
46 |
+
REF = #РЕФ!
|
47 |
+
NAME = #ИМЕ?
|
48 |
+
NUM = #ЧИСЛО!
|
49 |
+
NA = #Н/Д
|
PHPExcel/Classes/PHPExcel/locale/da/config
CHANGED
@@ -32,7 +32,7 @@ ArgumentSeparator = ;
|
|
32 |
##
|
33 |
## (For future use)
|
34 |
##
|
35 |
-
currencySymbol = kr
|
36 |
|
37 |
|
38 |
|
32 |
##
|
33 |
## (For future use)
|
34 |
##
|
35 |
+
currencySymbol = kr
|
36 |
|
37 |
|
38 |
|
css/Admin.css
CHANGED
@@ -132,6 +132,8 @@ FLEXBOX STYLING
|
|
132 |
.ufaq-option-set h3,
|
133 |
.ufaq-styling-set h3 {
|
134 |
padding-top:10px;
|
|
|
|
|
135 |
}
|
136 |
.ufaq-options-table th {
|
137 |
padding:15px 5px;
|
@@ -779,3 +781,56 @@ WOOCOMMERCE PRODUCT FAQ AREA
|
|
779 |
.ewd-ufaq-delete-faq-button:hover, .ewd-ufaq-add-faq-button:hover {
|
780 |
background: #ccc;
|
781 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
.ufaq-option-set h3,
|
133 |
.ufaq-styling-set h3 {
|
134 |
padding-top:10px;
|
135 |
+
padding-bottom: 5px;
|
136 |
+
border-bottom: 2px solid #eee;
|
137 |
}
|
138 |
.ufaq-options-table th {
|
139 |
padding:15px 5px;
|
781 |
.ewd-ufaq-delete-faq-button:hover, .ewd-ufaq-add-faq-button:hover {
|
782 |
background: #ccc;
|
783 |
}
|
784 |
+
|
785 |
+
|
786 |
+
/*************************************************
|
787 |
+
SHORTCODE REMINDER IN BASIC AREA OF OPTIONS TAB
|
788 |
+
*************************************************/
|
789 |
+
.ewd-ufaq-shortcode-reminder {
|
790 |
+
position: relative;
|
791 |
+
float: left;
|
792 |
+
width: 100%;
|
793 |
+
height: 85px;
|
794 |
+
background: #fafafa;
|
795 |
+
margin: -12px 0 24px;
|
796 |
+
}
|
797 |
+
.ewd-ufaq-shortcode-reminder-message {
|
798 |
+
position: relative;
|
799 |
+
float: left;
|
800 |
+
width: 15%;
|
801 |
+
height: 41px;
|
802 |
+
padding: 32px 2.5% 12px;
|
803 |
+
background: #f4f4f4;
|
804 |
+
text-align: center;
|
805 |
+
font-weight: bold;
|
806 |
+
}
|
807 |
+
.ewd-ufaq-shortcode-reminder-display {
|
808 |
+
position: relative;
|
809 |
+
float: left;
|
810 |
+
width: 75%;
|
811 |
+
height: 18px;
|
812 |
+
padding: 12px 2.5%;
|
813 |
+
border-bottom: 1px solid #e8e8e8;
|
814 |
+
}
|
815 |
+
.ewd-ufaq-shortcode-reminder-submit {
|
816 |
+
position: relative;
|
817 |
+
float: left;
|
818 |
+
width: 75%;
|
819 |
+
height: 18px;
|
820 |
+
padding: 12px 2.5%;
|
821 |
+
}
|
822 |
+
@media screen and (max-width: 1350px) {
|
823 |
+
.ewd-ufaq-shortcode-reminder {
|
824 |
+
height: 121px;
|
825 |
+
}
|
826 |
+
.ewd-ufaq-shortcode-reminder-message {
|
827 |
+
height: 59px;
|
828 |
+
padding: 50px 2.5% 12px;
|
829 |
+
}
|
830 |
+
.ewd-ufaq-shortcode-reminder-display {
|
831 |
+
height: 36px;
|
832 |
+
}
|
833 |
+
.ewd-ufaq-shortcode-reminder-submit {
|
834 |
+
height: 36px;
|
835 |
+
}
|
836 |
+
}
|
html/OptionsPage.php
CHANGED
@@ -120,6 +120,16 @@
|
|
120 |
<form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Options&Action=EWD_UFAQ_UpdateOptions">
|
121 |
<div id='Basic' class='ufaq-option-set'>
|
122 |
<h2 id='label-basic-options' class='ufaq-options-page-tab-title'>Basic Options</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
<table class="form-table">
|
124 |
<tr>
|
125 |
<th scope="row">Custom CSS</th>
|
@@ -131,6 +141,62 @@
|
|
131 |
</td>
|
132 |
</tr>
|
133 |
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
<th scope="row">FAQ Toggle</th>
|
135 |
<td>
|
136 |
<fieldset><legend class="screen-reader-text"><span>FAQ Toggle</span></legend>
|
@@ -170,7 +236,12 @@
|
|
170 |
</fieldset>
|
171 |
</td>
|
172 |
</tr>
|
|
|
173 |
|
|
|
|
|
|
|
|
|
174 |
<tr>
|
175 |
<th scope="row">Hide Categories</th>
|
176 |
<td>
|
@@ -193,16 +264,6 @@
|
|
193 |
</td>
|
194 |
</tr>
|
195 |
<tr>
|
196 |
-
<th scope="row">Scroll To Top</th>
|
197 |
-
<td>
|
198 |
-
<fieldset><legend class="screen-reader-text"><span>Scroll To Top</span></legend>
|
199 |
-
<label title='Yes'><input type='radio' name='scroll_to_top' value='Yes' <?php if($Scroll_To_Top == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
200 |
-
<label title='No'><input type='radio' name='scroll_to_top' value='No' <?php if($Scroll_To_Top == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
201 |
-
<p>Should the browser scroll to the top of the FAQ when it's opened?</p>
|
202 |
-
</fieldset>
|
203 |
-
</td>
|
204 |
-
</tr>
|
205 |
-
<tr>
|
206 |
<th scope="row">Display All Answers</th>
|
207 |
<td>
|
208 |
<fieldset><legend class="screen-reader-text"><span>Display All Answers</span></legend>
|
@@ -242,51 +303,13 @@
|
|
242 |
</fieldset>
|
243 |
</td>
|
244 |
</tr>
|
245 |
-
<tr>
|
246 |
-
<th scope="row">Include Permalink Icon</th>
|
247 |
-
<td>
|
248 |
-
<fieldset><legend class="screen-reader-text"><span>Include Permalink Icon</span></legend>
|
249 |
-
<label title='Yes'><input type='radio' name='include_permalink' value='Yes' <?php if($Include_Permalink == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
250 |
-
<label title='No'><input type='radio' name='include_permalink' value='No' <?php if($Include_Permalink == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
251 |
-
<p>Should an icon to link directly to each question be displayed?</p>
|
252 |
-
</fieldset>
|
253 |
-
</td>
|
254 |
-
</tr>
|
255 |
-
<tr>
|
256 |
-
<th scope="row">Permalink Type</th>
|
257 |
-
<td>
|
258 |
-
<fieldset><legend class="screen-reader-text"><span>Include Permalink Icon</span></legend>
|
259 |
-
<label title='SamePage'><input type='radio' name='permalink_type' value='SamePage' <?php if($Permalink_Type == "SamePage") {echo "checked='checked'";} ?> /> <span>Main FAQ Page</span></label><br />
|
260 |
-
<label title='IndividualPage'><input type='radio' name='permalink_type' value='IndividualPage' <?php if($Permalink_Type == "IndividualPage") {echo "checked='checked'";} ?> /> <span>Individual FAQ Page</span></label><br />
|
261 |
-
<p>Should the permalink icon link to the main FAQ page, or to the individual FAQ post?</p>
|
262 |
-
</fieldset>
|
263 |
-
</td>
|
264 |
-
</tr>
|
265 |
-
<tr>
|
266 |
-
<th scope="row">Show Editor Helper</th>
|
267 |
-
<td>
|
268 |
-
<fieldset><legend class="screen-reader-text"><span>Show Editor Helper</span></legend>
|
269 |
-
<label title='Yes'><input type='radio' name='show_tinymce' value='Yes' <?php if($Show_TinyMCE == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
270 |
-
<label title='No'><input type='radio' name='show_tinymce' value='No' <?php if($Show_TinyMCE == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
271 |
-
<p>Should the shortcode builder be shown above the WordPress page/post editor, in the toolbar buttons?</p>
|
272 |
-
</fieldset>
|
273 |
-
</td>
|
274 |
-
</tr>
|
275 |
-
<tr>
|
276 |
-
<th scope="row">Turn On Comment Support</th>
|
277 |
-
<td>
|
278 |
-
<fieldset><legend class="screen-reader-text"><span>Turn On Comment Support</span></legend>
|
279 |
-
<label title='Yes'><input type='radio' name='comments_on' value='Yes' <?php if($Comments_On == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
280 |
-
<label title='No'><input type='radio' name='comments_on' value='No' <?php if($Comments_On == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
281 |
-
<p>Should comment support be turned on, so that if the "Allow Comments" checkbox is selected for a given FAQ, comments are shown in the FAQ list?</p>
|
282 |
-
</fieldset>
|
283 |
-
</td>
|
284 |
-
</tr>
|
285 |
</table>
|
286 |
</div>
|
287 |
|
288 |
<div id='Premium' class='ufaq-option-set ufaq-hidden'>
|
289 |
<h2 id='label-premium-options' class='ufaq-options-page-tab-title'>Premium Options</h2>
|
|
|
|
|
290 |
<table class="form-table">
|
291 |
<tr>
|
292 |
<th scope="row">FAQ Display Style</th>
|
@@ -313,36 +336,6 @@
|
|
313 |
</td>
|
314 |
</tr>
|
315 |
<tr>
|
316 |
-
<th scope="row">FAQ Ratings</th>
|
317 |
-
<td>
|
318 |
-
<fieldset><legend class="screen-reader-text"><span>FAQ Ratings</span></legend>
|
319 |
-
<label title='Yes'><input type='radio' name='faq_ratings' value='Yes' <?php if($FAQ_Ratings == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
320 |
-
<label title='No'><input type='radio' name='faq_ratings' value='No' <?php if($FAQ_Ratings == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
321 |
-
<p>Should visitors be able to up or down vote FAQs to let others know if they found them helpful?</p>
|
322 |
-
</fieldset>
|
323 |
-
</td>
|
324 |
-
</tr>
|
325 |
-
<tr>
|
326 |
-
<th scope="row">WooCommerce FAQs</th>
|
327 |
-
<td>
|
328 |
-
<fieldset><legend class="screen-reader-text"><span>WooCommerce FAQs</span></legend>
|
329 |
-
<label title='Yes'><input type='radio' name='woocommerce_faqs' value='Yes' <?php if($WooCommerce_FAQs == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
330 |
-
<label title='No'><input type='radio' name='woocommerce_faqs' value='No' <?php if($WooCommerce_FAQs == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
331 |
-
<p>Should FAQs for a given product be displayed as an extra tab on the WooCommerce product page?<br/> For this to work correctly, an FAQ category needs to be created with the same name as a given WooCommerce product.</p>
|
332 |
-
</fieldset>
|
333 |
-
</td>
|
334 |
-
</tr>
|
335 |
-
<tr>
|
336 |
-
<th scope="row">Use WooCommerce Product Object</th>
|
337 |
-
<td>
|
338 |
-
<fieldset><legend class="screen-reader-text"><span>Use WooCommerce Product Object</span></legend>
|
339 |
-
<label title='Yes'><input type='radio' name='use_product' value='Yes' <?php if($Use_Product == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
340 |
-
<label title='No'><input type='radio' name='use_product' value='No' <?php if($Use_Product == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
341 |
-
<p>Should the FAQ tab be set up using the WooCommerce product object, as in the WC documentation, or just using the ID of the page?</p>
|
342 |
-
</fieldset>
|
343 |
-
</td>
|
344 |
-
</tr>
|
345 |
-
<tr>
|
346 |
<th scope="row">Reveal Effect</th>
|
347 |
<td>
|
348 |
<fieldset><legend class="screen-reader-text"><span>Reveal Effect</span></legend>
|
@@ -369,33 +362,29 @@
|
|
369 |
</fieldset>
|
370 |
</td>
|
371 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
<tr>
|
373 |
-
<th scope="row">
|
374 |
-
<td>
|
375 |
-
<fieldset><legend class="screen-reader-text"><span>Pretty Permalinks</span></legend>
|
376 |
-
<label title='Yes'><input type='radio' name='pretty_permalinks' value='Yes' <?php if($Pretty_Permalinks == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
377 |
-
<label title='No'><input type='radio' name='pretty_permalinks' value='No' <?php if($Pretty_Permalinks == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
378 |
-
<p>Should an SEO friendly permalink structure be used for the link to this FAQ?</p>
|
379 |
-
</fieldset>
|
380 |
-
</td>
|
381 |
-
</tr>
|
382 |
-
<tr>
|
383 |
-
<th scope="row">Allow Proposed Answer</th>
|
384 |
<td>
|
385 |
-
<fieldset><legend class="screen-reader-text"><span>
|
386 |
-
<label title='Yes'><input type='radio' name='
|
387 |
-
<label title='No'><input type='radio' name='
|
388 |
-
<p>
|
389 |
</fieldset>
|
390 |
</td>
|
391 |
</tr>
|
392 |
<tr>
|
393 |
-
<th scope="row">
|
394 |
<td>
|
395 |
-
<fieldset><legend class="screen-reader-text"><span>
|
396 |
-
<label title='Yes'><input type='radio' name='
|
397 |
-
<label title='No'><input type='radio' name='
|
398 |
-
<p>Should an
|
399 |
</fieldset>
|
400 |
</td>
|
401 |
</tr>
|
@@ -433,6 +422,58 @@
|
|
433 |
</td>
|
434 |
</tr>
|
435 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
</div>
|
437 |
|
438 |
<div id='Order' class='ufaq-option-set ufaq-hidden'>
|
120 |
<form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Options&Action=EWD_UFAQ_UpdateOptions">
|
121 |
<div id='Basic' class='ufaq-option-set'>
|
122 |
<h2 id='label-basic-options' class='ufaq-options-page-tab-title'>Basic Options</h2>
|
123 |
+
<br />
|
124 |
+
|
125 |
+
<div class="ewd-ufaq-shortcode-reminder">
|
126 |
+
<div class="ewd-ufaq-shortcode-reminder-message">REMINDER</div>
|
127 |
+
<div class="ewd-ufaq-shortcode-reminder-display">To display reviews, place the <strong>[ultimate-faqs]</strong> shortcode on a page</div>
|
128 |
+
<div class="ewd-ufaq-shortcode-reminder-submit">To allow visitors to submit an FAQ, place the <strong>[submit-question]</strong> shortcode on a page</div>
|
129 |
+
</div>
|
130 |
+
|
131 |
+
<br />
|
132 |
+
<h3 id="general-options" class="ufaq-options-page-tab-title"><?php _e('General', 'EWD_UFAQ'); ?></h3>
|
133 |
<table class="form-table">
|
134 |
<tr>
|
135 |
<th scope="row">Custom CSS</th>
|
141 |
</td>
|
142 |
</tr>
|
143 |
<tr>
|
144 |
+
<th scope="row">Scroll To Top</th>
|
145 |
+
<td>
|
146 |
+
<fieldset><legend class="screen-reader-text"><span>Scroll To Top</span></legend>
|
147 |
+
<label title='Yes'><input type='radio' name='scroll_to_top' value='Yes' <?php if($Scroll_To_Top == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
148 |
+
<label title='No'><input type='radio' name='scroll_to_top' value='No' <?php if($Scroll_To_Top == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
149 |
+
<p>Should the browser scroll to the top of the FAQ when it's opened?</p>
|
150 |
+
</fieldset>
|
151 |
+
</td>
|
152 |
+
</tr>
|
153 |
+
<tr>
|
154 |
+
<th scope="row">Show Editor Helper</th>
|
155 |
+
<td>
|
156 |
+
<fieldset><legend class="screen-reader-text"><span>Show Editor Helper</span></legend>
|
157 |
+
<label title='Yes'><input type='radio' name='show_tinymce' value='Yes' <?php if($Show_TinyMCE == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
158 |
+
<label title='No'><input type='radio' name='show_tinymce' value='No' <?php if($Show_TinyMCE == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
159 |
+
<p>Should the shortcode builder be shown above the WordPress page/post editor, in the toolbar buttons?</p>
|
160 |
+
</fieldset>
|
161 |
+
</td>
|
162 |
+
</tr>
|
163 |
+
<tr>
|
164 |
+
<th scope="row">Turn On Comment Support</th>
|
165 |
+
<td>
|
166 |
+
<fieldset><legend class="screen-reader-text"><span>Turn On Comment Support</span></legend>
|
167 |
+
<label title='Yes'><input type='radio' name='comments_on' value='Yes' <?php if($Comments_On == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
168 |
+
<label title='No'><input type='radio' name='comments_on' value='No' <?php if($Comments_On == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
169 |
+
<p>Should comment support be turned on, so that if the "Allow Comments" checkbox is selected for a given FAQ, comments are shown in the FAQ list?</p>
|
170 |
+
</fieldset>
|
171 |
+
</td>
|
172 |
+
</tr>
|
173 |
+
<tr>
|
174 |
+
<th scope="row">Include Permalink Icon</th>
|
175 |
+
<td>
|
176 |
+
<fieldset><legend class="screen-reader-text"><span>Include Permalink Icon</span></legend>
|
177 |
+
<label title='Yes'><input type='radio' name='include_permalink' value='Yes' <?php if($Include_Permalink == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
178 |
+
<label title='No'><input type='radio' name='include_permalink' value='No' <?php if($Include_Permalink == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
179 |
+
<p>Should an icon to link directly to each question be displayed?</p>
|
180 |
+
</fieldset>
|
181 |
+
</td>
|
182 |
+
</tr>
|
183 |
+
<tr>
|
184 |
+
<th scope="row">Permalink Type</th>
|
185 |
+
<td>
|
186 |
+
<fieldset><legend class="screen-reader-text"><span>Include Permalink Icon</span></legend>
|
187 |
+
<label title='SamePage'><input type='radio' name='permalink_type' value='SamePage' <?php if($Permalink_Type == "SamePage") {echo "checked='checked'";} ?> /> <span>Main FAQ Page</span></label><br />
|
188 |
+
<label title='IndividualPage'><input type='radio' name='permalink_type' value='IndividualPage' <?php if($Permalink_Type == "IndividualPage") {echo "checked='checked'";} ?> /> <span>Individual FAQ Page</span></label><br />
|
189 |
+
<p>Should the permalink icon link to the main FAQ page, or to the individual FAQ post?</p>
|
190 |
+
</fieldset>
|
191 |
+
</td>
|
192 |
+
</tr>
|
193 |
+
</table>
|
194 |
+
|
195 |
+
<br />
|
196 |
+
<h3 id="functionality-options" class="ufaq-options-page-tab-title"><?php _e('Functionality', 'EWD_UFAQ'); ?></h3>
|
197 |
+
|
198 |
+
<table class="form-table">
|
199 |
+
<tr>
|
200 |
<th scope="row">FAQ Toggle</th>
|
201 |
<td>
|
202 |
<fieldset><legend class="screen-reader-text"><span>FAQ Toggle</span></legend>
|
236 |
</fieldset>
|
237 |
</td>
|
238 |
</tr>
|
239 |
+
</table>
|
240 |
|
241 |
+
<br />
|
242 |
+
<h3 id="display-options" class="ufaq-options-page-tab-title"><?php _e('Display', 'EWD_UFAQ'); ?></h3>
|
243 |
+
|
244 |
+
<table class="form-table">
|
245 |
<tr>
|
246 |
<th scope="row">Hide Categories</th>
|
247 |
<td>
|
264 |
</td>
|
265 |
</tr>
|
266 |
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
<th scope="row">Display All Answers</th>
|
268 |
<td>
|
269 |
<fieldset><legend class="screen-reader-text"><span>Display All Answers</span></legend>
|
303 |
</fieldset>
|
304 |
</td>
|
305 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
</table>
|
307 |
</div>
|
308 |
|
309 |
<div id='Premium' class='ufaq-option-set ufaq-hidden'>
|
310 |
<h2 id='label-premium-options' class='ufaq-options-page-tab-title'>Premium Options</h2>
|
311 |
+
<br />
|
312 |
+
<h3 id="premium-display-options" class="ufaq-options-page-tab-title"><?php _e('Display', 'EWD_UFAQ'); ?></h3>
|
313 |
<table class="form-table">
|
314 |
<tr>
|
315 |
<th scope="row">FAQ Display Style</th>
|
336 |
</td>
|
337 |
</tr>
|
338 |
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
<th scope="row">Reveal Effect</th>
|
340 |
<td>
|
341 |
<fieldset><legend class="screen-reader-text"><span>Reveal Effect</span></legend>
|
362 |
</fieldset>
|
363 |
</td>
|
364 |
</tr>
|
365 |
+
</table>
|
366 |
+
|
367 |
+
<br />
|
368 |
+
<h3 id="premium-general-options" class="ufaq-options-page-tab-title"><?php _e('General', 'EWD_UFAQ'); ?></h3>
|
369 |
+
|
370 |
+
<table class="form-table">
|
371 |
<tr>
|
372 |
+
<th scope="row">FAQ Ratings</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
<td>
|
374 |
+
<fieldset><legend class="screen-reader-text"><span>FAQ Ratings</span></legend>
|
375 |
+
<label title='Yes'><input type='radio' name='faq_ratings' value='Yes' <?php if($FAQ_Ratings == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
376 |
+
<label title='No'><input type='radio' name='faq_ratings' value='No' <?php if($FAQ_Ratings == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
377 |
+
<p>Should visitors be able to up or down vote FAQs to let others know if they found them helpful?</p>
|
378 |
</fieldset>
|
379 |
</td>
|
380 |
</tr>
|
381 |
<tr>
|
382 |
+
<th scope="row">Pretty Permalinks</th>
|
383 |
<td>
|
384 |
+
<fieldset><legend class="screen-reader-text"><span>Pretty Permalinks</span></legend>
|
385 |
+
<label title='Yes'><input type='radio' name='pretty_permalinks' value='Yes' <?php if($Pretty_Permalinks == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
386 |
+
<label title='No'><input type='radio' name='pretty_permalinks' value='No' <?php if($Pretty_Permalinks == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
387 |
+
<p>Should an SEO friendly permalink structure be used for the link to this FAQ?</p>
|
388 |
</fieldset>
|
389 |
</td>
|
390 |
</tr>
|
422 |
</td>
|
423 |
</tr>
|
424 |
</table>
|
425 |
+
|
426 |
+
<br />
|
427 |
+
<h3 id="premium-woocommerce-options" class="ufaq-options-page-tab-title"><?php _e('WooCommerce', 'EWD_UFAQ'); ?></h3>
|
428 |
+
|
429 |
+
<table class="form-table">
|
430 |
+
<tr>
|
431 |
+
<th scope="row">WooCommerce FAQs</th>
|
432 |
+
<td>
|
433 |
+
<fieldset><legend class="screen-reader-text"><span>WooCommerce FAQs</span></legend>
|
434 |
+
<label title='Yes'><input type='radio' name='woocommerce_faqs' value='Yes' <?php if($WooCommerce_FAQs == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
435 |
+
<label title='No'><input type='radio' name='woocommerce_faqs' value='No' <?php if($WooCommerce_FAQs == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
436 |
+
<p>Should FAQs for a given product be displayed as an extra tab on the WooCommerce product page?<br/> For this to work correctly, an FAQ category needs to be created with the same name as a given WooCommerce product.</p>
|
437 |
+
</fieldset>
|
438 |
+
</td>
|
439 |
+
</tr>
|
440 |
+
<tr>
|
441 |
+
<th scope="row">Use WooCommerce Product Object</th>
|
442 |
+
<td>
|
443 |
+
<fieldset><legend class="screen-reader-text"><span>Use WooCommerce Product Object</span></legend>
|
444 |
+
<label title='Yes'><input type='radio' name='use_product' value='Yes' <?php if($Use_Product == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
445 |
+
<label title='No'><input type='radio' name='use_product' value='No' <?php if($Use_Product == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
446 |
+
<p>Should the FAQ tab be set up using the WooCommerce product object, as in the WC documentation, or just using the ID of the page?</p>
|
447 |
+
</fieldset>
|
448 |
+
</td>
|
449 |
+
</tr>
|
450 |
+
</table>
|
451 |
+
|
452 |
+
<br />
|
453 |
+
<h3 id="premium-submit-faq-options" class="ufaq-options-page-tab-title"><?php _e('Submit FAQ', 'EWD_UFAQ'); ?></h3>
|
454 |
+
|
455 |
+
<table class="form-table">
|
456 |
+
<tr>
|
457 |
+
<th scope="row">Allow Proposed Answer</th>
|
458 |
+
<td>
|
459 |
+
<fieldset><legend class="screen-reader-text"><span>Allow Proposed Answer</span></legend>
|
460 |
+
<label title='Yes'><input type='radio' name='allow_proposed_answer' value='Yes' <?php if($Allow_Proposed_Answer == "Yes") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>Yes</span></label><br />
|
461 |
+
<label title='No'><input type='radio' name='allow_proposed_answer' value='No' <?php if($Allow_Proposed_Answer == "No") {echo "checked='checked'";} ?> <?php if ($UFAQ_Full_Version != "Yes") {echo "disabled";} ?> /> <span>No</span></label><br />
|
462 |
+
<p>When using the user-submitted question shortcode, should users be able to propose an answer to the question they're submitting?</p>
|
463 |
+
</fieldset>
|
464 |
+
</td>
|
465 |
+
</tr>
|
466 |
+
<tr>
|
467 |
+
<th scope="row">Admin Question Notification</th>
|
468 |
+
<td>
|
469 |
+
<fieldset><legend class="screen-reader-text"><span>Admin Question Notification</span></legend>
|
470 |
+
<label title='Yes'><input type='radio' name='admin_question_notification' value='Yes' <?php if($Admin_Question_Notification == "Yes") {echo "checked='checked'";} ?> /> <span>Yes</span></label><br />
|
471 |
+
<label title='No'><input type='radio' name='admin_question_notification' value='No' <?php if($Admin_Question_Notification == "No") {echo "checked='checked'";} ?> /> <span>No</span></label><br />
|
472 |
+
<p>Should an email be sent to the site administrator when a question is submitted?</p>
|
473 |
+
</fieldset>
|
474 |
+
</td>
|
475 |
+
</tr>
|
476 |
+
</table>
|
477 |
</div>
|
478 |
|
479 |
<div id='Order' class='ufaq-option-set ufaq-hidden'>
|
readme.txt
CHANGED
@@ -247,6 +247,9 @@ Video 3 - FAQs Ordering
|
|
247 |
13. View of FAQ custom fields in the admin
|
248 |
|
249 |
== Changelog ==
|
|
|
|
|
|
|
250 |
= 1.5.20 =
|
251 |
- Added a new, simpler way to select which FAQs to display on a product page, directly from the edit product screen
|
252 |
|
247 |
13. View of FAQ custom fields in the admin
|
248 |
|
249 |
== Changelog ==
|
250 |
+
= 1.5.21 =
|
251 |
+
- Split the basic and premium options into a few sub-sections, to make it easier to find the right option
|
252 |
+
|
253 |
= 1.5.20 =
|
254 |
- Added a new, simpler way to select which FAQs to display on a product page, directly from the edit product screen
|
255 |
|