@@ -25,17 +25,22 @@ |
||
25 | 25 | </thead> |
26 | 26 | <?php |
27 | 27 | |
28 | -if ( isset( $_POST ) ) |
|
29 | - $postArray = &$_POST ; // 4.1.0 or later, use $_POST |
|
30 | -else |
|
31 | - $postArray = &$HTTP_POST_VARS ; // prior to 4.1.0, use HTTP_POST_VARS |
|
28 | +if ( isset( $_POST ) ) { |
|
29 | + $postArray = &$_POST ; |
|
30 | +} |
|
31 | +// 4.1.0 or later, use $_POST |
|
32 | +else { |
|
33 | + $postArray = &$HTTP_POST_VARS ; |
|
34 | +} |
|
35 | +// prior to 4.1.0, use HTTP_POST_VARS |
|
32 | 36 | |
33 | 37 | foreach ( $postArray as $sForm => $value ) |
34 | 38 | { |
35 | - if ( get_magic_quotes_gpc() ) |
|
36 | - $postedValue = htmlspecialchars( stripslashes( $value ) ) ; |
|
37 | - else |
|
38 | - $postedValue = htmlspecialchars( $value ) ; |
|
39 | + if ( get_magic_quotes_gpc() ) { |
|
40 | + $postedValue = htmlspecialchars( stripslashes( $value ) ) ; |
|
41 | + } else { |
|
42 | + $postedValue = htmlspecialchars( $value ) ; |
|
43 | + } |
|
39 | 44 | |
40 | 45 | ?> |
41 | 46 | <tr> |
@@ -142,10 +142,11 @@ discard block |
||
142 | 142 | $_config = $this->configSettings($config, $events); |
143 | 143 | |
144 | 144 | $js = $this->returnGlobalEvents(); |
145 | - if (!empty($_config)) |
|
146 | - $js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");"; |
|
147 | - else |
|
148 | - $js .= "CKEDITOR.replace('".$name."');"; |
|
145 | + if (!empty($_config)) { |
|
146 | + $js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");"; |
|
147 | + } else { |
|
148 | + $js .= "CKEDITOR.replace('".$name."');"; |
|
149 | + } |
|
149 | 150 | |
150 | 151 | $out .= $this->script($js); |
151 | 152 | |
@@ -182,8 +183,7 @@ discard block |
||
182 | 183 | $js = $this->returnGlobalEvents(); |
183 | 184 | if (!empty($_config)) { |
184 | 185 | $js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");"; |
185 | - } |
|
186 | - else { |
|
186 | + } else { |
|
187 | 187 | $js .= "CKEDITOR.replace('".$id."');"; |
188 | 188 | } |
189 | 189 | $out .= $this->script($js); |
@@ -226,12 +226,10 @@ discard block |
||
226 | 226 | if (empty($_config)) { |
227 | 227 | if (empty($className)) { |
228 | 228 | $js .= "CKEDITOR.replaceAll();"; |
229 | - } |
|
230 | - else { |
|
229 | + } else { |
|
231 | 230 | $js .= "CKEDITOR.replaceAll('".$className."');"; |
232 | 231 | } |
233 | - } |
|
234 | - else { |
|
232 | + } else { |
|
235 | 233 | $classDetection = ""; |
236 | 234 | $js .= "CKEDITOR.replaceAll( function(textarea, config) {\n"; |
237 | 235 | if (!empty($className)) { |
@@ -289,8 +287,7 @@ discard block |
||
289 | 287 | { |
290 | 288 | if (!empty($event)) { |
291 | 289 | $this->events[$event] = array(); |
292 | - } |
|
293 | - else { |
|
290 | + } else { |
|
294 | 291 | $this->events = array(); |
295 | 292 | } |
296 | 293 | } |
@@ -329,8 +326,7 @@ discard block |
||
329 | 326 | { |
330 | 327 | if (!empty($event)) { |
331 | 328 | $this->globalEvents[$event] = array(); |
332 | - } |
|
333 | - else { |
|
329 | + } else { |
|
334 | 330 | $this->globalEvents = array(); |
335 | 331 | } |
336 | 332 | } |
@@ -381,11 +377,9 @@ discard block |
||
381 | 377 | foreach ($_events as $eventName => $handlers) { |
382 | 378 | if (empty($handlers)) { |
383 | 379 | continue; |
384 | - } |
|
385 | - else if (count($handlers) == 1) { |
|
380 | + } else if (count($handlers) == 1) { |
|
386 | 381 | $_config['on'][$eventName] = '@@'.$handlers[0]; |
387 | - } |
|
388 | - else { |
|
382 | + } else { |
|
389 | 383 | $_config['on'][$eventName] = '@@function (ev){'; |
390 | 384 | foreach ($handlers as $handler => $code) { |
391 | 385 | $_config['on'][$eventName] .= '('.$code.')(ev);'; |
@@ -488,8 +482,7 @@ discard block |
||
488 | 482 | */ |
489 | 483 | if (isset($_SERVER['SCRIPT_FILENAME'])) { |
490 | 484 | $realPath = dirname($_SERVER['SCRIPT_FILENAME']); |
491 | - } |
|
492 | - else { |
|
485 | + } else { |
|
493 | 486 | /** |
494 | 487 | * realpath — Returns canonicalized absolute pathname |
495 | 488 | */ |
@@ -544,8 +537,7 @@ discard block |
||
544 | 537 | // Use @@ to not use quotes when outputting string value |
545 | 538 | if (strpos($val, '@@') === 0) { |
546 | 539 | return substr($val, 2); |
547 | - } |
|
548 | - else { |
|
540 | + } else { |
|
549 | 541 | // All scalars are converted to strings to avoid indeterminism. |
550 | 542 | // PHP's "1" and 1 are equal for all PHP operators, but |
551 | 543 | // JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend, |
@@ -571,12 +563,15 @@ discard block |
||
571 | 563 | $result = array(); |
572 | 564 | if ($isList) |
573 | 565 | { |
574 | - foreach ($val as $v) $result[] = $this->jsEncode($v); |
|
566 | + foreach ($val as $v) { |
|
567 | + $result[] = $this->jsEncode($v); |
|
568 | + } |
|
575 | 569 | return '[ ' . join(', ', $result) . ' ]'; |
576 | - } |
|
577 | - else |
|
570 | + } else |
|
578 | 571 | { |
579 | - foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); |
|
572 | + foreach ($val as $k => $v) { |
|
573 | + $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); |
|
574 | + } |
|
580 | 575 | return '{ ' . join(', ', $result) . ' }'; |
581 | 576 | } |
582 | 577 | } |
@@ -18,12 +18,24 @@ discard block |
||
18 | 18 | new Cropper.Img( |
19 | 19 | 'image', |
20 | 20 | { |
21 | - minWidth: <?php if (isset($_GET['max_width'])): e($_GET['max_width']); else: echo 0; endif; ?>, |
|
22 | - minHeight: <?php if (isset($_GET['max_height'])): e($_GET['max_height']); else: echo 0; endif; ?>, |
|
21 | + minWidth: <?php if (isset($_GET['max_width'])): e($_GET['max_width']); else { |
|
22 | + : echo 0; |
|
23 | +} |
|
24 | +endif; ?>, |
|
25 | + minHeight: <?php if (isset($_GET['max_height'])): e($_GET['max_height']); else { |
|
26 | + : echo 0; |
|
27 | +} |
|
28 | +endif; ?>, |
|
23 | 29 | <?php if (isset($_GET['unlock_ratio']) && intval($_GET['unlock_ratio']) == 0): ?> |
24 | 30 | ratioDim: { |
25 | - x: <?php if (isset($_GET['max_width'])): e($_GET['max_width']); else: echo 0; endif; ?>, |
|
26 | - y: <?php if (isset($_GET['max_height'])): e($_GET['max_height']); else: echo 0; endif; ?> |
|
31 | + x: <?php if (isset($_GET['max_width'])): e($_GET['max_width']); else { |
|
32 | + : echo 0; |
|
33 | +} |
|
34 | +endif; ?>, |
|
35 | + y: <?php if (isset($_GET['max_height'])): e($_GET['max_height']); else { |
|
36 | + : echo 0; |
|
37 | +} |
|
38 | +endif; ?> |
|
27 | 39 | }, |
28 | 40 | <?php endif; ?> |
29 | 41 | displayOnInit: true, |
@@ -34,9 +46,21 @@ discard block |
||
34 | 46 | } ); |
35 | 47 | |
36 | 48 | function onEndCrop(coords, dimensions) { |
37 | - document.getElementById('width').value = Math.floor(dimensions.width * <?php if (isset($_GET['size_ratio'])): echo doubleval($_GET['size_ratio']); else: echo 1; endif; ?>); |
|
38 | - document.getElementById('height').value = Math.floor(dimensions.height * <?php if (isset($_GET['size_ratio'])): echo doubleval($_GET['size_ratio']); else: echo 1; endif; ?>); |
|
39 | - document.getElementById('x').value = Math.round(coords.x1 * <?php if (isset($_GET['size_ratio'])): echo doubleval($_GET['size_ratio']); else: echo 1; endif; ?>); |
|
40 | - document.getElementById('y').value = Math.round(coords.y1 * <?php if (isset($_GET['size_ratio'])): echo doubleval($_GET['size_ratio']); else: echo 1; endif; ?>); |
|
49 | + document.getElementById('width').value = Math.floor(dimensions.width * <?php if (isset($_GET['size_ratio'])): echo doubleval($_GET['size_ratio']); else { |
|
50 | + : echo 1; |
|
51 | +} |
|
52 | +endif; ?>); |
|
53 | + document.getElementById('height').value = Math.floor(dimensions.height * <?php if (isset($_GET['size_ratio'])): echo doubleval($_GET['size_ratio']); else { |
|
54 | + : echo 1; |
|
55 | +} |
|
56 | +endif; ?>); |
|
57 | + document.getElementById('x').value = Math.round(coords.x1 * <?php if (isset($_GET['size_ratio'])): echo doubleval($_GET['size_ratio']); else { |
|
58 | + : echo 1; |
|
59 | +} |
|
60 | +endif; ?>); |
|
61 | + document.getElementById('y').value = Math.round(coords.y1 * <?php if (isset($_GET['size_ratio'])): echo doubleval($_GET['size_ratio']); else { |
|
62 | + : echo 1; |
|
63 | +} |
|
64 | +endif; ?>); |
|
41 | 65 | |
42 | 66 | } |
43 | 67 | \ No newline at end of file |
@@ -72,9 +72,13 @@ |
||
72 | 72 | $contacts = $contact->getList(); |
73 | 73 | $i = 0; |
74 | 74 | foreach ($contacts as $contact) { |
75 | - if (empty($contact['email'])) continue; |
|
76 | - if ($subscriber->addContact(new Contact($kernel, $contact['id']))) $i++; |
|
77 | -} |
|
75 | + if (empty($contact['email'])) { |
|
76 | + continue; |
|
77 | + } |
|
78 | + if ($subscriber->addContact(new Contact($kernel, $contact['id']))) { |
|
79 | + $i++; |
|
80 | + } |
|
81 | + } |
|
78 | 82 | echo $i; |
79 | 83 | |
80 | 84 |