ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Properties.php
Go to the documentation of this file.
1<?php
2
4
11abstract class Properties
12{
13 const
15 const EXCEL_COLOR_TYPE_SCHEME = 'schemeClr';
16 const EXCEL_COLOR_TYPE_ARGB = 'srgbClr';
17
18 const
20 const AXIS_LABELS_HIGH = 'high';
21 const AXIS_LABELS_NEXT_TO = 'nextTo';
22 const AXIS_LABELS_NONE = 'none';
23
24 const
26 const TICK_MARK_INSIDE = 'in';
27 const TICK_MARK_OUTSIDE = 'out';
28 const TICK_MARK_CROSS = 'cross';
29
30 const
33
34 const
36 const FORMAT_CODE_NUMBER = '#,##0.00';
37 const FORMAT_CODE_CURRENCY = '$#,##0.00';
38 const FORMAT_CODE_ACCOUNTING = '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)';
39 const FORMAT_CODE_DATE = 'm/d/yyyy';
40 const FORMAT_CODE_TIME = '[$-F400]h:mm:ss AM/PM';
41 const FORMAT_CODE_PERCENTAGE = '0.00%';
42 const FORMAT_CODE_FRACTION = '# ?/?';
43 const FORMAT_CODE_SCIENTIFIC = '0.00E+00';
44 const FORMAT_CODE_TEXT = '@';
45 const FORMAT_CODE_SPECIAL = '00000';
46
47 const
49 const ORIENTATION_REVERSED = 'maxMin';
50
51 const
54 const LINE_STYLE_COMPOUND_THICKTHIN = 'thickThin';
55 const LINE_STYLE_COMPOUND_THINTHICK = 'thinThick';
57 const LINE_STYLE_DASH_SOLID = 'solid';
58 const LINE_STYLE_DASH_ROUND_DOT = 'sysDot';
59 const LINE_STYLE_DASH_SQUERE_DOT = 'sysDash';
60 const LINE_STYPE_DASH_DASH = 'dash';
61 const LINE_STYLE_DASH_DASH_DOT = 'dashDot';
62 const LINE_STYLE_DASH_LONG_DASH = 'lgDash';
63 const LINE_STYLE_DASH_LONG_DASH_DOT = 'lgDashDot';
64 const LINE_STYLE_DASH_LONG_DASH_DOT_DOT = 'lgDashDotDot';
66 const LINE_STYLE_CAP_ROUND = 'rnd';
67 const LINE_STYLE_CAP_FLAT = 'flat';
68 const LINE_STYLE_JOIN_ROUND = 'bevel';
69 const LINE_STYLE_JOIN_MITER = 'miter';
70 const LINE_STYLE_JOIN_BEVEL = 'bevel';
72 const LINE_STYLE_ARROW_TYPE_ARROW = 'triangle';
86
87 const
112
118 protected function getExcelPointsWidth($width)
119 {
120 return $width * 12700;
121 }
122
128 protected function getExcelPointsAngle($angle)
129 {
130 return $angle * 60000;
131 }
132
133 protected function getTrueAlpha($alpha)
134 {
135 return (string) 100 - $alpha . '000';
136 }
137
138 protected function setColorProperties($color, $alpha, $type)
139 {
140 return [
141 'type' => (string) $type,
142 'value' => (string) $color,
143 'alpha' => (string) $this->getTrueAlpha($alpha),
144 ];
145 }
146
147 protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
148 {
149 $sizes = [
150 1 => ['w' => 'sm', 'len' => 'sm'],
151 2 => ['w' => 'sm', 'len' => 'med'],
152 3 => ['w' => 'sm', 'len' => 'lg'],
153 4 => ['w' => 'med', 'len' => 'sm'],
154 5 => ['w' => 'med', 'len' => 'med'],
155 6 => ['w' => 'med', 'len' => 'lg'],
156 7 => ['w' => 'lg', 'len' => 'sm'],
157 8 => ['w' => 'lg', 'len' => 'med'],
158 9 => ['w' => 'lg', 'len' => 'lg'],
159 ];
160
161 return $sizes[$array_selector][$array_kay_selector];
162 }
163
164 protected function getShadowPresetsMap($shadow_presets_option)
165 {
166 $presets_options = [
167 //OUTER
168 1 => [
169 'effect' => 'outerShdw',
170 'blur' => '50800',
171 'distance' => '38100',
172 'direction' => '2700000',
173 'algn' => 'tl',
174 'rotWithShape' => '0',
175 ],
176 2 => [
177 'effect' => 'outerShdw',
178 'blur' => '50800',
179 'distance' => '38100',
180 'direction' => '5400000',
181 'algn' => 't',
182 'rotWithShape' => '0',
183 ],
184 3 => [
185 'effect' => 'outerShdw',
186 'blur' => '50800',
187 'distance' => '38100',
188 'direction' => '8100000',
189 'algn' => 'tr',
190 'rotWithShape' => '0',
191 ],
192 4 => [
193 'effect' => 'outerShdw',
194 'blur' => '50800',
195 'distance' => '38100',
196 'algn' => 'l',
197 'rotWithShape' => '0',
198 ],
199 5 => [
200 'effect' => 'outerShdw',
201 'size' => [
202 'sx' => '102000',
203 'sy' => '102000',
204 ],
205 'blur' => '63500',
206 'distance' => '38100',
207 'algn' => 'ctr',
208 'rotWithShape' => '0',
209 ],
210 6 => [
211 'effect' => 'outerShdw',
212 'blur' => '50800',
213 'distance' => '38100',
214 'direction' => '10800000',
215 'algn' => 'r',
216 'rotWithShape' => '0',
217 ],
218 7 => [
219 'effect' => 'outerShdw',
220 'blur' => '50800',
221 'distance' => '38100',
222 'direction' => '18900000',
223 'algn' => 'bl',
224 'rotWithShape' => '0',
225 ],
226 8 => [
227 'effect' => 'outerShdw',
228 'blur' => '50800',
229 'distance' => '38100',
230 'direction' => '16200000',
231 'rotWithShape' => '0',
232 ],
233 9 => [
234 'effect' => 'outerShdw',
235 'blur' => '50800',
236 'distance' => '38100',
237 'direction' => '13500000',
238 'algn' => 'br',
239 'rotWithShape' => '0',
240 ],
241 //INNER
242 10 => [
243 'effect' => 'innerShdw',
244 'blur' => '63500',
245 'distance' => '50800',
246 'direction' => '2700000',
247 ],
248 11 => [
249 'effect' => 'innerShdw',
250 'blur' => '63500',
251 'distance' => '50800',
252 'direction' => '5400000',
253 ],
254 12 => [
255 'effect' => 'innerShdw',
256 'blur' => '63500',
257 'distance' => '50800',
258 'direction' => '8100000',
259 ],
260 13 => [
261 'effect' => 'innerShdw',
262 'blur' => '63500',
263 'distance' => '50800',
264 ],
265 14 => [
266 'effect' => 'innerShdw',
267 'blur' => '114300',
268 ],
269 15 => [
270 'effect' => 'innerShdw',
271 'blur' => '63500',
272 'distance' => '50800',
273 'direction' => '10800000',
274 ],
275 16 => [
276 'effect' => 'innerShdw',
277 'blur' => '63500',
278 'distance' => '50800',
279 'direction' => '18900000',
280 ],
281 17 => [
282 'effect' => 'innerShdw',
283 'blur' => '63500',
284 'distance' => '50800',
285 'direction' => '16200000',
286 ],
287 18 => [
288 'effect' => 'innerShdw',
289 'blur' => '63500',
290 'distance' => '50800',
291 'direction' => '13500000',
292 ],
293 //perspective
294 19 => [
295 'effect' => 'outerShdw',
296 'blur' => '152400',
297 'distance' => '317500',
298 'size' => [
299 'sx' => '90000',
300 'sy' => '-19000',
301 ],
302 'direction' => '5400000',
303 'rotWithShape' => '0',
304 ],
305 20 => [
306 'effect' => 'outerShdw',
307 'blur' => '76200',
308 'direction' => '18900000',
309 'size' => [
310 'sy' => '23000',
311 'kx' => '-1200000',
312 ],
313 'algn' => 'bl',
314 'rotWithShape' => '0',
315 ],
316 21 => [
317 'effect' => 'outerShdw',
318 'blur' => '76200',
319 'direction' => '13500000',
320 'size' => [
321 'sy' => '23000',
322 'kx' => '1200000',
323 ],
324 'algn' => 'br',
325 'rotWithShape' => '0',
326 ],
327 22 => [
328 'effect' => 'outerShdw',
329 'blur' => '76200',
330 'distance' => '12700',
331 'direction' => '2700000',
332 'size' => [
333 'sy' => '-23000',
334 'kx' => '-800400',
335 ],
336 'algn' => 'bl',
337 'rotWithShape' => '0',
338 ],
339 23 => [
340 'effect' => 'outerShdw',
341 'blur' => '76200',
342 'distance' => '12700',
343 'direction' => '8100000',
344 'size' => [
345 'sy' => '-23000',
346 'kx' => '800400',
347 ],
348 'algn' => 'br',
349 'rotWithShape' => '0',
350 ],
351 ];
352
353 return $presets_options[$shadow_presets_option];
354 }
355
356 protected function getArrayElementsValue($properties, $elements)
357 {
358 $reference = &$properties;
359 if (!is_array($elements)) {
360 return $reference[$elements];
361 }
362
363 foreach ($elements as $keys) {
364 $reference = &$reference[$keys];
365 }
366
367 return $reference;
368 }
369}
An exception for terminatinating execution or to throw for unit testing.
getArrayElementsValue($properties, $elements)
Definition: Properties.php:356
getShadowPresetsMap($shadow_presets_option)
Definition: Properties.php:164
getLineStyleArrowSize($array_selector, $array_kay_selector)
Definition: Properties.php:147
setColorProperties($color, $alpha, $type)
Definition: Properties.php:138
$angle
$keys
$type