@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | //protected $cookies = array(); |
8 | 8 | |
9 | 9 | /** |
10 | - * Get data from form result |
|
11 | - * @param String $url form URL |
|
12 | - * @param String $type type of submit form method (get or post) |
|
13 | - * @param String|Array $data values form post method |
|
14 | - * @param Array $headers header to submit with the form |
|
15 | - * @return String the result |
|
16 | - */ |
|
10 | + * Get data from form result |
|
11 | + * @param String $url form URL |
|
12 | + * @param String $type type of submit form method (get or post) |
|
13 | + * @param String|Array $data values form post method |
|
14 | + * @param Array $headers header to submit with the form |
|
15 | + * @return String the result |
|
16 | + */ |
|
17 | 17 | public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '', $sizelimit = false, $async = false) { |
18 | 18 | global $globalProxy, $globalForceIPv4; |
19 | 19 | $ch = curl_init(); |
@@ -166,10 +166,10 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
169 | - * Convert a HTML table to an array |
|
170 | - * @param String $data HTML page |
|
171 | - * @return Array array of the tables in HTML page |
|
172 | - */ |
|
169 | + * Convert a HTML table to an array |
|
170 | + * @param String $data HTML page |
|
171 | + * @return Array array of the tables in HTML page |
|
172 | + */ |
|
173 | 173 | public function table2array($data) { |
174 | 174 | if (!is_string($data)) return array(); |
175 | 175 | if ($data == '') return array(); |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
206 | - * Convert <p> part of a HTML page to an array |
|
207 | - * @param String $data HTML page |
|
208 | - * @return Array array of the <p> in HTML page |
|
209 | - */ |
|
206 | + * Convert <p> part of a HTML page to an array |
|
207 | + * @param String $data HTML page |
|
208 | + * @return Array array of the <p> in HTML page |
|
209 | + */ |
|
210 | 210 | public function text2array($data) { |
211 | 211 | $html = str_get_html($data); |
212 | 212 | if ($html === false) return array(); |
@@ -221,14 +221,14 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
224 | - * Give distance between 2 coordonnates |
|
225 | - * @param Float $lat latitude of first point |
|
226 | - * @param Float $lon longitude of first point |
|
227 | - * @param Float $latc latitude of second point |
|
228 | - * @param Float $lonc longitude of second point |
|
229 | - * @param String $unit km else no unit used |
|
230 | - * @return Float Distance in $unit |
|
231 | - */ |
|
224 | + * Give distance between 2 coordonnates |
|
225 | + * @param Float $lat latitude of first point |
|
226 | + * @param Float $lon longitude of first point |
|
227 | + * @param Float $latc latitude of second point |
|
228 | + * @param Float $lonc longitude of second point |
|
229 | + * @param String $unit km else no unit used |
|
230 | + * @return Float Distance in $unit |
|
231 | + */ |
|
232 | 232 | public function distance($lat, $lon, $latc, $lonc, $unit = 'km') { |
233 | 233 | if ($lat == $latc && $lon == $lonc) return 0; |
234 | 234 | $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515; |
@@ -246,25 +246,25 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
249 | - * Give plunge between 2 altitudes and distance |
|
250 | - * @param Float $initial_altitude altitude of first point in m |
|
251 | - * @param Float $final_altitude altitude of second point in m |
|
252 | - * @param String $distance distance between two points in m |
|
253 | - * @return Float plunge |
|
254 | - */ |
|
249 | + * Give plunge between 2 altitudes and distance |
|
250 | + * @param Float $initial_altitude altitude of first point in m |
|
251 | + * @param Float $final_altitude altitude of second point in m |
|
252 | + * @param String $distance distance between two points in m |
|
253 | + * @return Float plunge |
|
254 | + */ |
|
255 | 255 | public function plunge($initial_altitude,$final_altitude,$distance) { |
256 | 256 | $plunge = rad2deg(asin(($final_altitude-$initial_altitude)/$distance)); |
257 | 257 | return $plunge; |
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
261 | - * Give azimuth between 2 coordonnates |
|
262 | - * @param Float $lat latitude of first point |
|
263 | - * @param Float $lon longitude of first point |
|
264 | - * @param Float $latc latitude of second point |
|
265 | - * @param Float $lonc longitude of second point |
|
266 | - * @return Float Azimuth |
|
267 | - */ |
|
261 | + * Give azimuth between 2 coordonnates |
|
262 | + * @param Float $lat latitude of first point |
|
263 | + * @param Float $lon longitude of first point |
|
264 | + * @param Float $latc latitude of second point |
|
265 | + * @param Float $lonc longitude of second point |
|
266 | + * @return Float Azimuth |
|
267 | + */ |
|
268 | 268 | public function azimuth($lat, $lon, $latc, $lonc) { |
269 | 269 | $dX = $latc - $lat; |
270 | 270 | $dY = $lonc - $lon; |
@@ -275,11 +275,11 @@ discard block |
||
275 | 275 | |
276 | 276 | |
277 | 277 | /** |
278 | - * Check is distance realistic |
|
279 | - * @param int $timeDifference the time between the reception of both messages |
|
280 | - * @param float $distance distance covered |
|
281 | - * @return whether distance is realistic |
|
282 | - */ |
|
278 | + * Check is distance realistic |
|
279 | + * @param int $timeDifference the time between the reception of both messages |
|
280 | + * @param float $distance distance covered |
|
281 | + * @return whether distance is realistic |
|
282 | + */ |
|
283 | 283 | public function withinThreshold ($timeDifference, $distance) { |
284 | 284 | $x = abs($timeDifference); |
285 | 285 | $d = abs($distance); |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | public function isInteger($input){ |
300 | - return(ctype_digit(strval($input))); |
|
300 | + return(ctype_digit(strval($input))); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
@@ -328,11 +328,11 @@ discard block |
||
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
331 | - * Copy folder contents |
|
332 | - * @param string $source Source path |
|
333 | - * @param string $dest Destination path |
|
334 | - * @return bool Returns true on success, false on failure |
|
335 | - */ |
|
331 | + * Copy folder contents |
|
332 | + * @param string $source Source path |
|
333 | + * @param string $dest Destination path |
|
334 | + * @return bool Returns true on success, false on failure |
|
335 | + */ |
|
336 | 336 | public function xcopy($source, $dest) |
337 | 337 | { |
338 | 338 | $files = glob($source.'*.*'); |
@@ -344,20 +344,20 @@ discard block |
||
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
347 | - * Check if an url exist |
|
348 | - * @param String $url url to check |
|
349 | - * @return bool Return true on succes false on failure |
|
350 | - */ |
|
347 | + * Check if an url exist |
|
348 | + * @param String $url url to check |
|
349 | + * @return bool Return true on succes false on failure |
|
350 | + */ |
|
351 | 351 | public function urlexist($url){ |
352 | 352 | $headers=get_headers($url); |
353 | 353 | return stripos($headers[0],"200 OK")?true:false; |
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
357 | - * Convert hexa to string |
|
358 | - * @param String $hex data in hexa |
|
359 | - * @return String Return result |
|
360 | - */ |
|
357 | + * Convert hexa to string |
|
358 | + * @param String $hex data in hexa |
|
359 | + * @return String Return result |
|
360 | + */ |
|
361 | 361 | public function hex2str($hex) { |
362 | 362 | $str = ''; |
363 | 363 | $hexln = strlen($hex); |
@@ -366,10 +366,10 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
369 | - * Convert hexa color to rgb |
|
370 | - * @param String $hex data in hexa |
|
371 | - * @return String Return result |
|
372 | - */ |
|
369 | + * Convert hexa color to rgb |
|
370 | + * @param String $hex data in hexa |
|
371 | + * @return String Return result |
|
372 | + */ |
|
373 | 373 | public function hex2rgb($hex) { |
374 | 374 | $hex = str_replace('#','',$hex); |
375 | 375 | return sscanf($hex, "%02x%02x%02x"); |
@@ -447,9 +447,9 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
450 | - * Returns list of available locales |
|
451 | - * |
|
452 | - * @return array |
|
450 | + * Returns list of available locales |
|
451 | + * |
|
452 | + * @return array |
|
453 | 453 | */ |
454 | 454 | public function listLocaleDir() |
455 | 455 | { |
@@ -548,100 +548,100 @@ discard block |
||
548 | 548 | public function remove_accents($string) { |
549 | 549 | if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
550 | 550 | $chars = array( |
551 | - // Decompositions for Latin-1 Supplement |
|
552 | - chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|
553 | - chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|
554 | - chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|
555 | - chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|
556 | - chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|
557 | - chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|
558 | - chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|
559 | - chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|
560 | - chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|
561 | - chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|
562 | - chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|
563 | - chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|
564 | - chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|
565 | - chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|
566 | - chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|
567 | - chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|
568 | - chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|
569 | - chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|
570 | - chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|
571 | - chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|
572 | - chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|
573 | - chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|
574 | - chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|
575 | - chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|
576 | - chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|
577 | - chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|
578 | - chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|
579 | - chr(195).chr(191) => 'y', |
|
580 | - // Decompositions for Latin Extended-A |
|
581 | - chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|
582 | - chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|
583 | - chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|
584 | - chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|
585 | - chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|
586 | - chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|
587 | - chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|
588 | - chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|
589 | - chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|
590 | - chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|
591 | - chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|
592 | - chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|
593 | - chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|
594 | - chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|
595 | - chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|
596 | - chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|
597 | - chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|
598 | - chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|
599 | - chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|
600 | - chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|
601 | - chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|
602 | - chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|
603 | - chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|
604 | - chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|
605 | - chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|
606 | - chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
607 | - chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|
608 | - chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|
609 | - chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|
610 | - chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|
611 | - chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|
612 | - chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|
613 | - chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|
614 | - chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|
615 | - chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|
616 | - chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|
617 | - chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|
618 | - chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|
619 | - chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|
620 | - chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|
621 | - chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
|
622 | - chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
623 | - chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
624 | - chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
625 | - chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
626 | - chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
627 | - chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
628 | - chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
629 | - chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|
630 | - chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|
631 | - chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|
632 | - chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|
633 | - chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|
634 | - chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|
635 | - chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|
636 | - chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|
637 | - chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|
638 | - chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|
639 | - chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|
640 | - chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|
641 | - chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|
642 | - chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|
643 | - chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|
644 | - chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
|
551 | + // Decompositions for Latin-1 Supplement |
|
552 | + chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|
553 | + chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|
554 | + chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|
555 | + chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|
556 | + chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|
557 | + chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|
558 | + chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|
559 | + chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|
560 | + chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|
561 | + chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|
562 | + chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|
563 | + chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|
564 | + chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|
565 | + chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|
566 | + chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|
567 | + chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|
568 | + chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|
569 | + chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|
570 | + chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|
571 | + chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|
572 | + chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|
573 | + chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|
574 | + chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|
575 | + chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|
576 | + chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|
577 | + chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|
578 | + chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|
579 | + chr(195).chr(191) => 'y', |
|
580 | + // Decompositions for Latin Extended-A |
|
581 | + chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|
582 | + chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|
583 | + chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|
584 | + chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|
585 | + chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|
586 | + chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|
587 | + chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|
588 | + chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|
589 | + chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|
590 | + chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|
591 | + chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|
592 | + chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|
593 | + chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|
594 | + chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|
595 | + chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|
596 | + chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|
597 | + chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|
598 | + chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|
599 | + chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|
600 | + chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|
601 | + chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|
602 | + chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|
603 | + chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|
604 | + chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|
605 | + chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|
606 | + chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
607 | + chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|
608 | + chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|
609 | + chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|
610 | + chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|
611 | + chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|
612 | + chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|
613 | + chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|
614 | + chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|
615 | + chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|
616 | + chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|
617 | + chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|
618 | + chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|
619 | + chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|
620 | + chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|
621 | + chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
|
622 | + chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
623 | + chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
624 | + chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
625 | + chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
626 | + chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
627 | + chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
628 | + chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
629 | + chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|
630 | + chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|
631 | + chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|
632 | + chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|
633 | + chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|
634 | + chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|
635 | + chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|
636 | + chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|
637 | + chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|
638 | + chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|
639 | + chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|
640 | + chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|
641 | + chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|
642 | + chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|
643 | + chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|
644 | + chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
|
645 | 645 | ); |
646 | 646 | $string = strtr($string, $chars); |
647 | 647 | return $string; |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | * @param Array $headers header to submit with the form |
15 | 15 | * @return String the result |
16 | 16 | */ |
17 | - public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '', $sizelimit = false, $async = false) { |
|
17 | + public function getData($url, $type = 'get', $data = '', $headers = '', $cookie = '', $referer = '', $timeout = '', $useragent = '', $sizelimit = false, $async = false) { |
|
18 | 18 | global $globalProxy, $globalForceIPv4; |
19 | 19 | $ch = curl_init(); |
20 | 20 | curl_setopt($ch, CURLOPT_URL, $url); |
21 | 21 | if (isset($globalForceIPv4) && $globalForceIPv4) { |
22 | - if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){ |
|
22 | + if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) { |
|
23 | 23 | curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); |
24 | 24 | } |
25 | 25 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
30 | 30 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
31 | 31 | curl_setopt($ch, CURLINFO_HEADER_OUT, true); |
32 | - curl_setopt($ch,CURLOPT_ENCODING , "gzip"); |
|
32 | + curl_setopt($ch, CURLOPT_ENCODING, "gzip"); |
|
33 | 33 | //curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5'); |
34 | 34 | // curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0'); |
35 | 35 | if ($useragent == '') { |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | } |
40 | 40 | if ($timeout == '') curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
41 | 41 | else curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
42 | - curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common',"curlResponseHeaderCallback")); |
|
42 | + curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common', "curlResponseHeaderCallback")); |
|
43 | 43 | if ($type == 'post') { |
44 | 44 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
45 | 45 | if (is_array($data)) { |
46 | 46 | curl_setopt($ch, CURLOPT_POST, count($data)); |
47 | 47 | $data_string = ''; |
48 | - foreach($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; } |
|
48 | + foreach ($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; } |
|
49 | 49 | rtrim($data_string, '&'); |
50 | 50 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); |
51 | 51 | } else { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | if ($cookie != '') { |
59 | 59 | if (is_array($cookie)) { |
60 | - curl_setopt($ch, CURLOPT_COOKIE, implode($cookie,';')); |
|
60 | + curl_setopt($ch, CURLOPT_COOKIE, implode($cookie, ';')); |
|
61 | 61 | } else { |
62 | 62 | curl_setopt($ch, CURLOPT_COOKIE, $cookie); |
63 | 63 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ($sizelimit === true) { |
69 | 69 | curl_setopt($ch, CURLOPT_BUFFERSIZE, 128); |
70 | 70 | curl_setopt($ch, CURLOPT_NOPROGRESS, false); |
71 | - curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function($curlr,$downloadsize, $downloaded, $uploadsize, $uploaded){ |
|
71 | + curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function($curlr, $downloadsize, $downloaded, $uploadsize, $uploaded) { |
|
72 | 72 | return ($downloaded > (3*1024)) ? 1 : 0; |
73 | 73 | }); |
74 | 74 | } |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | $result = curl_exec($ch); |
80 | 80 | $info = curl_getinfo($ch); |
81 | 81 | curl_close($ch); |
82 | - if ($info['http_code'] == '503' && strstr($result,'DDoS protection by CloudFlare')) { |
|
82 | + if ($info['http_code'] == '503' && strstr($result, 'DDoS protection by CloudFlare')) { |
|
83 | 83 | echo "Cloudflare Detected\n"; |
84 | 84 | require_once(dirname(__FILE__).'/libs/cloudflare-bypass/libraries/cloudflareClass.php'); |
85 | 85 | $useragent = UAgent::random(); |
86 | 86 | cloudflare::useUserAgent($useragent); |
87 | 87 | if ($clearanceCookie = cloudflare::bypass($url)) { |
88 | - return $this->getData($url,'get',$data,$headers,$clearanceCookie,$referer,$timeout,$useragent); |
|
88 | + return $this->getData($url, 'get', $data, $headers, $clearanceCookie, $referer, $timeout, $useragent); |
|
89 | 89 | } |
90 | 90 | } else { |
91 | 91 | return $result; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
110 | 110 | if ($referer != '') curl_setopt($ch, CURLOPT_REFERER, $referer); |
111 | 111 | if (isset($globalForceIPv4) && $globalForceIPv4) { |
112 | - if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){ |
|
112 | + if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) { |
|
113 | 113 | curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); |
114 | 114 | } |
115 | 115 | } |
@@ -124,20 +124,20 @@ discard block |
||
124 | 124 | fclose($fp); |
125 | 125 | } |
126 | 126 | |
127 | - public static function gunzip($in_file,$out_file_name = '') { |
|
127 | + public static function gunzip($in_file, $out_file_name = '') { |
|
128 | 128 | //echo $in_file.' -> '.$out_file_name."\n"; |
129 | 129 | $buffer_size = 4096; // read 4kb at a time |
130 | 130 | if ($out_file_name == '') $out_file_name = str_replace('.gz', '', $in_file); |
131 | 131 | if ($in_file != '' && file_exists($in_file)) { |
132 | 132 | // PHP version of Ubuntu use gzopen64 instead of gzopen |
133 | - if (function_exists('gzopen')) $file = gzopen($in_file,'rb'); |
|
134 | - elseif (function_exists('gzopen64')) $file = gzopen64($in_file,'rb'); |
|
133 | + if (function_exists('gzopen')) $file = gzopen($in_file, 'rb'); |
|
134 | + elseif (function_exists('gzopen64')) $file = gzopen64($in_file, 'rb'); |
|
135 | 135 | else { |
136 | 136 | echo 'gzopen not available'; |
137 | 137 | die; |
138 | 138 | } |
139 | 139 | $out_file = fopen($out_file_name, 'wb'); |
140 | - while(!gzeof($file)) { |
|
140 | + while (!gzeof($file)) { |
|
141 | 141 | fwrite($out_file, gzread($file, $buffer_size)); |
142 | 142 | } |
143 | 143 | fclose($out_file); |
@@ -145,19 +145,19 @@ discard block |
||
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | - public static function bunzip2($in_file,$out_file_name = '') { |
|
148 | + public static function bunzip2($in_file, $out_file_name = '') { |
|
149 | 149 | //echo $in_file.' -> '.$out_file_name."\n"; |
150 | 150 | $buffer_size = 4096; // read 4kb at a time |
151 | 151 | if ($out_file_name == '') $out_file_name = str_replace('.bz2', '', $in_file); |
152 | 152 | if ($in_file != '' && file_exists($in_file)) { |
153 | 153 | // PHP version of Ubuntu use gzopen64 instead of gzopen |
154 | - if (function_exists('bzopen')) $file = bzopen($in_file,'rb'); |
|
154 | + if (function_exists('bzopen')) $file = bzopen($in_file, 'rb'); |
|
155 | 155 | else { |
156 | 156 | echo 'bzopen not available'; |
157 | 157 | die; |
158 | 158 | } |
159 | 159 | $out_file = fopen($out_file_name, 'wb'); |
160 | - while(!feof($file)) { |
|
160 | + while (!feof($file)) { |
|
161 | 161 | fwrite($out_file, bzread($file, $buffer_size)); |
162 | 162 | } |
163 | 163 | fclose($out_file); |
@@ -175,27 +175,27 @@ discard block |
||
175 | 175 | if ($data == '') return array(); |
176 | 176 | $html = str_get_html($data); |
177 | 177 | if ($html === false) return array(); |
178 | - $tabledata=array(); |
|
179 | - foreach($html->find('tr') as $element) |
|
178 | + $tabledata = array(); |
|
179 | + foreach ($html->find('tr') as $element) |
|
180 | 180 | { |
181 | 181 | $td = array(); |
182 | - foreach( $element->find('th') as $row) |
|
182 | + foreach ($element->find('th') as $row) |
|
183 | 183 | { |
184 | 184 | $td [] = trim($row->plaintext); |
185 | 185 | } |
186 | - $td=array_filter($td); |
|
186 | + $td = array_filter($td); |
|
187 | 187 | $tabledata[] = $td; |
188 | 188 | |
189 | 189 | $td = array(); |
190 | 190 | $tdi = array(); |
191 | - foreach( $element->find('td') as $row) |
|
191 | + foreach ($element->find('td') as $row) |
|
192 | 192 | { |
193 | 193 | $td [] = trim($row->plaintext); |
194 | 194 | $tdi [] = trim($row->innertext); |
195 | 195 | } |
196 | - $td=array_filter($td); |
|
197 | - $tdi=array_filter($tdi); |
|
198 | - $tabledata[]=array_merge($td,$tdi); |
|
196 | + $td = array_filter($td); |
|
197 | + $tdi = array_filter($tdi); |
|
198 | + $tabledata[] = array_merge($td, $tdi); |
|
199 | 199 | } |
200 | 200 | $html->clear(); |
201 | 201 | unset($html); |
@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | public function text2array($data) { |
211 | 211 | $html = str_get_html($data); |
212 | 212 | if ($html === false) return array(); |
213 | - $tabledata=array(); |
|
214 | - foreach($html->find('p') as $element) |
|
213 | + $tabledata = array(); |
|
214 | + foreach ($html->find('p') as $element) |
|
215 | 215 | { |
216 | 216 | $tabledata [] = trim($element->plaintext); |
217 | 217 | } |
@@ -231,11 +231,11 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function distance($lat, $lon, $latc, $lonc, $unit = 'km') { |
233 | 233 | if ($lat == $latc && $lon == $lonc) return 0; |
234 | - $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515; |
|
234 | + $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc))) + cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon) - floatval($lonc)))))*60*1.1515; |
|
235 | 235 | if ($unit == "km") { |
236 | - return round($dist * 1.609344); |
|
236 | + return round($dist*1.609344); |
|
237 | 237 | } elseif ($unit == "m") { |
238 | - return round($dist * 1.609344 * 1000); |
|
238 | + return round($dist*1.609344*1000); |
|
239 | 239 | } elseif ($unit == "mile" || $unit == "mi") { |
240 | 240 | return round($dist); |
241 | 241 | } elseif ($unit == "nm") { |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | * @param String $distance distance between two points in m |
253 | 253 | * @return Float plunge |
254 | 254 | */ |
255 | - public function plunge($initial_altitude,$final_altitude,$distance) { |
|
256 | - $plunge = rad2deg(asin(($final_altitude-$initial_altitude)/$distance)); |
|
255 | + public function plunge($initial_altitude, $final_altitude, $distance) { |
|
256 | + $plunge = rad2deg(asin(($final_altitude - $initial_altitude)/$distance)); |
|
257 | 257 | return $plunge; |
258 | 258 | } |
259 | 259 | |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | public function azimuth($lat, $lon, $latc, $lonc) { |
269 | 269 | $dX = $latc - $lat; |
270 | 270 | $dY = $lonc - $lon; |
271 | - $azimuth = rad2deg(atan2($dY,$dX)); |
|
272 | - if ($azimuth < 0) return $azimuth+360; |
|
271 | + $azimuth = rad2deg(atan2($dY, $dX)); |
|
272 | + if ($azimuth < 0) return $azimuth + 360; |
|
273 | 273 | return $azimuth; |
274 | 274 | } |
275 | 275 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @param float $distance distance covered |
281 | 281 | * @return whether distance is realistic |
282 | 282 | */ |
283 | - public function withinThreshold ($timeDifference, $distance) { |
|
283 | + public function withinThreshold($timeDifference, $distance) { |
|
284 | 284 | $x = abs($timeDifference); |
285 | 285 | $d = abs($distance); |
286 | 286 | if ($x == 0 || $d == 0) return true; |
@@ -296,12 +296,12 @@ discard block |
||
296 | 296 | return ($array !== array_values($array)); |
297 | 297 | } |
298 | 298 | |
299 | - public function isInteger($input){ |
|
299 | + public function isInteger($input) { |
|
300 | 300 | return(ctype_digit(strval($input))); |
301 | 301 | } |
302 | 302 | |
303 | 303 | |
304 | - public function convertDec($dms,$latlong) { |
|
304 | + public function convertDec($dms, $latlong) { |
|
305 | 305 | if ($latlong == 'latitude') { |
306 | 306 | $deg = substr($dms, 0, 2); |
307 | 307 | $min = substr($dms, 2, 4); |
@@ -309,10 +309,10 @@ discard block |
||
309 | 309 | $deg = substr($dms, 0, 3); |
310 | 310 | $min = substr($dms, 3, 5); |
311 | 311 | } |
312 | - return $deg+(($min*60)/3600); |
|
312 | + return $deg + (($min*60)/3600); |
|
313 | 313 | } |
314 | 314 | |
315 | - public function convertDM($coord,$latlong) { |
|
315 | + public function convertDM($coord, $latlong) { |
|
316 | 316 | if ($latlong == 'latitude') { |
317 | 317 | if ($coord < 0) $NSEW = 'S'; |
318 | 318 | else $NSEW = 'N'; |
@@ -322,9 +322,9 @@ discard block |
||
322 | 322 | } |
323 | 323 | $coord = abs($coord); |
324 | 324 | $deg = floor($coord); |
325 | - $coord = ($coord-$deg)*60; |
|
325 | + $coord = ($coord - $deg)*60; |
|
326 | 326 | $min = $coord; |
327 | - return array('deg' => $deg,'min' => $min,'NSEW' => $NSEW); |
|
327 | + return array('deg' => $deg, 'min' => $min, 'NSEW' => $NSEW); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
@@ -336,8 +336,8 @@ discard block |
||
336 | 336 | public function xcopy($source, $dest) |
337 | 337 | { |
338 | 338 | $files = glob($source.'*.*'); |
339 | - foreach($files as $file){ |
|
340 | - $file_to_go = str_replace($source,$dest,$file); |
|
339 | + foreach ($files as $file) { |
|
340 | + $file_to_go = str_replace($source, $dest, $file); |
|
341 | 341 | copy($file, $file_to_go); |
342 | 342 | } |
343 | 343 | return true; |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | * @param String $url url to check |
349 | 349 | * @return bool Return true on succes false on failure |
350 | 350 | */ |
351 | - public function urlexist($url){ |
|
352 | - $headers=get_headers($url); |
|
353 | - return stripos($headers[0],"200 OK")?true:false; |
|
351 | + public function urlexist($url) { |
|
352 | + $headers = get_headers($url); |
|
353 | + return stripos($headers[0], "200 OK") ?true:false; |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | public function hex2str($hex) { |
362 | 362 | $str = ''; |
363 | 363 | $hexln = strlen($hex); |
364 | - for($i=0;$i<$hexln;$i+=2) $str .= chr(hexdec(substr($hex,$i,2))); |
|
364 | + for ($i = 0; $i < $hexln; $i += 2) $str .= chr(hexdec(substr($hex, $i, 2))); |
|
365 | 365 | return $str; |
366 | 366 | } |
367 | 367 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | * @return String Return result |
372 | 372 | */ |
373 | 373 | public function hex2rgb($hex) { |
374 | - $hex = str_replace('#','',$hex); |
|
374 | + $hex = str_replace('#', '', $hex); |
|
375 | 375 | return sscanf($hex, "%02x%02x%02x"); |
376 | 376 | } |
377 | 377 | |
@@ -379,33 +379,33 @@ discard block |
||
379 | 379 | //difference in longitudinal coordinates |
380 | 380 | $dLon = deg2rad($lon2) - deg2rad($lon1); |
381 | 381 | //difference in the phi of latitudinal coordinates |
382 | - $dPhi = log(tan(deg2rad($lat2) / 2 + pi() / 4) / tan(deg2rad($lat1) / 2 + pi() / 4)); |
|
382 | + $dPhi = log(tan(deg2rad($lat2)/2 + pi()/4)/tan(deg2rad($lat1)/2 + pi()/4)); |
|
383 | 383 | //we need to recalculate $dLon if it is greater than pi |
384 | - if(abs($dLon) > pi()) { |
|
385 | - if($dLon > 0) { |
|
386 | - $dLon = (2 * pi() - $dLon) * -1; |
|
384 | + if (abs($dLon) > pi()) { |
|
385 | + if ($dLon > 0) { |
|
386 | + $dLon = (2*pi() - $dLon)*-1; |
|
387 | 387 | } else { |
388 | - $dLon = 2 * pi() + $dLon; |
|
388 | + $dLon = 2*pi() + $dLon; |
|
389 | 389 | } |
390 | 390 | } |
391 | 391 | //return the angle, normalized |
392 | - return (rad2deg(atan2($dLon, $dPhi)) + 360) % 360; |
|
392 | + return (rad2deg(atan2($dLon, $dPhi)) + 360)%360; |
|
393 | 393 | } |
394 | 394 | |
395 | - public function checkLine($lat1,$lon1,$lat2,$lon2,$lat3,$lon3,$approx = 0.15) { |
|
395 | + public function checkLine($lat1, $lon1, $lat2, $lon2, $lat3, $lon3, $approx = 0.15) { |
|
396 | 396 | //$a = ($lon2-$lon1)*$lat3+($lat2-$lat1)*$lon3+($lat1*$lon2+$lat2*$lon1); |
397 | - $a = -($lon2-$lon1); |
|
397 | + $a = -($lon2 - $lon1); |
|
398 | 398 | $b = $lat2 - $lat1; |
399 | - $c = -($a*$lat1+$b*$lon1); |
|
400 | - $d = $a*$lat3+$b*$lon3+$c; |
|
399 | + $c = -($a*$lat1 + $b*$lon1); |
|
400 | + $d = $a*$lat3 + $b*$lon3 + $c; |
|
401 | 401 | if ($d > -$approx && $d < $approx) return true; |
402 | 402 | else return false; |
403 | 403 | } |
404 | 404 | |
405 | 405 | public function array_merge_noappend() { |
406 | 406 | $output = array(); |
407 | - foreach(func_get_args() as $array) { |
|
408 | - foreach($array as $key => $value) { |
|
407 | + foreach (func_get_args() as $array) { |
|
408 | + foreach ($array as $key => $value) { |
|
409 | 409 | $output[$key] = isset($output[$key]) ? |
410 | 410 | array_merge($output[$key], $value) : $value; |
411 | 411 | } |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | return $result; |
470 | 470 | } |
471 | 471 | |
472 | - public function nextcoord($latitude, $longitude, $speed, $heading, $archivespeed = 1, $seconds = ''){ |
|
472 | + public function nextcoord($latitude, $longitude, $speed, $heading, $archivespeed = 1, $seconds = '') { |
|
473 | 473 | global $globalMapRefresh; |
474 | 474 | if ($seconds == '') { |
475 | 475 | $distance = ($speed*0.514444*$globalMapRefresh*$archivespeed)/1000; |
@@ -480,27 +480,27 @@ discard block |
||
480 | 480 | $latitude = deg2rad($latitude); |
481 | 481 | $longitude = deg2rad($longitude); |
482 | 482 | $bearing = deg2rad($heading); |
483 | - $latitude2 = asin( (sin($latitude) * cos($distance/$r)) + (cos($latitude) * sin($distance/$r) * cos($bearing)) ); |
|
484 | - $longitude2 = $longitude + atan2( sin($bearing)*sin($distance/$r)*cos($latitude), cos($distance/$r)-(sin($latitude)*sin($latitude2)) ); |
|
485 | - return array('latitude' => number_format(rad2deg($latitude2),5,'.',''),'longitude' => number_format(rad2deg($longitude2),5,'.','')); |
|
483 | + $latitude2 = asin((sin($latitude)*cos($distance/$r)) + (cos($latitude)*sin($distance/$r)*cos($bearing))); |
|
484 | + $longitude2 = $longitude + atan2(sin($bearing)*sin($distance/$r)*cos($latitude), cos($distance/$r) - (sin($latitude)*sin($latitude2))); |
|
485 | + return array('latitude' => number_format(rad2deg($latitude2), 5, '.', ''), 'longitude' => number_format(rad2deg($longitude2), 5, '.', '')); |
|
486 | 486 | } |
487 | 487 | |
488 | - public function getCoordfromDistanceBearing($latitude,$longitude,$bearing,$distance) { |
|
488 | + public function getCoordfromDistanceBearing($latitude, $longitude, $bearing, $distance) { |
|
489 | 489 | // distance in meter |
490 | 490 | $R = 6378.14; |
491 | - $latitude1 = $latitude * (M_PI/180); |
|
492 | - $longitude1 = $longitude * (M_PI/180); |
|
493 | - $brng = $bearing * (M_PI/180); |
|
491 | + $latitude1 = $latitude*(M_PI/180); |
|
492 | + $longitude1 = $longitude*(M_PI/180); |
|
493 | + $brng = $bearing*(M_PI/180); |
|
494 | 494 | $d = $distance; |
495 | 495 | |
496 | 496 | $latitude2 = asin(sin($latitude1)*cos($d/$R) + cos($latitude1)*sin($d/$R)*cos($brng)); |
497 | - $longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1),cos($d/$R)-sin($latitude1)*sin($latitude2)); |
|
497 | + $longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1), cos($d/$R) - sin($latitude1)*sin($latitude2)); |
|
498 | 498 | |
499 | - $latitude2 = $latitude2 * (180/M_PI); |
|
500 | - $longitude2 = $longitude2 * (180/M_PI); |
|
499 | + $latitude2 = $latitude2*(180/M_PI); |
|
500 | + $longitude2 = $longitude2*(180/M_PI); |
|
501 | 501 | |
502 | - $flat = round ($latitude2,6); |
|
503 | - $flong = round ($longitude2,6); |
|
502 | + $flat = round($latitude2, 6); |
|
503 | + $flong = round($longitude2, 6); |
|
504 | 504 | /* |
505 | 505 | $dx = $distance*cos($bearing); |
506 | 506 | $dy = $distance*sin($bearing); |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | $flong = $longitude + $dlong; |
510 | 510 | $flat = $latitude + $dlat; |
511 | 511 | */ |
512 | - return array('latitude' => $flat,'longitude' => $flong); |
|
512 | + return array('latitude' => $flat, 'longitude' => $flong); |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | /** |
@@ -523,14 +523,14 @@ discard block |
||
523 | 523 | * @param integer $level GZIP compression level (default: 9) |
524 | 524 | * @return string New filename (with .gz appended) if success, or false if operation fails |
525 | 525 | */ |
526 | - public function gzCompressFile($source, $level = 9){ |
|
527 | - $dest = $source . '.gz'; |
|
528 | - $mode = 'wb' . $level; |
|
526 | + public function gzCompressFile($source, $level = 9) { |
|
527 | + $dest = $source.'.gz'; |
|
528 | + $mode = 'wb'.$level; |
|
529 | 529 | $error = false; |
530 | 530 | if ($fp_out = gzopen($dest, $mode)) { |
531 | - if ($fp_in = fopen($source,'rb')) { |
|
531 | + if ($fp_in = fopen($source, 'rb')) { |
|
532 | 532 | while (!feof($fp_in)) |
533 | - gzwrite($fp_out, fread($fp_in, 1024 * 512)); |
|
533 | + gzwrite($fp_out, fread($fp_in, 1024*512)); |
|
534 | 534 | fclose($fp_in); |
535 | 535 | } else { |
536 | 536 | $error = true; |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | } |
547 | 547 | |
548 | 548 | public function remove_accents($string) { |
549 | - if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
|
549 | + if (!preg_match('/[\x80-\xff]/', $string)) return $string; |
|
550 | 550 | $chars = array( |
551 | 551 | // Decompositions for Latin-1 Supplement |
552 | 552 | chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
604 | 604 | chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
605 | 605 | chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
606 | - chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
606 | + chr(196).chr(178) => 'IJ', chr(196).chr(179) => 'ij', |
|
607 | 607 | chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
608 | 608 | chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
609 | 609 | chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
@@ -619,13 +619,13 @@ discard block |
||
619 | 619 | chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
620 | 620 | chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
621 | 621 | chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
622 | - chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
623 | - chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
624 | - chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
625 | - chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
626 | - chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
627 | - chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
628 | - chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
622 | + chr(197).chr(146) => 'OE', chr(197).chr(147) => 'oe', |
|
623 | + chr(197).chr(148) => 'R', chr(197).chr(149) => 'r', |
|
624 | + chr(197).chr(150) => 'R', chr(197).chr(151) => 'r', |
|
625 | + chr(197).chr(152) => 'R', chr(197).chr(153) => 'r', |
|
626 | + chr(197).chr(154) => 'S', chr(197).chr(155) => 's', |
|
627 | + chr(197).chr(156) => 'S', chr(197).chr(157) => 's', |
|
628 | + chr(197).chr(158) => 'S', chr(197).chr(159) => 's', |
|
629 | 629 | chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
630 | 630 | chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
631 | 631 | chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | for ($i = 0, $int = '', $concat_flag = true; $i < $length; $i++) { |
660 | 660 | if (is_numeric($string[$i]) && $concat_flag) { |
661 | 661 | $int .= $string[$i]; |
662 | - } elseif(!$concat && $concat_flag && strlen($int) > 0) { |
|
662 | + } elseif (!$concat && $concat_flag && strlen($int) > 0) { |
|
663 | 663 | $concat_flag = false; |
664 | 664 | } |
665 | 665 | } |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | $slice = array_slice($arr, $offset + 1, $length); |
706 | 706 | return implode("", $slice); |
707 | 707 | } else { |
708 | - return mb_substr($string,$offset,$length,'UTF-8'); |
|
708 | + return mb_substr($string, $offset, $length, 'UTF-8'); |
|
709 | 709 | } |
710 | 710 | } |
711 | 711 | |
@@ -715,14 +715,14 @@ discard block |
||
715 | 715 | //NOTE: use a trailing slash for folders!!! |
716 | 716 | //see http://bugs.php.net/bug.php?id=27609 |
717 | 717 | //see http://bugs.php.net/bug.php?id=30931 |
718 | - if ($path{strlen($path)-1}=='/') // recursively return a temporary file path |
|
718 | + if ($path{strlen($path) - 1} == '/') // recursively return a temporary file path |
|
719 | 719 | return $this->is__writable($path.uniqid(mt_rand()).'.tmp'); |
720 | 720 | else if (is_dir($path)) |
721 | 721 | return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp'); |
722 | 722 | // check tmp file for read/write capabilities |
723 | 723 | $rm = file_exists($path); |
724 | 724 | $f = @fopen($path, 'a'); |
725 | - if ($f===false) |
|
725 | + if ($f === false) |
|
726 | 726 | return false; |
727 | 727 | fclose($f); |
728 | 728 | if (!$rm) |
@@ -37,8 +37,11 @@ discard block |
||
37 | 37 | } else { |
38 | 38 | curl_setopt($ch, CURLOPT_USERAGENT, $useragent); |
39 | 39 | } |
40 | - if ($timeout == '') curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
|
41 | - else curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
|
40 | + if ($timeout == '') { |
|
41 | + curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
|
42 | + } else { |
|
43 | + curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
|
44 | + } |
|
42 | 45 | curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common',"curlResponseHeaderCallback")); |
43 | 46 | if ($type == 'post') { |
44 | 47 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
@@ -95,8 +98,9 @@ discard block |
||
95 | 98 | private function curlResponseHeaderCallback($ch, $headerLine) { |
96 | 99 | //global $cookies; |
97 | 100 | $cookies = array(); |
98 | - if (preg_match('/^Set-Cookie:\s*([^;]*)/mi', $headerLine, $cookie) == 1) |
|
99 | - $cookies[] = $cookie; |
|
101 | + if (preg_match('/^Set-Cookie:\s*([^;]*)/mi', $headerLine, $cookie) == 1) { |
|
102 | + $cookies[] = $cookie; |
|
103 | + } |
|
100 | 104 | return strlen($headerLine); // Needed by curl |
101 | 105 | } |
102 | 106 | |
@@ -107,7 +111,9 @@ discard block |
||
107 | 111 | curl_setopt($ch, CURLOPT_URL, $url); |
108 | 112 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
109 | 113 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
110 | - if ($referer != '') curl_setopt($ch, CURLOPT_REFERER, $referer); |
|
114 | + if ($referer != '') { |
|
115 | + curl_setopt($ch, CURLOPT_REFERER, $referer); |
|
116 | + } |
|
111 | 117 | if (isset($globalForceIPv4) && $globalForceIPv4) { |
112 | 118 | if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){ |
113 | 119 | curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); |
@@ -119,7 +125,9 @@ discard block |
||
119 | 125 | curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5'); |
120 | 126 | curl_setopt($ch, CURLOPT_FILE, $fp); |
121 | 127 | curl_exec($ch); |
122 | - if (curl_errno($ch) && $globalDebug) echo 'Download error: '.curl_error($ch); |
|
128 | + if (curl_errno($ch) && $globalDebug) { |
|
129 | + echo 'Download error: '.curl_error($ch); |
|
130 | + } |
|
123 | 131 | curl_close($ch); |
124 | 132 | fclose($fp); |
125 | 133 | } |
@@ -127,12 +135,16 @@ discard block |
||
127 | 135 | public static function gunzip($in_file,$out_file_name = '') { |
128 | 136 | //echo $in_file.' -> '.$out_file_name."\n"; |
129 | 137 | $buffer_size = 4096; // read 4kb at a time |
130 | - if ($out_file_name == '') $out_file_name = str_replace('.gz', '', $in_file); |
|
138 | + if ($out_file_name == '') { |
|
139 | + $out_file_name = str_replace('.gz', '', $in_file); |
|
140 | + } |
|
131 | 141 | if ($in_file != '' && file_exists($in_file)) { |
132 | 142 | // PHP version of Ubuntu use gzopen64 instead of gzopen |
133 | - if (function_exists('gzopen')) $file = gzopen($in_file,'rb'); |
|
134 | - elseif (function_exists('gzopen64')) $file = gzopen64($in_file,'rb'); |
|
135 | - else { |
|
143 | + if (function_exists('gzopen')) { |
|
144 | + $file = gzopen($in_file,'rb'); |
|
145 | + } elseif (function_exists('gzopen64')) { |
|
146 | + $file = gzopen64($in_file,'rb'); |
|
147 | + } else { |
|
136 | 148 | echo 'gzopen not available'; |
137 | 149 | die; |
138 | 150 | } |
@@ -148,11 +160,14 @@ discard block |
||
148 | 160 | public static function bunzip2($in_file,$out_file_name = '') { |
149 | 161 | //echo $in_file.' -> '.$out_file_name."\n"; |
150 | 162 | $buffer_size = 4096; // read 4kb at a time |
151 | - if ($out_file_name == '') $out_file_name = str_replace('.bz2', '', $in_file); |
|
163 | + if ($out_file_name == '') { |
|
164 | + $out_file_name = str_replace('.bz2', '', $in_file); |
|
165 | + } |
|
152 | 166 | if ($in_file != '' && file_exists($in_file)) { |
153 | 167 | // PHP version of Ubuntu use gzopen64 instead of gzopen |
154 | - if (function_exists('bzopen')) $file = bzopen($in_file,'rb'); |
|
155 | - else { |
|
168 | + if (function_exists('bzopen')) { |
|
169 | + $file = bzopen($in_file,'rb'); |
|
170 | + } else { |
|
156 | 171 | echo 'bzopen not available'; |
157 | 172 | die; |
158 | 173 | } |
@@ -171,10 +186,16 @@ discard block |
||
171 | 186 | * @return Array array of the tables in HTML page |
172 | 187 | */ |
173 | 188 | public function table2array($data) { |
174 | - if (!is_string($data)) return array(); |
|
175 | - if ($data == '') return array(); |
|
189 | + if (!is_string($data)) { |
|
190 | + return array(); |
|
191 | + } |
|
192 | + if ($data == '') { |
|
193 | + return array(); |
|
194 | + } |
|
176 | 195 | $html = str_get_html($data); |
177 | - if ($html === false) return array(); |
|
196 | + if ($html === false) { |
|
197 | + return array(); |
|
198 | + } |
|
178 | 199 | $tabledata=array(); |
179 | 200 | foreach($html->find('tr') as $element) |
180 | 201 | { |
@@ -209,7 +230,9 @@ discard block |
||
209 | 230 | */ |
210 | 231 | public function text2array($data) { |
211 | 232 | $html = str_get_html($data); |
212 | - if ($html === false) return array(); |
|
233 | + if ($html === false) { |
|
234 | + return array(); |
|
235 | + } |
|
213 | 236 | $tabledata=array(); |
214 | 237 | foreach($html->find('p') as $element) |
215 | 238 | { |
@@ -230,7 +253,9 @@ discard block |
||
230 | 253 | * @return Float Distance in $unit |
231 | 254 | */ |
232 | 255 | public function distance($lat, $lon, $latc, $lonc, $unit = 'km') { |
233 | - if ($lat == $latc && $lon == $lonc) return 0; |
|
256 | + if ($lat == $latc && $lon == $lonc) { |
|
257 | + return 0; |
|
258 | + } |
|
234 | 259 | $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515; |
235 | 260 | if ($unit == "km") { |
236 | 261 | return round($dist * 1.609344); |
@@ -269,7 +294,9 @@ discard block |
||
269 | 294 | $dX = $latc - $lat; |
270 | 295 | $dY = $lonc - $lon; |
271 | 296 | $azimuth = rad2deg(atan2($dY,$dX)); |
272 | - if ($azimuth < 0) return $azimuth+360; |
|
297 | + if ($azimuth < 0) { |
|
298 | + return $azimuth+360; |
|
299 | + } |
|
273 | 300 | return $azimuth; |
274 | 301 | } |
275 | 302 | |
@@ -283,10 +310,16 @@ discard block |
||
283 | 310 | public function withinThreshold ($timeDifference, $distance) { |
284 | 311 | $x = abs($timeDifference); |
285 | 312 | $d = abs($distance); |
286 | - if ($x == 0 || $d == 0) return true; |
|
313 | + if ($x == 0 || $d == 0) { |
|
314 | + return true; |
|
315 | + } |
|
287 | 316 | // may be due to Internet jitter; distance is realistic |
288 | - if ($x < 0.7 && $d < 2000) return true; |
|
289 | - else return $d/$x < 1500*0.27778; // 1500 km/h max |
|
317 | + if ($x < 0.7 && $d < 2000) { |
|
318 | + return true; |
|
319 | + } else { |
|
320 | + return $d/$x < 1500*0.27778; |
|
321 | + } |
|
322 | + // 1500 km/h max |
|
290 | 323 | } |
291 | 324 | |
292 | 325 | |
@@ -314,11 +347,17 @@ discard block |
||
314 | 347 | |
315 | 348 | public function convertDM($coord,$latlong) { |
316 | 349 | if ($latlong == 'latitude') { |
317 | - if ($coord < 0) $NSEW = 'S'; |
|
318 | - else $NSEW = 'N'; |
|
350 | + if ($coord < 0) { |
|
351 | + $NSEW = 'S'; |
|
352 | + } else { |
|
353 | + $NSEW = 'N'; |
|
354 | + } |
|
319 | 355 | } else { |
320 | - if ($coord < 0) $NSEW = 'W'; |
|
321 | - else $NSEW = 'E'; |
|
356 | + if ($coord < 0) { |
|
357 | + $NSEW = 'W'; |
|
358 | + } else { |
|
359 | + $NSEW = 'E'; |
|
360 | + } |
|
322 | 361 | } |
323 | 362 | $coord = abs($coord); |
324 | 363 | $deg = floor($coord); |
@@ -361,7 +400,9 @@ discard block |
||
361 | 400 | public function hex2str($hex) { |
362 | 401 | $str = ''; |
363 | 402 | $hexln = strlen($hex); |
364 | - for($i=0;$i<$hexln;$i+=2) $str .= chr(hexdec(substr($hex,$i,2))); |
|
403 | + for($i=0;$i<$hexln;$i+=2) { |
|
404 | + $str .= chr(hexdec(substr($hex,$i,2))); |
|
405 | + } |
|
365 | 406 | return $str; |
366 | 407 | } |
367 | 408 | |
@@ -398,8 +439,11 @@ discard block |
||
398 | 439 | $b = $lat2 - $lat1; |
399 | 440 | $c = -($a*$lat1+$b*$lon1); |
400 | 441 | $d = $a*$lat3+$b*$lon3+$c; |
401 | - if ($d > -$approx && $d < $approx) return true; |
|
402 | - else return false; |
|
442 | + if ($d > -$approx && $d < $approx) { |
|
443 | + return true; |
|
444 | + } else { |
|
445 | + return false; |
|
446 | + } |
|
403 | 447 | } |
404 | 448 | |
405 | 449 | public function array_merge_noappend() { |
@@ -458,7 +502,9 @@ discard block |
||
458 | 502 | return $result; |
459 | 503 | } |
460 | 504 | $handle = @opendir('./locale'); |
461 | - if ($handle === false) return $result; |
|
505 | + if ($handle === false) { |
|
506 | + return $result; |
|
507 | + } |
|
462 | 508 | while (false !== ($file = readdir($handle))) { |
463 | 509 | $path = './locale'.'/'.$file.'/LC_MESSAGES/fam.mo'; |
464 | 510 | if ($file != "." && $file != ".." && @file_exists($path)) { |
@@ -529,8 +575,9 @@ discard block |
||
529 | 575 | $error = false; |
530 | 576 | if ($fp_out = gzopen($dest, $mode)) { |
531 | 577 | if ($fp_in = fopen($source,'rb')) { |
532 | - while (!feof($fp_in)) |
|
533 | - gzwrite($fp_out, fread($fp_in, 1024 * 512)); |
|
578 | + while (!feof($fp_in)) { |
|
579 | + gzwrite($fp_out, fread($fp_in, 1024 * 512)); |
|
580 | + } |
|
534 | 581 | fclose($fp_in); |
535 | 582 | } else { |
536 | 583 | $error = true; |
@@ -539,14 +586,17 @@ discard block |
||
539 | 586 | } else { |
540 | 587 | $error = true; |
541 | 588 | } |
542 | - if ($error) |
|
543 | - return false; |
|
544 | - else |
|
545 | - return $dest; |
|
589 | + if ($error) { |
|
590 | + return false; |
|
591 | + } else { |
|
592 | + return $dest; |
|
593 | + } |
|
546 | 594 | } |
547 | 595 | |
548 | 596 | public function remove_accents($string) { |
549 | - if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
|
597 | + if ( !preg_match('/[\x80-\xff]/', $string) ) { |
|
598 | + return $string; |
|
599 | + } |
|
550 | 600 | $chars = array( |
551 | 601 | // Decompositions for Latin-1 Supplement |
552 | 602 | chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
@@ -670,7 +720,9 @@ discard block |
||
670 | 720 | $ip = gethostbyname($host); |
671 | 721 | $s = socket_create(AF_INET, SOCK_STREAM, 0); |
672 | 722 | $r = @socket_connect($s, $ip, $port); |
673 | - if (!socket_set_nonblock($s)) echo "Unable to set nonblock on socket\n"; |
|
723 | + if (!socket_set_nonblock($s)) { |
|
724 | + echo "Unable to set nonblock on socket\n"; |
|
725 | + } |
|
674 | 726 | if ($r || socket_last_error() == 114 || socket_last_error() == 115) { |
675 | 727 | return $s; |
676 | 728 | } |
@@ -715,18 +767,22 @@ discard block |
||
715 | 767 | //NOTE: use a trailing slash for folders!!! |
716 | 768 | //see http://bugs.php.net/bug.php?id=27609 |
717 | 769 | //see http://bugs.php.net/bug.php?id=30931 |
718 | - if ($path{strlen($path)-1}=='/') // recursively return a temporary file path |
|
770 | + if ($path{strlen($path)-1}=='/') { |
|
771 | + // recursively return a temporary file path |
|
719 | 772 | return $this->is__writable($path.uniqid(mt_rand()).'.tmp'); |
720 | - else if (is_dir($path)) |
|
721 | - return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp'); |
|
773 | + } else if (is_dir($path)) { |
|
774 | + return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp'); |
|
775 | + } |
|
722 | 776 | // check tmp file for read/write capabilities |
723 | 777 | $rm = file_exists($path); |
724 | 778 | $f = @fopen($path, 'a'); |
725 | - if ($f===false) |
|
726 | - return false; |
|
779 | + if ($f===false) { |
|
780 | + return false; |
|
781 | + } |
|
727 | 782 | fclose($f); |
728 | - if (!$rm) |
|
729 | - unlink($path); |
|
783 | + if (!$rm) { |
|
784 | + unlink($path); |
|
785 | + } |
|
730 | 786 | return true; |
731 | 787 | } |
732 | 788 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | <?php }; if (isset($globalSatellite) && $globalSatellite) { ?><td><div id="ibxsatellite"><h4><?php echo _("Satellites Displayed"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div></td><?php } ?> |
48 | 48 | </tr></table></div> |
49 | 49 | <?php |
50 | - if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
50 | + if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
51 | 51 | ?> |
52 | 52 | <script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script> |
53 | 53 | <?php |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | <script src="<?php echo $globalURL; ?>/js/map-marine.3d.js.php"></script> |
72 | 72 | <?php |
73 | 73 | } |
74 | - } |
|
74 | + } |
|
75 | 75 | ?> |
76 | 76 | |
77 | 77 | <div id="sidebar" class="sidebar collapsed"> |
@@ -82,34 +82,34 @@ discard block |
||
82 | 82 | <li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li> |
83 | 83 | <li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li> |
84 | 84 | <?php |
85 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
85 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
86 | 86 | if (isset($globalArchive) && $globalArchive == TRUE) { |
87 | 87 | ?> |
88 | 88 | <li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li> |
89 | 89 | <?php |
90 | 90 | } |
91 | - } |
|
91 | + } |
|
92 | 92 | ?> |
93 | 93 | <li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li> |
94 | 94 | <li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li> |
95 | 95 | <li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li> |
96 | 96 | <?php |
97 | - if (isset($globalMap3D) && $globalMap3D) { |
|
97 | + if (isset($globalMap3D) && $globalMap3D) { |
|
98 | 98 | if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
99 | 99 | ?> |
100 | 100 | <li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li> |
101 | 101 | <?php |
102 | - if (isset($globalSatellite) && $globalSatellite) { |
|
102 | + if (isset($globalSatellite) && $globalSatellite) { |
|
103 | 103 | ?> |
104 | 104 | <li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li> |
105 | 105 | <?php |
106 | - } |
|
106 | + } |
|
107 | 107 | } else { |
108 | 108 | ?> |
109 | 109 | <li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li> |
110 | 110 | <?php |
111 | 111 | } |
112 | - } |
|
112 | + } |
|
113 | 113 | ?> |
114 | 114 | </ul> |
115 | 115 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | ?> |
185 | 185 | </div> |
186 | 186 | <?php |
187 | - if (isset($globalArchive) && $globalArchive == TRUE) { |
|
187 | + if (isset($globalArchive) && $globalArchive == TRUE) { |
|
188 | 188 | ?> |
189 | 189 | <div class="sidebar-pane" id="archive"> |
190 | 190 | <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | </form> |
244 | 244 | </div> |
245 | 245 | <?php |
246 | - } |
|
246 | + } |
|
247 | 247 | ?> |
248 | 248 | <div class="sidebar-pane" id="settings"> |
249 | 249 | <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -254,56 +254,56 @@ discard block |
||
254 | 254 | <?php |
255 | 255 | if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
256 | 256 | else $MapType = $_COOKIE['MapType']; |
257 | - ?> |
|
257 | + ?> |
|
258 | 258 | <?php |
259 | 259 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
260 | - ?> |
|
260 | + ?> |
|
261 | 261 | <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
262 | 262 | <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
263 | 263 | <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
264 | 264 | <?php |
265 | 265 | } |
266 | - ?> |
|
266 | + ?> |
|
267 | 267 | <?php |
268 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
269 | - ?> |
|
268 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
269 | + ?> |
|
270 | 270 | <?php |
271 | - if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
272 | - ?> |
|
271 | + if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
272 | + ?> |
|
273 | 273 | <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
274 | 274 | <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
275 | 275 | <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
276 | 276 | <?php |
277 | - } |
|
278 | - ?> |
|
277 | + } |
|
278 | + ?> |
|
279 | 279 | <?php |
280 | - if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
|
281 | - ?> |
|
280 | + if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
|
281 | + ?> |
|
282 | 282 | <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
283 | 283 | <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
284 | 284 | <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
285 | 285 | <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
286 | 286 | <?php |
287 | - } |
|
288 | - ?> |
|
287 | + } |
|
288 | + ?> |
|
289 | 289 | <?php |
290 | - if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
|
291 | - ?> |
|
290 | + if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
|
291 | + ?> |
|
292 | 292 | <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
293 | 293 | <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
294 | 294 | <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
295 | 295 | <?php |
296 | - } |
|
297 | - ?> |
|
296 | + } |
|
297 | + ?> |
|
298 | 298 | <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
299 | 299 | <?php |
300 | 300 | } |
301 | - ?> |
|
301 | + ?> |
|
302 | 302 | <?php |
303 | - if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
303 | + if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
304 | 304 | if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
305 | 305 | else $MapBoxId = $_COOKIE['MapTypeId']; |
306 | - ?> |
|
306 | + ?> |
|
307 | 307 | <!-- <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option> --> |
308 | 308 | <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
309 | 309 | <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
@@ -318,13 +318,13 @@ discard block |
||
318 | 318 | <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
319 | 319 | <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
320 | 320 | <?php |
321 | - } |
|
322 | - ?> |
|
321 | + } |
|
322 | + ?> |
|
323 | 323 | <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
324 | 324 | </select> |
325 | 325 | </li> |
326 | 326 | <?php |
327 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
327 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
328 | 328 | ?> |
329 | 329 | <li><?php echo _("Type of Terrain:"); ?> |
330 | 330 | <select class="selectpicker" onchange="terrainType(this);"> |
@@ -335,10 +335,10 @@ discard block |
||
335 | 335 | </select> |
336 | 336 | </li> |
337 | 337 | <?php |
338 | - } |
|
338 | + } |
|
339 | 339 | ?> |
340 | 340 | <?php |
341 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
341 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
342 | 342 | ?> |
343 | 343 | <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if ((isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') || (!isset($_COOKIE['Map2DBuildings']))) print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
344 | 344 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
358 | 358 | <?php |
359 | 359 | } |
360 | - } |
|
360 | + } |
|
361 | 361 | ?> |
362 | 362 | <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
363 | 363 | <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
@@ -369,81 +369,81 @@ discard block |
||
369 | 369 | <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) print 'checked'; ?> ><?php echo _("Display fires on map"); ?></label></div></li> |
370 | 370 | <?php |
371 | 371 | } |
372 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
372 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
373 | 373 | ?> |
374 | 374 | <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
375 | 375 | <?php |
376 | - } |
|
377 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
376 | + } |
|
377 | + if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
378 | 378 | ?> |
379 | 379 | <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li> |
380 | 380 | <?php |
381 | - } |
|
381 | + } |
|
382 | 382 | ?> |
383 | 383 | <?php |
384 | 384 | if (function_exists('array_column')) { |
385 | - if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
386 | - ?> |
|
385 | + if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
386 | + ?> |
|
387 | 387 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
388 | 388 | <?php |
389 | - } |
|
389 | + } |
|
390 | 390 | } elseif (isset($globalSources)) { |
391 | - $dispolar = false; |
|
392 | - foreach ($globalSources as $testsource) { |
|
393 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
394 | - } |
|
395 | - if ($dispolar) { |
|
396 | - ?> |
|
391 | + $dispolar = false; |
|
392 | + foreach ($globalSources as $testsource) { |
|
393 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
394 | + } |
|
395 | + if ($dispolar) { |
|
396 | + ?> |
|
397 | 397 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
398 | 398 | <?php |
399 | - } |
|
400 | - } |
|
401 | - ?> |
|
399 | + } |
|
400 | + } |
|
401 | + ?> |
|
402 | 402 | <?php |
403 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
403 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
404 | 404 | ?> |
405 | 405 | |
406 | 406 | <?php |
407 | 407 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
408 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
409 | - ?> |
|
408 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
409 | + ?> |
|
410 | 410 | <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
411 | 411 | <?php |
412 | 412 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
413 | - ?> |
|
413 | + ?> |
|
414 | 414 | <li><?php echo _("Aircraft icon color:"); ?> |
415 | 415 | <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"> |
416 | 416 | </li> |
417 | 417 | <?php |
418 | 418 | } |
419 | - } |
|
420 | - } |
|
421 | - ?> |
|
419 | + } |
|
420 | + } |
|
421 | + ?> |
|
422 | 422 | <?php |
423 | 423 | if (isset($globalMarine) && $globalMarine === TRUE) { |
424 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
425 | - ?> |
|
424 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
425 | + ?> |
|
426 | 426 | <li><?php echo _("Marine icon color:"); ?> |
427 | 427 | <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>"> |
428 | 428 | </li> |
429 | 429 | <?php |
430 | - } |
|
431 | - } |
|
432 | - ?> |
|
430 | + } |
|
431 | + } |
|
432 | + ?> |
|
433 | 433 | <?php |
434 | 434 | if (isset($globalTracker) && $globalTracker === TRUE) { |
435 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
436 | - ?> |
|
435 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
436 | + ?> |
|
437 | 437 | <li><?php echo _("Tracker icon color:"); ?> |
438 | 438 | <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>"> |
439 | 439 | </li> |
440 | 440 | <?php |
441 | - } |
|
442 | - } |
|
443 | - ?> |
|
441 | + } |
|
442 | + } |
|
443 | + ?> |
|
444 | 444 | <?php |
445 | 445 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
446 | - ?> |
|
446 | + ?> |
|
447 | 447 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
448 | 448 | <div class="range"> |
449 | 449 | <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
@@ -452,9 +452,9 @@ discard block |
||
452 | 452 | </li> |
453 | 453 | <?php |
454 | 454 | } |
455 | - ?> |
|
455 | + ?> |
|
456 | 456 | <?php |
457 | - } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
457 | + } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
458 | 458 | ?> |
459 | 459 | <?php |
460 | 460 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | </li> |
487 | 487 | <?php |
488 | 488 | } |
489 | - } |
|
489 | + } |
|
490 | 490 | ?> |
491 | 491 | <li><?php echo _("Distance unit:"); ?> |
492 | 492 | <select class="selectpicker" onchange="unitdistance(this);"> |
@@ -519,19 +519,19 @@ discard block |
||
519 | 519 | <ul> |
520 | 520 | <?php |
521 | 521 | if (!isset($globalAircraft) || $globalAircraft) { |
522 | - ?> |
|
522 | + ?> |
|
523 | 523 | <?php |
524 | 524 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
525 | - ?> |
|
525 | + ?> |
|
526 | 526 | <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
527 | 527 | <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
528 | 528 | <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
529 | 529 | <?php |
530 | 530 | } |
531 | - ?> |
|
531 | + ?> |
|
532 | 532 | <?php |
533 | 533 | if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
534 | - ?> |
|
534 | + ?> |
|
535 | 535 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
536 | 536 | <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
537 | 537 | <?php } ?> |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | <?php } ?> |
541 | 541 | <?php |
542 | 542 | } |
543 | - ?> |
|
543 | + ?> |
|
544 | 544 | <li><?php echo _("Display airlines:"); ?> |
545 | 545 | <br/> |
546 | 546 | <select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines"> |
@@ -560,14 +560,14 @@ discard block |
||
560 | 560 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
561 | 561 | } |
562 | 562 | } |
563 | - ?> |
|
563 | + ?> |
|
564 | 564 | </select> |
565 | 565 | </li> |
566 | 566 | <?php |
567 | 567 | $Spotter = new Spotter(); |
568 | 568 | $allalliancenames = $Spotter->getAllAllianceNames(); |
569 | 569 | if (!empty($allalliancenames)) { |
570 | - ?> |
|
570 | + ?> |
|
571 | 571 | <li><?php echo _("Display alliance:"); ?> |
572 | 572 | <br/> |
573 | 573 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
@@ -581,18 +581,18 @@ discard block |
||
581 | 581 | echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>'; |
582 | 582 | } |
583 | 583 | } |
584 | - ?> |
|
584 | + ?> |
|
585 | 585 | </select> |
586 | 586 | </li> |
587 | 587 | <?php |
588 | 588 | } |
589 | - ?> |
|
589 | + ?> |
|
590 | 590 | <?php |
591 | 591 | } |
592 | - ?> |
|
592 | + ?> |
|
593 | 593 | <?php |
594 | 594 | if (isset($globalAPRS) && $globalAPRS) { |
595 | - ?> |
|
595 | + ?> |
|
596 | 596 | <li><?php echo _("Display APRS sources name:"); ?> |
597 | 597 | <select class="selectpicker" multiple onchange="sources(this);"> |
598 | 598 | <?php |
@@ -616,18 +616,18 @@ discard block |
||
616 | 616 | echo '<option value="'.$src['name'].'">'.$src['name'].'</option>'; |
617 | 617 | } |
618 | 618 | } |
619 | - ?> |
|
619 | + ?> |
|
620 | 620 | </select> |
621 | 621 | </li> |
622 | 622 | <?php |
623 | 623 | } |
624 | - ?> |
|
624 | + ?> |
|
625 | 625 | <?php |
626 | 626 | if (!isset($globalAircraft) || $globalAircraft) { |
627 | - ?> |
|
627 | + ?> |
|
628 | 628 | <?php |
629 | - if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
|
630 | - ?> |
|
629 | + if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
|
630 | + ?> |
|
631 | 631 | <li><?php echo _("Display airlines of type:"); ?><br/> |
632 | 632 | <select class="selectpicker" onchange="airlinestype(this);"> |
633 | 633 | <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
@@ -637,21 +637,21 @@ discard block |
||
637 | 637 | </select> |
638 | 638 | </li> |
639 | 639 | <?php |
640 | - } |
|
641 | - ?> |
|
640 | + } |
|
641 | + ?> |
|
642 | 642 | <?php |
643 | 643 | } |
644 | - ?> |
|
644 | + ?> |
|
645 | 645 | <?php |
646 | 646 | if (isset($globalMarine) && $globalMarine) { |
647 | - ?> |
|
647 | + ?> |
|
648 | 648 | <li> |
649 | 649 | <?php echo _("Display vessels with MMSI:"); ?> |
650 | 650 | <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" /> |
651 | 651 | </li> |
652 | 652 | <?php |
653 | 653 | } |
654 | - ?> |
|
654 | + ?> |
|
655 | 655 | <li> |
656 | 656 | <?php echo _("Display with ident:"); ?> |
657 | 657 | <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | </form> |
665 | 665 | </div> |
666 | 666 | <?php |
667 | - if (isset($globalSatellite) && $globalSatellite) { |
|
667 | + if (isset($globalSatellite) && $globalSatellite) { |
|
668 | 668 | ?> |
669 | 669 | <div class="sidebar-pane" id="satellites"> |
670 | 670 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -704,14 +704,14 @@ discard block |
||
704 | 704 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
705 | 705 | } |
706 | 706 | } |
707 | - ?> |
|
707 | + ?> |
|
708 | 708 | </select> |
709 | 709 | </li> |
710 | 710 | </ul> |
711 | 711 | </form> |
712 | 712 | </div> |
713 | 713 | <?php |
714 | - } |
|
714 | + } |
|
715 | 715 | ?> |
716 | 716 | </div> |
717 | 717 | </div> |
@@ -49,7 +49,10 @@ discard block |
||
49 | 49 | <?php |
50 | 50 | if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
51 | 51 | ?> |
52 | -<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script> |
|
52 | +<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) { |
|
53 | + print '?tsk='.$tsk; |
|
54 | +} |
|
55 | +?>"></script> |
|
53 | 56 | <?php |
54 | 57 | if (!isset($globalAircraft) || $globalAircraft) { |
55 | 58 | ?> |
@@ -163,11 +166,26 @@ discard block |
||
163 | 166 | <li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam();" /><?php echo _("Display NOTAM"); ?></label></div></li> |
164 | 167 | <li><?php echo _("NOTAM scope:"); ?> |
165 | 168 | <select class="selectpicker" onchange="notamscope(this);"> |
166 | - <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option> |
|
167 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option> |
|
168 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option> |
|
169 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option> |
|
170 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option> |
|
169 | + <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') { |
|
170 | + print ' selected'; |
|
171 | +} |
|
172 | +?>>All</option> |
|
173 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') { |
|
174 | + print ' selected'; |
|
175 | +} |
|
176 | +?>>Airport/Enroute warning</option> |
|
177 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') { |
|
178 | + print ' selected'; |
|
179 | +} |
|
180 | +?>>Airport warning</option> |
|
181 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') { |
|
182 | + print ' selected'; |
|
183 | +} |
|
184 | +?>>Navigation warning</option> |
|
185 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') { |
|
186 | + print ' selected'; |
|
187 | +} |
|
188 | +?>>Enroute warning</option> |
|
171 | 189 | </select |
172 | 190 | </li> |
173 | 191 | </ul> |
@@ -195,7 +213,12 @@ discard block |
||
195 | 213 | <div class="form-group"> |
196 | 214 | <label>From (UTC):</label> |
197 | 215 | <div class='input-group date' id='datetimepicker1'> |
198 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required /> |
|
216 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) { |
|
217 | + print $_POST['start_date']; |
|
218 | +} elseif (isset($_COOKIE['archive_begin'])) { |
|
219 | + print date("m/d/Y h:i a",$_COOKIE['archive_begin']); |
|
220 | +} |
|
221 | +?>" required /> |
|
199 | 222 | <span class="input-group-addon"> |
200 | 223 | <span class="glyphicon glyphicon-calendar"></span> |
201 | 224 | </span> |
@@ -204,7 +227,12 @@ discard block |
||
204 | 227 | <div class="form-group"> |
205 | 228 | <label>To (UTC):</label> |
206 | 229 | <div class='input-group date' id='datetimepicker2'> |
207 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" /> |
|
230 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) { |
|
231 | + print $_POST['end_date']; |
|
232 | +} elseif (isset($_COOKIE['archive_end'])) { |
|
233 | + print date("m/d/Y h:i a",$_COOKIE['archive_end']); |
|
234 | +} |
|
235 | +?>" /> |
|
208 | 236 | <span class="input-group-addon"> |
209 | 237 | <span class="glyphicon glyphicon-calendar"></span> |
210 | 238 | </span> |
@@ -229,8 +257,20 @@ discard block |
||
229 | 257 | </script> |
230 | 258 | <li><?php echo _("Playback speed:"); ?> |
231 | 259 | <div class="range"> |
232 | - <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>"> |
|
233 | - <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output> |
|
260 | + <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) { |
|
261 | + print $_POST['archivespeed']; |
|
262 | +} elseif (isset($_COOKIE['archive_speed'])) { |
|
263 | + print $_COOKIE['archive_speed']; |
|
264 | +} else { |
|
265 | + print '1'; |
|
266 | +} |
|
267 | +?>"> |
|
268 | + <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) { |
|
269 | + print $_COOKIE['archive_speed']; |
|
270 | +} else { |
|
271 | + print '1'; |
|
272 | +} |
|
273 | +?></output> |
|
234 | 274 | </div> |
235 | 275 | </li> |
236 | 276 | <li><input type="submit" name="archive" value="Show archive" class="btn btn-primary" /></li> |
@@ -252,15 +292,27 @@ discard block |
||
252 | 292 | <li><?php echo _("Type of Map:"); ?> |
253 | 293 | <select class="selectpicker" onchange="mapType(this);"> |
254 | 294 | <?php |
255 | - if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
|
256 | - else $MapType = $_COOKIE['MapType']; |
|
295 | + if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') { |
|
296 | + $MapType = $globalMapProvider; |
|
297 | + } else { |
|
298 | + $MapType = $_COOKIE['MapType']; |
|
299 | + } |
|
257 | 300 | ?> |
258 | 301 | <?php |
259 | 302 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
260 | 303 | ?> |
261 | - <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
|
262 | - <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
|
263 | - <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
|
304 | + <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') { |
|
305 | + print ' selected'; |
|
306 | +} |
|
307 | +?>>Bing-Aerial</option> |
|
308 | + <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') { |
|
309 | + print ' selected'; |
|
310 | +} |
|
311 | +?>>Bing-Hybrid</option> |
|
312 | + <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') { |
|
313 | + print ' selected'; |
|
314 | +} |
|
315 | +?>>Bing-Road</option> |
|
264 | 316 | <?php |
265 | 317 | } |
266 | 318 | ?> |
@@ -270,57 +322,135 @@ discard block |
||
270 | 322 | <?php |
271 | 323 | if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
272 | 324 | ?> |
273 | - <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
|
274 | - <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
|
275 | - <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
|
325 | + <option value="Here-Aerial"<?php if ($MapType == 'Here') { |
|
326 | + print ' selected'; |
|
327 | +} |
|
328 | +?>>Here-Aerial</option> |
|
329 | + <option value="Here-Hybrid"<?php if ($MapType == 'Here') { |
|
330 | + print ' selected'; |
|
331 | +} |
|
332 | +?>>Here-Hybrid</option> |
|
333 | + <option value="Here-Road"<?php if ($MapType == 'Here') { |
|
334 | + print ' selected'; |
|
335 | +} |
|
336 | +?>>Here-Road</option> |
|
276 | 337 | <?php |
277 | 338 | } |
278 | 339 | ?> |
279 | 340 | <?php |
280 | 341 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
281 | 342 | ?> |
282 | - <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
|
283 | - <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
|
284 | - <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
|
285 | - <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
|
343 | + <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') { |
|
344 | + print ' selected'; |
|
345 | +} |
|
346 | +?>>Google Roadmap</option> |
|
347 | + <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') { |
|
348 | + print ' selected'; |
|
349 | +} |
|
350 | +?>>Google Satellite</option> |
|
351 | + <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') { |
|
352 | + print ' selected'; |
|
353 | +} |
|
354 | +?>>Google Hybrid</option> |
|
355 | + <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') { |
|
356 | + print ' selected'; |
|
357 | +} |
|
358 | +?>>Google Terrain</option> |
|
286 | 359 | <?php |
287 | 360 | } |
288 | 361 | ?> |
289 | 362 | <?php |
290 | 363 | if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
291 | 364 | ?> |
292 | - <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
|
293 | - <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
|
294 | - <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
|
365 | + <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') { |
|
366 | + print ' selected'; |
|
367 | +} |
|
368 | +?>>MapQuest-OSM</option> |
|
369 | + <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') { |
|
370 | + print ' selected'; |
|
371 | +} |
|
372 | +?>>MapQuest-Aerial</option> |
|
373 | + <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') { |
|
374 | + print ' selected'; |
|
375 | +} |
|
376 | +?>>MapQuest-Hybrid</option> |
|
295 | 377 | <?php |
296 | 378 | } |
297 | 379 | ?> |
298 | - <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
|
380 | + <option value="Yandex"<?php if ($MapType == 'Yandex') { |
|
381 | + print ' selected'; |
|
382 | +} |
|
383 | +?>>Yandex</option> |
|
299 | 384 | <?php |
300 | 385 | } |
301 | 386 | ?> |
302 | 387 | <?php |
303 | 388 | if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
304 | - if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
|
305 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
389 | + if (!isset($_COOKIE['MapTypeId'])) { |
|
390 | + $MapBoxId = 'default'; |
|
391 | + } else { |
|
392 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
393 | + } |
|
306 | 394 | ?> |
307 | - <!-- <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option> --> |
|
308 | - <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
|
309 | - <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
|
310 | - <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option> |
|
311 | - <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option> |
|
312 | - <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option> |
|
313 | - <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option> |
|
314 | - <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option> |
|
315 | - <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option> |
|
316 | - <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option> |
|
317 | - <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option> |
|
318 | - <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
|
319 | - <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
|
395 | + <!-- <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') { |
|
396 | + print ' selected'; |
|
397 | +} |
|
398 | +?>>Mapbox GL</option> --> |
|
399 | + <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') { |
|
400 | + print ' selected'; |
|
401 | +} |
|
402 | +?>>Mapbox default</option> |
|
403 | + <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') { |
|
404 | + print ' selected'; |
|
405 | +} |
|
406 | +?>>Mapbox streets</option> |
|
407 | + <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') { |
|
408 | + print ' selected'; |
|
409 | +} |
|
410 | +?>>Mapbox light</option> |
|
411 | + <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') { |
|
412 | + print ' selected'; |
|
413 | +} |
|
414 | +?>>Mapbox dark</option> |
|
415 | + <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') { |
|
416 | + print ' selected'; |
|
417 | +} |
|
418 | +?>>Mapbox satellite</option> |
|
419 | + <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') { |
|
420 | + print ' selected'; |
|
421 | +} |
|
422 | +?>>Mapbox streets-satellite</option> |
|
423 | + <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') { |
|
424 | + print ' selected'; |
|
425 | +} |
|
426 | +?>>Mapbox streets-basic</option> |
|
427 | + <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') { |
|
428 | + print ' selected'; |
|
429 | +} |
|
430 | +?>>Mapbox comic</option> |
|
431 | + <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') { |
|
432 | + print ' selected'; |
|
433 | +} |
|
434 | +?>>Mapbox outdoors</option> |
|
435 | + <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') { |
|
436 | + print ' selected'; |
|
437 | +} |
|
438 | +?>>Mapbox pencil</option> |
|
439 | + <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') { |
|
440 | + print ' selected'; |
|
441 | +} |
|
442 | +?>>Mapbox pirates</option> |
|
443 | + <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') { |
|
444 | + print ' selected'; |
|
445 | +} |
|
446 | +?>>Mapbox emerald</option> |
|
320 | 447 | <?php |
321 | 448 | } |
322 | 449 | ?> |
323 | - <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
|
450 | + <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') { |
|
451 | + print ' selected'; |
|
452 | +} |
|
453 | +?>>OpenStreetMap</option> |
|
324 | 454 | </select> |
325 | 455 | </li> |
326 | 456 | <?php |
@@ -328,10 +458,22 @@ discard block |
||
328 | 458 | ?> |
329 | 459 | <li><?php echo _("Type of Terrain:"); ?> |
330 | 460 | <select class="selectpicker" onchange="terrainType(this);"> |
331 | - <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> |
|
332 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> |
|
333 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> |
|
334 | - <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option> |
|
461 | + <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') { |
|
462 | + print ' selected'; |
|
463 | +} |
|
464 | +?>>stk terrain</option> |
|
465 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') { |
|
466 | + print ' selected'; |
|
467 | +} |
|
468 | +?>>ellipsoid</option> |
|
469 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') { |
|
470 | + print ' selected'; |
|
471 | +} |
|
472 | +?>>vr terrain</option> |
|
473 | + <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') { |
|
474 | + print ' selected'; |
|
475 | +} |
|
476 | +?>>ArticDEM</option> |
|
335 | 477 | </select> |
336 | 478 | </li> |
337 | 479 | <?php |
@@ -340,38 +482,77 @@ discard block |
||
340 | 482 | <?php |
341 | 483 | if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
342 | 484 | ?> |
343 | - <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if ((isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') || (!isset($_COOKIE['Map2DBuildings']))) print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
|
485 | + <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if ((isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') || (!isset($_COOKIE['Map2DBuildings']))) { |
|
486 | + print 'checked'; |
|
487 | +} |
|
488 | +?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
|
344 | 489 | |
345 | 490 | <?php |
346 | 491 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
347 | 492 | ?> |
348 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li> |
|
349 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
350 | - <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
351 | - <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> |
|
352 | - <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
493 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') { |
|
494 | + print 'checked'; |
|
495 | +} |
|
496 | +?> ><?php echo _("Display flight info as popup"); ?></label></div></li> |
|
497 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) { |
|
498 | + print 'checked'; |
|
499 | +} |
|
500 | +?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
501 | + <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) { |
|
502 | + print 'checked'; |
|
503 | +} |
|
504 | +?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
505 | + <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) { |
|
506 | + print 'checked'; |
|
507 | +} |
|
508 | +?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> |
|
509 | + <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { |
|
510 | + print 'checked'; |
|
511 | +} |
|
512 | +?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
353 | 513 | <?php |
354 | 514 | } |
355 | 515 | if (isset($globalSatellite) && $globalSatellite === TRUE) { |
356 | 516 | ?> |
357 | - <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
|
517 | + <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { |
|
518 | + print 'checked'; |
|
519 | +} |
|
520 | +?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
|
358 | 521 | <?php |
359 | 522 | } |
360 | 523 | } |
361 | 524 | ?> |
362 | - <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
363 | - <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
|
364 | - <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
|
365 | - <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
|
525 | + <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) { |
|
526 | + print 'checked'; |
|
527 | +} |
|
528 | +?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
529 | + <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) { |
|
530 | + print 'checked'; |
|
531 | +} |
|
532 | +?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
|
533 | + <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) { |
|
534 | + print 'checked'; |
|
535 | +} |
|
536 | +?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
|
537 | + <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) { |
|
538 | + print 'checked'; |
|
539 | +} |
|
540 | +?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
|
366 | 541 | <?php |
367 | 542 | if (isset($globalFires)) { |
368 | 543 | ?> |
369 | - <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) print 'checked'; ?> ><?php echo _("Display fires on map"); ?></label></div></li> |
|
544 | + <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) { |
|
545 | + print 'checked'; |
|
546 | +} |
|
547 | +?> ><?php echo _("Display fires on map"); ?></label></div></li> |
|
370 | 548 | <?php |
371 | 549 | } |
372 | 550 | if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
373 | 551 | ?> |
374 | - <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
|
552 | + <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) { |
|
553 | + print 'checked'; |
|
554 | +} |
|
555 | +?> ><?php echo _("Show mini-map"); ?></label></div></li> |
|
375 | 556 | <?php |
376 | 557 | } |
377 | 558 | if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
@@ -384,17 +565,25 @@ discard block |
||
384 | 565 | if (function_exists('array_column')) { |
385 | 566 | if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
386 | 567 | ?> |
387 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
568 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
569 | + print 'checked'; |
|
570 | +} |
|
571 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
388 | 572 | <?php |
389 | 573 | } |
390 | 574 | } elseif (isset($globalSources)) { |
391 | 575 | $dispolar = false; |
392 | 576 | foreach ($globalSources as $testsource) { |
393 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
577 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) { |
|
578 | + $dispolar = true; |
|
579 | + } |
|
394 | 580 | } |
395 | 581 | if ($dispolar) { |
396 | 582 | ?> |
397 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
583 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
584 | + print 'checked'; |
|
585 | +} |
|
586 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
398 | 587 | <?php |
399 | 588 | } |
400 | 589 | } |
@@ -407,12 +596,22 @@ discard block |
||
407 | 596 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
408 | 597 | if (extension_loaded('gd') && function_exists('gd_info')) { |
409 | 598 | ?> |
410 | - <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
599 | + <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') { |
|
600 | + print 'checked'; |
|
601 | +} |
|
602 | +?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
411 | 603 | <?php |
412 | 604 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
413 | 605 | ?> |
414 | 606 | <li><?php echo _("Aircraft icon color:"); ?> |
415 | - <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"> |
|
607 | + <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
608 | + print $_COOKIE['IconColor']; |
|
609 | +} elseif (isset($globalAircraftIconColor)) { |
|
610 | + print $globalAircraftIconColor; |
|
611 | +} else { |
|
612 | + print '1a3151'; |
|
613 | +} |
|
614 | +?>"> |
|
416 | 615 | </li> |
417 | 616 | <?php |
418 | 617 | } |
@@ -424,7 +623,14 @@ discard block |
||
424 | 623 | if (extension_loaded('gd') && function_exists('gd_info')) { |
425 | 624 | ?> |
426 | 625 | <li><?php echo _("Marine icon color:"); ?> |
427 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>"> |
|
626 | + <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { |
|
627 | + print $_COOKIE['MarineIconColor']; |
|
628 | +} elseif (isset($globalMarineIconColor)) { |
|
629 | + print $globalMarineIconColor; |
|
630 | +} else { |
|
631 | + print '1a3151'; |
|
632 | +} |
|
633 | +?>"> |
|
428 | 634 | </li> |
429 | 635 | <?php |
430 | 636 | } |
@@ -435,7 +641,14 @@ discard block |
||
435 | 641 | if (extension_loaded('gd') && function_exists('gd_info')) { |
436 | 642 | ?> |
437 | 643 | <li><?php echo _("Tracker icon color:"); ?> |
438 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>"> |
|
644 | + <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { |
|
645 | + print $_COOKIE['TrackerIconColor']; |
|
646 | +} elseif (isset($globalTrackerIconColor)) { |
|
647 | + print $globalTrackerIconColor; |
|
648 | +} else { |
|
649 | + print '1a3151'; |
|
650 | +} |
|
651 | +?>"> |
|
439 | 652 | </li> |
440 | 653 | <?php |
441 | 654 | } |
@@ -446,8 +659,22 @@ discard block |
||
446 | 659 | ?> |
447 | 660 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
448 | 661 | <div class="range"> |
449 | - <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
|
450 | - <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output> |
|
662 | + <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) { |
|
663 | + print $_COOKIE['AirportZoom']; |
|
664 | +} elseif (isset($globalAirportZoom)) { |
|
665 | + print $globalAirportZoom; |
|
666 | +} else { |
|
667 | + print '7'; |
|
668 | +} |
|
669 | +?>"> |
|
670 | + <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) { |
|
671 | + print $_COOKIE['AirportZoom']; |
|
672 | +} elseif (isset($globalAirportZoom)) { |
|
673 | + print $globalAirportZoom; |
|
674 | +} else { |
|
675 | + print '7'; |
|
676 | +} |
|
677 | +?></output> |
|
451 | 678 | </div> |
452 | 679 | </li> |
453 | 680 | <?php |
@@ -459,10 +686,23 @@ discard block |
||
459 | 686 | <?php |
460 | 687 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
461 | 688 | ?> |
462 | - <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') print 'checked'; ?> ><?php echo _("Use airlines liveries"); ?></li> |
|
463 | - <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Aircraft color"); ?></li> |
|
689 | + <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') { |
|
690 | + print 'checked'; |
|
691 | +} |
|
692 | +?> ><?php echo _("Use airlines liveries"); ?></li> |
|
693 | + <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') { |
|
694 | + print 'checked'; |
|
695 | +} |
|
696 | +?> ><?php echo _("Force Aircraft color"); ?></li> |
|
464 | 697 | <li><?php echo _("Aircraft icon color:"); ?> |
465 | - <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>"> |
|
698 | + <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
699 | + print $_COOKIE['IconColor']; |
|
700 | +} elseif (isset($globalAircraftIconColor)) { |
|
701 | + print $globalAircraftIconColor; |
|
702 | +} else { |
|
703 | + print 'ff0000'; |
|
704 | +} |
|
705 | +?>"> |
|
466 | 706 | </li> |
467 | 707 | <?php |
468 | 708 | } |
@@ -470,9 +710,19 @@ discard block |
||
470 | 710 | <?php |
471 | 711 | if (isset($globalMarine) && $globalMarine === TRUE) { |
472 | 712 | ?> |
473 | - <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?></li> |
|
713 | + <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') { |
|
714 | + print 'checked'; |
|
715 | +} |
|
716 | +?> ><?php echo _("Force Marine color"); ?></li> |
|
474 | 717 | <li><?php echo _("Marine icon color:"); ?> |
475 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>"> |
|
718 | + <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { |
|
719 | + print $_COOKIE['MarineIconColor']; |
|
720 | +} elseif (isset($globalMarineIconColor)) { |
|
721 | + print $globalMarineIconColor; |
|
722 | +} else { |
|
723 | + print 'ff0000'; |
|
724 | +} |
|
725 | +?>"> |
|
476 | 726 | </li> |
477 | 727 | <?php |
478 | 728 | } |
@@ -480,9 +730,19 @@ discard block |
||
480 | 730 | <?php |
481 | 731 | if (isset($globalTracker) && $globalTracker === TRUE) { |
482 | 732 | ?> |
483 | - <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Tracker color"); ?></li> |
|
733 | + <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') { |
|
734 | + print 'checked'; |
|
735 | +} |
|
736 | +?> ><?php echo _("Force Tracker color"); ?></li> |
|
484 | 737 | <li><?php echo _("Tracker icon color:"); ?> |
485 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print 'ff0000'; ?>"> |
|
738 | + <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { |
|
739 | + print $_COOKIE['TrackerIconColor']; |
|
740 | +} elseif (isset($globalTrackerIconColor)) { |
|
741 | + print $globalTrackerIconColor; |
|
742 | +} else { |
|
743 | + print 'ff0000'; |
|
744 | +} |
|
745 | +?>"> |
|
486 | 746 | </li> |
487 | 747 | <?php |
488 | 748 | } |
@@ -490,22 +750,46 @@ discard block |
||
490 | 750 | ?> |
491 | 751 | <li><?php echo _("Distance unit:"); ?> |
492 | 752 | <select class="selectpicker" onchange="unitdistance(this);"> |
493 | - <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option> |
|
494 | - <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option> |
|
495 | - <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option> |
|
753 | + <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
754 | + echo ' selected'; |
|
755 | +} |
|
756 | +?>>km</option> |
|
757 | + <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
758 | + echo ' selected'; |
|
759 | +} |
|
760 | +?>>nm</option> |
|
761 | + <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
762 | + echo ' selected'; |
|
763 | +} |
|
764 | +?>>mi</option> |
|
496 | 765 | </select> |
497 | 766 | </li> |
498 | 767 | <li><?php echo _("Altitude unit:"); ?> |
499 | 768 | <select class="selectpicker" onchange="unitaltitude(this);"> |
500 | - <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option> |
|
501 | - <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option> |
|
769 | + <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) { |
|
770 | + echo ' selected'; |
|
771 | +} |
|
772 | +?>>m</option> |
|
773 | + <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
774 | + echo ' selected'; |
|
775 | +} |
|
776 | +?>>feet</option> |
|
502 | 777 | </select> |
503 | 778 | </li> |
504 | 779 | <li><?php echo _("Speed unit:"); ?> |
505 | 780 | <select class="selectpicker" onchange="unitspeed(this);"> |
506 | - <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option> |
|
507 | - <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option> |
|
508 | - <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option> |
|
781 | + <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) { |
|
782 | + echo ' selected'; |
|
783 | +} |
|
784 | +?>>km/h</option> |
|
785 | + <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
|
786 | + echo ' selected'; |
|
787 | +} |
|
788 | +?>>mph</option> |
|
789 | + <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
|
790 | + echo ' selected'; |
|
791 | +} |
|
792 | +?>>knots</option> |
|
509 | 793 | </select> |
510 | 794 | </li> |
511 | 795 | |
@@ -523,9 +807,18 @@ discard block |
||
523 | 807 | <?php |
524 | 808 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
525 | 809 | ?> |
526 | - <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
527 | - <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
528 | - <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
810 | + <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) { |
|
811 | + print 'checked'; |
|
812 | +} |
|
813 | +?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
814 | + <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) { |
|
815 | + print 'checked'; |
|
816 | +} |
|
817 | +?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
818 | + <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) { |
|
819 | + print 'checked'; |
|
820 | +} |
|
821 | +?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
529 | 822 | <?php |
530 | 823 | } |
531 | 824 | ?> |
@@ -533,10 +826,16 @@ discard block |
||
533 | 826 | if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
534 | 827 | ?> |
535 | 828 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
536 | - <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
829 | + <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) { |
|
830 | + print 'checked'; |
|
831 | +} |
|
832 | +?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
537 | 833 | <?php } ?> |
538 | 834 | <?php if (isset($globalAPRS) && $globalAPRS) { ?> |
539 | - <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
835 | + <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) { |
|
836 | + print 'checked'; |
|
837 | +} |
|
838 | +?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
540 | 839 | <?php } ?> |
541 | 840 | <?php |
542 | 841 | } |
@@ -553,7 +852,9 @@ discard block |
||
553 | 852 | } |
554 | 853 | foreach($allairlinenames as $airline) { |
555 | 854 | $airline_name = $airline['airline_name']; |
556 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; |
|
855 | + if (strlen($airline_name) > 30) { |
|
856 | + $airline_name = substr($airline_name,0,30).'...'; |
|
857 | + } |
|
557 | 858 | if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { |
558 | 859 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; |
559 | 860 | } else { |
@@ -571,7 +872,10 @@ discard block |
||
571 | 872 | <li><?php echo _("Display alliance:"); ?> |
572 | 873 | <br/> |
573 | 874 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
574 | - <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
875 | + <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') { |
|
876 | + echo ' selected'; |
|
877 | +} |
|
878 | +?>><?php echo _("All"); ?></option> |
|
575 | 879 | <?php |
576 | 880 | foreach($allalliancenames as $alliance) { |
577 | 881 | $alliance_name = $alliance['alliance']; |
@@ -630,10 +934,22 @@ discard block |
||
630 | 934 | ?> |
631 | 935 | <li><?php echo _("Display airlines of type:"); ?><br/> |
632 | 936 | <select class="selectpicker" onchange="airlinestype(this);"> |
633 | - <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
634 | - <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option> |
|
635 | - <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option> |
|
636 | - <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option> |
|
937 | + <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') { |
|
938 | + echo ' selected'; |
|
939 | +} |
|
940 | +?>><?php echo _("All"); ?></option> |
|
941 | + <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') { |
|
942 | + echo ' selected'; |
|
943 | +} |
|
944 | +?>><?php echo _("Passenger"); ?></option> |
|
945 | + <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') { |
|
946 | + echo ' selected'; |
|
947 | +} |
|
948 | +?>><?php echo _("Cargo"); ?></option> |
|
949 | + <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') { |
|
950 | + echo ' selected'; |
|
951 | +} |
|
952 | +?>><?php echo _("Military"); ?></option> |
|
637 | 953 | </select> |
638 | 954 | </li> |
639 | 955 | <?php |
@@ -647,14 +963,20 @@ discard block |
||
647 | 963 | ?> |
648 | 964 | <li> |
649 | 965 | <?php echo _("Display vessels with MMSI:"); ?> |
650 | - <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" /> |
|
966 | + <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) { |
|
967 | + print $_COOKIE['filter_mmsi']; |
|
968 | +} |
|
969 | +?>" /> |
|
651 | 970 | </li> |
652 | 971 | <?php |
653 | 972 | } |
654 | 973 | ?> |
655 | 974 | <li> |
656 | 975 | <?php echo _("Display with ident:"); ?> |
657 | - <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
|
976 | + <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) { |
|
977 | + print $_COOKIE['filter_ident']; |
|
978 | +} |
|
979 | +?>" /> |
|
658 | 980 | </li> |
659 | 981 | </ul> |
660 | 982 | </form> |
@@ -670,7 +992,10 @@ discard block |
||
670 | 992 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
671 | 993 | <form> |
672 | 994 | <ul> |
673 | - <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
995 | + <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) { |
|
996 | + print 'checked'; |
|
997 | +} |
|
998 | +?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
674 | 999 | <li><?php echo _("Type:"); ?> |
675 | 1000 | <select class="selectpicker" multiple onchange="sattypes(this);"> |
676 | 1001 | <?php |
@@ -678,25 +1003,45 @@ discard block |
||
678 | 1003 | $types = $Satellite->get_tle_types(); |
679 | 1004 | foreach ($types as $type) { |
680 | 1005 | $type_name = $type['tle_type']; |
681 | - if ($type_name == 'musson') $type_name = 'Russian LEO Navigation'; |
|
682 | - else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System'; |
|
683 | - else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System'; |
|
684 | - else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational'; |
|
685 | - else if ($type_name == 'gps-ops') $type_name = 'GPS Operational'; |
|
686 | - else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System'; |
|
687 | - else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System'; |
|
688 | - else if ($type_name == 'sarsat') $type_name = 'Search & Rescue'; |
|
689 | - else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring'; |
|
690 | - else if ($type_name == 'resource') $type_name = 'Earth Resources'; |
|
691 | - else if ($type_name == 'stations') $type_name = 'Space Stations'; |
|
692 | - else if ($type_name == 'geo') $type_name = 'Geostationary'; |
|
693 | - else if ($type_name == 'amateur') $type_name = 'Amateur Radio'; |
|
694 | - else if ($type_name == 'x-comm') $type_name = 'Experimental'; |
|
695 | - else if ($type_name == 'other-comm') $type_name = 'Other Comm'; |
|
696 | - else if ($type_name == 'science') $type_name = 'Space & Earth Science'; |
|
697 | - else if ($type_name == 'military') $type_name = 'Miscellaneous Military'; |
|
698 | - else if ($type_name == 'radar') $type_name = 'Radar Calibration'; |
|
699 | - else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; |
|
1006 | + if ($type_name == 'musson') { |
|
1007 | + $type_name = 'Russian LEO Navigation'; |
|
1008 | + } else if ($type_name == 'nnss') { |
|
1009 | + $type_name = 'Navi Navigation Satellite System'; |
|
1010 | + } else if ($type_name == 'sbas') { |
|
1011 | + $type_name = 'Satellite-Based Augmentation System'; |
|
1012 | + } else if ($type_name == 'glo-ops') { |
|
1013 | + $type_name = 'Glonass Operational'; |
|
1014 | + } else if ($type_name == 'gps-ops') { |
|
1015 | + $type_name = 'GPS Operational'; |
|
1016 | + } else if ($type_name == 'argos') { |
|
1017 | + $type_name = 'ARGOS Data Collection System'; |
|
1018 | + } else if ($type_name == 'tdrss') { |
|
1019 | + $type_name = 'Tracking and Data Relay Satellite System'; |
|
1020 | + } else if ($type_name == 'sarsat') { |
|
1021 | + $type_name = 'Search & Rescue'; |
|
1022 | + } else if ($type_name == 'dmc') { |
|
1023 | + $type_name = 'Disaster Monitoring'; |
|
1024 | + } else if ($type_name == 'resource') { |
|
1025 | + $type_name = 'Earth Resources'; |
|
1026 | + } else if ($type_name == 'stations') { |
|
1027 | + $type_name = 'Space Stations'; |
|
1028 | + } else if ($type_name == 'geo') { |
|
1029 | + $type_name = 'Geostationary'; |
|
1030 | + } else if ($type_name == 'amateur') { |
|
1031 | + $type_name = 'Amateur Radio'; |
|
1032 | + } else if ($type_name == 'x-comm') { |
|
1033 | + $type_name = 'Experimental'; |
|
1034 | + } else if ($type_name == 'other-comm') { |
|
1035 | + $type_name = 'Other Comm'; |
|
1036 | + } else if ($type_name == 'science') { |
|
1037 | + $type_name = 'Space & Earth Science'; |
|
1038 | + } else if ($type_name == 'military') { |
|
1039 | + $type_name = 'Miscellaneous Military'; |
|
1040 | + } else if ($type_name == 'radar') { |
|
1041 | + $type_name = 'Radar Calibration'; |
|
1042 | + } else if ($type_name == 'tle-new') { |
|
1043 | + $type_name = 'Last 30 days launches'; |
|
1044 | + } |
|
700 | 1045 | |
701 | 1046 | if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { |
702 | 1047 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | // When button "Remove all filters" is clicked |
38 | 38 | if (isset($_POST['removefilters'])) { |
39 | 39 | $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
40 | - return strpos($key,'filter_') === 0; |
|
40 | + return strpos($key,'filter_') === 0; |
|
41 | 41 | }); |
42 | 42 | foreach ($allfilters as $filt) { |
43 | 43 | unset($_COOKIE[$filt]); |
@@ -187,17 +187,17 @@ discard block |
||
187 | 187 | } |
188 | 188 | ?> |
189 | 189 | <?php |
190 | - if (isset($_POST['archive'])) { |
|
190 | + if (isset($_POST['archive'])) { |
|
191 | 191 | ?> |
192 | 192 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
193 | 193 | <?php |
194 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
194 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
195 | 195 | ?> |
196 | 196 | |
197 | 197 | <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script> |
198 | 198 | <?php |
199 | - } |
|
200 | - } else { |
|
199 | + } |
|
200 | + } else { |
|
201 | 201 | ?> |
202 | 202 | <?php |
203 | 203 | /* if (isset($globalBeta) && $globalBeta) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | ?> |
211 | 211 | <?php |
212 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
212 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
213 | 213 | ?> |
214 | 214 | <?php |
215 | 215 | // if (isset($globalBeta) && $globalBeta) { |
@@ -240,13 +240,13 @@ discard block |
||
240 | 240 | <script src="<?php print $globalURL; ?>/js/map-satellite.2d.js.php?<?php print time(); ?>"></script> |
241 | 241 | <?php |
242 | 242 | } |
243 | - } |
|
243 | + } |
|
244 | 244 | ?> |
245 | 245 | <?php |
246 | 246 | // } |
247 | 247 | ?> |
248 | 248 | <?php |
249 | - } |
|
249 | + } |
|
250 | 250 | } |
251 | 251 | ?> |
252 | 252 | <?php |
@@ -423,34 +423,34 @@ discard block |
||
423 | 423 | |
424 | 424 | <ul class="nav navbar-nav"> |
425 | 425 | <?php |
426 | - if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) { |
|
426 | + if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) { |
|
427 | 427 | ?> |
428 | 428 | <li><a href="<?php print $globalURL; ?>/news"><?php echo _("News"); ?></a></li> |
429 | 429 | <?php |
430 | - } |
|
430 | + } |
|
431 | 431 | ?> |
432 | 432 | |
433 | 433 | <?php |
434 | - $sub = false; |
|
435 | - if ( |
|
434 | + $sub = false; |
|
435 | + if ( |
|
436 | 436 | ( |
437 | - (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
437 | + (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
438 | 438 | ) || |
439 | 439 | ( |
440 | - isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
440 | + isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
441 | 441 | ) || |
442 | 442 | ( |
443 | - isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
443 | + isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
444 | 444 | ) || |
445 | 445 | ( |
446 | - isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE)) |
|
446 | + isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE)) |
|
447 | 447 | ) |
448 | - ) { |
|
448 | + ) { |
|
449 | 449 | $sub = true; |
450 | - } |
|
450 | + } |
|
451 | 451 | ?> |
452 | 452 | <?php |
453 | - if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
453 | + if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
454 | 454 | ?> |
455 | 455 | <li class="dropdown"> |
456 | 456 | <?php |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | <ul class="dropdown-menu multi-level"> |
462 | 462 | <li class="dropdown-submenu"> |
463 | 463 | <?php |
464 | - } |
|
464 | + } |
|
465 | 465 | ?> |
466 | 466 | <?php |
467 | 467 | if (isset($globalNewsFeeds['aircraft']) && !empty($globalNewsFeeds['aircraft'])) { |
@@ -476,25 +476,25 @@ discard block |
||
476 | 476 | <ul class="dropdown-menu"> |
477 | 477 | <li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li> |
478 | 478 | <?php |
479 | - if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
|
479 | + if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
|
480 | 480 | ?> |
481 | 481 | <li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li> |
482 | 482 | <?php |
483 | - } |
|
483 | + } |
|
484 | 484 | ?> |
485 | 485 | <li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li> |
486 | 486 | <?php |
487 | - if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) { |
|
487 | + if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) { |
|
488 | 488 | ?> |
489 | 489 | <li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li> |
490 | 490 | <?php |
491 | - } |
|
492 | - if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
|
491 | + } |
|
492 | + if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
|
493 | 493 | |
494 | 494 | ?> |
495 | 495 | <li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li> |
496 | 496 | <?php |
497 | - } |
|
497 | + } |
|
498 | 498 | ?> |
499 | 499 | <li><hr /></li> |
500 | 500 | <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li> |
@@ -502,43 +502,43 @@ discard block |
||
502 | 502 | <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li> |
503 | 503 | <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li> |
504 | 504 | <?php |
505 | - if ($globalACARS) { |
|
506 | - if (isset($globalDemo) && $globalDemo) { |
|
507 | - ?> |
|
505 | + if ($globalACARS) { |
|
506 | + if (isset($globalDemo) && $globalDemo) { |
|
507 | + ?> |
|
508 | 508 | <li><hr /></li> |
509 | 509 | <li><i><?php echo _('ACARS data not available publicly'); ?></i></li> |
510 | 510 | <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li> |
511 | 511 | <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li> |
512 | 512 | <?php |
513 | - } else { |
|
514 | - ?> |
|
513 | + } else { |
|
514 | + ?> |
|
515 | 515 | <li><hr /></li> |
516 | 516 | <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li> |
517 | 517 | <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li> |
518 | 518 | <?php |
519 | - } |
|
520 | - } |
|
521 | - ?> |
|
519 | + } |
|
520 | + } |
|
521 | + ?> |
|
522 | 522 | <?php |
523 | - if (isset($globalAccidents) && $globalAccidents) { |
|
524 | - ?> |
|
523 | + if (isset($globalAccidents) && $globalAccidents) { |
|
524 | + ?> |
|
525 | 525 | <li><hr /></li> |
526 | 526 | <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li> |
527 | 527 | <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li> |
528 | 528 | <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li> |
529 | 529 | <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li> |
530 | 530 | <?php |
531 | - } |
|
532 | - ?> |
|
531 | + } |
|
532 | + ?> |
|
533 | 533 | <li><hr /></li> |
534 | 534 | <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li> |
535 | 535 | <?php |
536 | 536 | if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) { |
537 | - ?> |
|
537 | + ?> |
|
538 | 538 | <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li> |
539 | 539 | <?php |
540 | 540 | } |
541 | - ?> |
|
541 | + ?> |
|
542 | 542 | </ul> |
543 | 543 | </li> |
544 | 544 | <li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li> |
@@ -565,14 +565,14 @@ discard block |
||
565 | 565 | </ul> |
566 | 566 | <?php |
567 | 567 | } |
568 | - } |
|
568 | + } |
|
569 | 569 | ?> |
570 | 570 | <?php |
571 | - if (isset($globalMarine) && $globalMarine) { |
|
571 | + if (isset($globalMarine) && $globalMarine) { |
|
572 | 572 | ?> |
573 | 573 | <li class="dropdown"> |
574 | 574 | <?php |
575 | - if ($sub) { |
|
575 | + if ($sub) { |
|
576 | 576 | ?> |
577 | 577 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Marines"); ?> <b class="caret"></b></a> |
578 | 578 | <ul class="dropdown-menu multi-level"> |
@@ -606,14 +606,14 @@ discard block |
||
606 | 606 | } |
607 | 607 | ?> |
608 | 608 | <?php |
609 | - } |
|
609 | + } |
|
610 | 610 | ?> |
611 | 611 | <?php |
612 | - if (isset($globalTracker) && $globalTracker) { |
|
612 | + if (isset($globalTracker) && $globalTracker) { |
|
613 | 613 | ?> |
614 | 614 | <li class="dropdown"> |
615 | 615 | <?php |
616 | - if ($sub) { |
|
616 | + if ($sub) { |
|
617 | 617 | ?> |
618 | 618 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a> |
619 | 619 | <ul class="dropdown-menu multi-level"> |
@@ -647,14 +647,14 @@ discard block |
||
647 | 647 | } |
648 | 648 | ?> |
649 | 649 | <?php |
650 | - } |
|
650 | + } |
|
651 | 651 | ?> |
652 | 652 | <?php |
653 | - if (isset($globalSatellite) && $globalSatellite) { |
|
653 | + if (isset($globalSatellite) && $globalSatellite) { |
|
654 | 654 | ?> |
655 | 655 | <li class="dropdown"> |
656 | 656 | <?php |
657 | - if ($sub) { |
|
657 | + if ($sub) { |
|
658 | 658 | ?> |
659 | 659 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellites"); ?> <b class="caret"></b></a> |
660 | 660 | <ul class="dropdown-menu multi-level"> |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | } |
691 | 691 | ?> |
692 | 692 | <?php |
693 | - } |
|
693 | + } |
|
694 | 694 | ?> |
695 | 695 | |
696 | 696 | <li class="dropdown"> |
@@ -699,12 +699,12 @@ discard block |
||
699 | 699 | <li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li> |
700 | 700 | <li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li> |
701 | 701 | <?php |
702 | - if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
702 | + if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
703 | 703 | ?> |
704 | 704 | <li><hr /></li> |
705 | 705 | <li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li> |
706 | 706 | <?php |
707 | - } |
|
707 | + } |
|
708 | 708 | ?> |
709 | 709 | <?php if (isset($globalContribute) && $globalContribute) { ?> |
710 | 710 | <li><hr /></li> |
@@ -725,14 +725,14 @@ discard block |
||
725 | 725 | <form> |
726 | 726 | <select class="selectpicker" data-width="120px" onchange="language(this);"> |
727 | 727 | <?php |
728 | - $Language = new Language(); |
|
729 | - $alllang = $Language->getLanguages(); |
|
730 | - foreach ($alllang as $key => $lang) { |
|
731 | - print '<option value="'.$key.'"'; |
|
732 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
733 | - print '>'.$lang[0].'</option>'; |
|
734 | - } |
|
735 | - ?> |
|
728 | + $Language = new Language(); |
|
729 | + $alllang = $Language->getLanguages(); |
|
730 | + foreach ($alllang as $key => $lang) { |
|
731 | + print '<option value="'.$key.'"'; |
|
732 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
733 | + print '>'.$lang[0].'</option>'; |
|
734 | + } |
|
735 | + ?> |
|
736 | 736 | </select> |
737 | 737 | </form> |
738 | 738 | </div> |
@@ -764,18 +764,18 @@ discard block |
||
764 | 764 | ?> |
765 | 765 | <div class="top-header clear" role="main"> |
766 | 766 | <?php |
767 | - if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
767 | + if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
768 | 768 | ?> |
769 | 769 | <div id="archive-map"></div> |
770 | 770 | <?php |
771 | - } |
|
771 | + } |
|
772 | 772 | ?> |
773 | 773 | </div> |
774 | 774 | <?php |
775 | 775 | } |
776 | 776 | if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
777 | 777 | { |
778 | - ?> |
|
778 | + ?> |
|
779 | 779 | <div class="top-header clear" role="main"> |
780 | 780 | <div id="map"></div> |
781 | 781 | <link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" /> |
@@ -786,15 +786,15 @@ discard block |
||
786 | 786 | var zoom = 13; |
787 | 787 | //create the map |
788 | 788 | <?php |
789 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
789 | + if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
790 | 790 | ?> |
791 | 791 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
792 | 792 | <?php |
793 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
793 | + } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
794 | 794 | ?> |
795 | 795 | map = L.map('map', { zoomControl:true }); |
796 | 796 | <?php |
797 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
797 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
798 | 798 | ?> |
799 | 799 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
800 | 800 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -802,22 +802,22 @@ discard block |
||
802 | 802 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
803 | 803 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
804 | 804 | <?php |
805 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) { |
|
805 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) { |
|
806 | 806 | ?> |
807 | 807 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
808 | 808 | <?php |
809 | - } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
809 | + } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
810 | 810 | ?> |
811 | 811 | map = L.map('map', { zoomControl:true }); |
812 | 812 | <?php |
813 | - } |
|
813 | + } |
|
814 | 814 | ?> |
815 | 815 | //initialize the layer group for the aircrft markers |
816 | 816 | var layer_data = L.layerGroup(); |
817 | 817 | |
818 | 818 | //a few title layers |
819 | 819 | <?php |
820 | - if ($globalMapProvider == 'Mapbox') { |
|
820 | + if ($globalMapProvider == 'Mapbox') { |
|
821 | 821 | ?> |
822 | 822 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
823 | 823 | maxZoom: 18, |
@@ -828,14 +828,14 @@ discard block |
||
828 | 828 | token : '<?php print $globalMapboxToken; ?>' |
829 | 829 | }).addTo(map); |
830 | 830 | <?php |
831 | - } elseif ($globalMapProvider == 'Mapbox-GL') { |
|
831 | + } elseif ($globalMapProvider == 'Mapbox-GL') { |
|
832 | 832 | ?> |
833 | 833 | L.mapboxGL({ |
834 | 834 | accessToken: '<?php print $globalMapboxToken; ?>', |
835 | 835 | style: 'mapbox://styles/mapbox/bright-v8' |
836 | 836 | }).addTo(map); |
837 | 837 | <?php |
838 | - } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
838 | + } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
839 | 839 | ?> |
840 | 840 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', { |
841 | 841 | maxZoom: 18, |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>' |
845 | 845 | }).addTo(map); |
846 | 846 | <?php |
847 | - } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
847 | + } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
848 | 848 | ?> |
849 | 849 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', { |
850 | 850 | maxZoom: 18, |
@@ -853,27 +853,27 @@ discard block |
||
853 | 853 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"' |
854 | 854 | }).addTo(map); |
855 | 855 | <?php |
856 | - } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
856 | + } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
857 | 857 | ?> |
858 | 858 | var googleLayer = new L.Google('ROADMAP'); |
859 | 859 | map.addLayer(googleLayer); |
860 | 860 | <?php |
861 | - } elseif ($globalMapProvider == 'Google-Satellite') { |
|
861 | + } elseif ($globalMapProvider == 'Google-Satellite') { |
|
862 | 862 | ?> |
863 | 863 | var googleLayer = new L.Google('SATELLITE'); |
864 | 864 | map.addLayer(googleLayer); |
865 | 865 | <?php |
866 | - } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
866 | + } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
867 | 867 | ?> |
868 | 868 | var googleLayer = new L.Google('HYBRID'); |
869 | 869 | map.addLayer(googleLayer); |
870 | 870 | <?php |
871 | - } elseif ($globalMapProvider == 'Google-Terrain') { |
|
871 | + } elseif ($globalMapProvider == 'Google-Terrain') { |
|
872 | 872 | ?> |
873 | 873 | var googleLayer = new L.Google('Terrain'); |
874 | 874 | map.addLayer(googleLayer); |
875 | 875 | <?php |
876 | - } elseif (isset($globalMapCustomLayer[$globalMapProvider])) { |
|
876 | + } elseif (isset($globalMapCustomLayer[$globalMapProvider])) { |
|
877 | 877 | $customid = $globalMapProvider; |
878 | 878 | ?> |
879 | 879 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
@@ -883,8 +883,8 @@ discard block |
||
883 | 883 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
884 | 884 | }).addTo(map); |
885 | 885 | <?php |
886 | - //} elseif ($globalMapProvider == 'OpenStreetMap') { |
|
887 | - } else { |
|
886 | + //} elseif ($globalMapProvider == 'OpenStreetMap') { |
|
887 | + } else { |
|
888 | 888 | ?> |
889 | 889 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
890 | 890 | maxZoom: 18, |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | }).addTo(map); |
894 | 894 | |
895 | 895 | <?php |
896 | - } |
|
896 | + } |
|
897 | 897 | ?> |
898 | 898 | </script> |
899 | 899 | </div> |