Completed
Push — master ( 9b55c0...a5ee4b )
by Yannick
30:28
created
js/map-aircraft.2d.js.php 1 patch
Braces   +60 added lines, -16 removed lines patch added patch discarded remove patch
@@ -12,16 +12,27 @@  discard block
 block discarded – undo
12 12
 <?php
13 13
 
14 14
 // Compressed GeoJson is used if true
15
-if (!isset($globalJsonCompress)) $compress = true;
16
-else $compress = $globalJsonCompress;
15
+if (!isset($globalJsonCompress)) {
16
+	$compress = true;
17
+} else {
18
+	$compress = $globalJsonCompress;
19
+}
17 20
 
18
-if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
19
-if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
21
+if (isset($_GET['ident'])) {
22
+	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
23
+}
24
+if (isset($_GET['flightaware_id'])) {
25
+	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
26
+}
20 27
 ?>
21 28
 <?php
22
-if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor'];
23
-elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor;
24
-else $IconColor = '1a3151';
29
+if (isset($_COOKIE['IconColor'])) {
30
+	$IconColor = $_COOKIE['IconColor'];
31
+} elseif (isset($globalAircraftIconColor)) {
32
+	$IconColor = $globalAircraftIconColor;
33
+} else {
34
+	$IconColor = '1a3151';
35
+}
25 36
 ?>
26 37
 <?php
27 38
 if (isset($globalDebug) && $globalDebug === TRUE) {
@@ -99,9 +110,12 @@  discard block
 block discarded – undo
99 110
 
100 111
 function update_airportsLayer() {
101 112
 <?php
102
-	if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom'];
103
-	else $getZoom = '7';
104
-?>
113
+	if (isset($_COOKIE['AirportZoom'])) {
114
+		$getZoom = $_COOKIE['AirportZoom'];
115
+	} else {
116
+		$getZoom = '7';
117
+	}
118
+	?>
105 119
 	if (typeof airportsLayer != 'undefined') {
106 120
 		if (map.hasLayer(airportsLayer) == true) {
107 121
 			map.removeLayer(airportsLayer);
@@ -382,7 +396,12 @@  discard block
 block discarded – undo
382 396
 <?php
383 397
 		} else {
384 398
 ?>
385
-					var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
399
+					var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
400
+	print $archiveupdatetime*1000;
401
+} else {
402
+	print $globalMapRefresh*1000+20000;
403
+}
404
+?>+feature.properties.sqt*1000);
386 405
 					return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
387 406
 <?php
388 407
 		}
@@ -433,7 +452,12 @@  discard block
 block discarded – undo
433 452
 <?php
434 453
 		} else {
435 454
 ?>
436
-						var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
455
+						var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
456
+	print $archiveupdatetime*1000;
457
+} else {
458
+	print $globalMapRefresh*1000+20000;
459
+}
460
+?>+feature.properties.sqt*1000);
437 461
 						return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
438 462
 <?php
439 463
 		}
@@ -481,7 +505,12 @@  discard block
 block discarded – undo
481 505
 <?php
482 506
 		} else {
483 507
 ?>
484
-							var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
508
+							var movingtime = Math.round(<?php if (isset($archiveupdatetime)) {
509
+	print $archiveupdatetime*1000;
510
+} else {
511
+	print $globalMapRefresh*1000+20000;
512
+}
513
+?>+feature.properties.sqt*1000);
485 514
 							return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
486 515
 <?php
487 516
 		}
@@ -1000,7 +1029,12 @@  discard block
 block discarded – undo
1000 1029
 		update_archiveLayer(0);
1001 1030
 	} else {
1002 1031
 		//then load it again every 30 seconds
1003
-		reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>);
1032
+		reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) {
1033
+	print $globalMapRefresh*1000;
1034
+} else {
1035
+	print '30000';
1036
+}
1037
+?>);
1004 1038
 		var currentdate = new Date();
1005 1039
 		var currentyear = new Date().getFullYear();
1006 1040
 		var begindate = new Date(Date.UTC(currentyear,11,24,2,0,0,0));
@@ -1012,7 +1046,12 @@  discard block
 block discarded – undo
1012 1046
 		if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
1013 1047
 ?>
1014 1048
 		update_polarLayer();
1015
-		setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
1049
+		setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) {
1050
+	print $globalMapRefresh*1000*2;
1051
+} else {
1052
+	print '60000';
1053
+}
1054
+?>);
1016 1055
 <?php
1017 1056
 		}
1018 1057
 ?>
@@ -1025,7 +1064,12 @@  discard block
 block discarded – undo
1025 1064
 	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) {
1026 1065
 ?>
1027 1066
 	update_atcLayer();
1028
-	setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
1067
+	setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) {
1068
+	print $globalMapRefresh*1000*2;
1069
+} else {
1070
+	print '60000';
1071
+}
1072
+?>);
1029 1073
 <?php
1030 1074
 	}
1031 1075
 ?>
Please login to merge, or discard this patch.