Completed
Push — master ( a1da1d...8368ca )
by Yannick
29:52
created
require/class.Weather.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
 	public function buildcloudlayer($metar) {
5 5
 		//print_r($metar);
6 6
 		$result = array();
7
-		foreach($metar['cloud'] as $key => $data) {
7
+		foreach ($metar['cloud'] as $key => $data) {
8 8
 			$alt_m = $metar['cloud'][$key]['level'];
9 9
 			$alt_ft = $alt_m*3.28084;
10 10
 			$pressure = $metar['QNH'];
11
-			$cumulus_base = 122.0 * ($metar['temperature'] - $metar['dew']);
12
-			$stratus_base = 100.0 * (100.0 * $metar['rh'])*0.3048;
11
+			$cumulus_base = 122.0*($metar['temperature'] - $metar['dew']);
12
+			$stratus_base = 100.0*(100.0*$metar['rh'])*0.3048;
13 13
 			$coverage_norm = 0.0;
14 14
 			if ($metar['cloud'][$key]['type'] == 'Few') {
15 15
 				$coverage_norm = 2.0/8.0;
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 					$layer_type = 'ns';
32 32
 				}
33 33
 			} else {
34
-				if ($cumulus_base * 0.80 < $alt_m && $cumulus_base * 1.20 > $alt_m) {
34
+				if ($cumulus_base*0.80 < $alt_m && $cumulus_base*1.20 > $alt_m) {
35 35
 					$layer_type = 'cu';
36
-				} elseif ($stratus_base * 0.80 < $alt_m && $stratus_base * 1.40 > $alt_m) {
36
+				} elseif ($stratus_base*0.80 < $alt_m && $stratus_base*1.40 > $alt_m) {
37 37
 					$layer_type = 'st';
38 38
 				} else {
39 39
 					if ($alt_ft < 2000) {
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 				}
47 47
 			}
48 48
 			//echo 'coverage norm : '.$coverage_norm.' - layer_type: '.$layer_type."\n";
49
-			$result[] = array('cov' => $coverage_norm, 'type' => $layer_type,'alt' => $alt_m,'rh' => $metar['rh']);
49
+			$result[] = array('cov' => $coverage_norm, 'type' => $layer_type, 'alt' => $alt_m, 'rh' => $metar['rh']);
50 50
 		}
51 51
 		if (count($result) < 2 && $metar['rh'] > 60) {
52
-			$result[] = array('cov' => 0.75, 'type' => 'ci','alt' => 4000,'rh' => $metar['rh']);
52
+			$result[] = array('cov' => 0.75, 'type' => 'ci', 'alt' => 4000, 'rh' => $metar['rh']);
53 53
 		}
54 54
 		return $result;
55 55
 	}
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		
69 69
 		// http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p50.pl?file=gfs.t05z.pgrb2full.0p50.f000&lev_10_m_above_ground=on&lev_surface=on&var_TMP=on&var_UGRD=on&var_VGRD=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=/gfs.2017111717
70 70
 		$resolution = '0.5';
71
-		$baseurl = 'http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_'.($resolution === '1' ? '1p00':'0p50').'.pl';
72
-		$get = array('file' => 'gfs.t'.sprintf('%02d',(6*floor(date('G')/6))).($resolution === '1' ? 'z.pgrb2.1p00.f000' : 'z.pgrb2full.0p50.f000'),
71
+		$baseurl = 'http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_'.($resolution === '1' ? '1p00' : '0p50').'.pl';
72
+		$get = array('file' => 'gfs.t'.sprintf('%02d', (6*floor(date('G')/6))).($resolution === '1' ? 'z.pgrb2.1p00.f000' : 'z.pgrb2full.0p50.f000'),
73 73
 			'lev_10_m_above_ground' => 'on',
74 74
 			'lev_surface' => 'on',
75 75
 			'var_TMP' => 'on',
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 			'rightlon' => 360,
80 80
 			'toplat' => 90,
81 81
 			'bottomlat' => -90,
82
-			'dir' => '/gfs.'.date('Ymd').sprintf('%02d',(6*floor(date('G')/6)))
82
+			'dir' => '/gfs.'.date('Ymd').sprintf('%02d', (6*floor(date('G')/6)))
83 83
 		);
84 84
 		$url = $baseurl.'?'.http_build_query($get);
85 85
 		echo $url;
86 86
 		$Common = new Common();
87
-		$Common->download($url,$windpathsrc);
87
+		$Common->download($url, $windpathsrc);
88 88
 		$grib2json = dirname(__FILE__).'/libs/grib2json/bin/grib2json';
89 89
 		system($grib2json.' --data --output '.$windpathdest.' --names --compact '.$windpathsrc);
90 90
 	}
Please login to merge, or discard this patch.
index.php 1 patch
Braces   +558 added lines, -141 removed lines patch added patch discarded remove patch
@@ -52,7 +52,10 @@  discard block
 block discarded – undo
52 52
 <?php
53 53
     if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
54 54
 ?>
55
-<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script>
55
+<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) {
56
+	print '?tsk='.$tsk;
57
+}
58
+?>"></script>
56 59
 <?php
57 60
 	if (!isset($globalAircraft) || $globalAircraft) {
58 61
 ?>
@@ -130,7 +133,10 @@  discard block
 block discarded – undo
130 133
 			<h1>Weather</h1>
131 134
 			<ul>
132 135
 			
133
-				<li><div class="checkbox"><label><input type="checkbox" name="wind" value="1" onclick="clickWind(this);" <?php if (isset($_COOKIE['weather_wind']) && $_COOKIE['weather_wind'] == 'true') print 'checked'; ?> /><?php echo _("Weather Winds"); ?></label></div></li>
136
+				<li><div class="checkbox"><label><input type="checkbox" name="wind" value="1" onclick="clickWind(this);" <?php if (isset($_COOKIE['weather_wind']) && $_COOKIE['weather_wind'] == 'true') {
137
+	print 'checked';
138
+}
139
+?> /><?php echo _("Weather Winds"); ?></label></div></li>
134 140
 			
135 141
 <?php
136 142
 		if (isset($globalOpenWeatherMapKey) && $globalOpenWeatherMapKey != '') {
@@ -149,7 +155,10 @@  discard block
 block discarded – undo
149 155
 ?>
150 156
 			<h1>Weather</h1>
151 157
 			<ul>
152
-				<li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) print 'checked'; ?> ><?php echo _("Display weather on 3D map"); ?></label></div></li>
158
+				<li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) {
159
+	print 'checked';
160
+}
161
+?> ><?php echo _("Display weather on 3D map"); ?></label></div></li>
153 162
 			</ul>
154 163
 <?php
155 164
 	}
@@ -166,13 +175,22 @@  discard block
 block discarded – undo
166 175
 <?php
167 176
 		if (!isset($globalAircraft) || $globalAircraft) {
168 177
 ?>
169
-				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?></label></div></li>
170
-				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?></label></div></li>
178
+				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') {
179
+	print 'checked';
180
+}
181
+?> /><?php echo _("Display waypoints"); ?></label></div></li>
182
+				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') {
183
+	print 'checked';
184
+}
185
+?> /><?php echo _("Display airspace"); ?></label></div></li>
171 186
 <?php
172 187
 		}
173 188
 		if (isset($globalMarine) && $globalMarine) {
174 189
 ?>
175
-				<li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="clickOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') print 'checked'; ?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li>
190
+				<li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="clickOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') {
191
+	print 'checked';
192
+}
193
+?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li>
176 194
 <?php
177 195
 		}
178 196
 ?>
@@ -187,8 +205,14 @@  discard block
 block discarded – undo
187 205
 <?php
188 206
 		if (!isset($globalAircraft) || $globalAircraft) {
189 207
 ?>
190
-				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li>
191
-				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?> Beta</label></div></li>
208
+				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') {
209
+	print 'checked';
210
+}
211
+?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li>
212
+				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') {
213
+	print 'checked';
214
+}
215
+?> /><?php echo _("Display airspace"); ?> Beta</label></div></li>
192 216
 <?php
193 217
 		}
194 218
 ?>
@@ -202,14 +226,32 @@  discard block
 block discarded – undo
202 226
 		<h1>NOTAM</h1>
203 227
 		<form>
204 228
 			<ul>
205
-				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') print 'checked'; ?> /><?php echo _("Display NOTAM"); ?></label></div></li>
229
+				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') {
230
+	print 'checked';
231
+}
232
+?> /><?php echo _("Display NOTAM"); ?></label></div></li>
206 233
 				<li><?php echo _("NOTAM scope:"); ?>
207 234
 					<select class="selectpicker" onchange="notamscope(this);">
208
-						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>
209
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>
210
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>
211
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>
212
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>
235
+						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') {
236
+	print ' selected';
237
+}
238
+?>>All</option>
239
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') {
240
+	print ' selected';
241
+}
242
+?>>Airport/Enroute warning</option>
243
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') {
244
+	print ' selected';
245
+}
246
+?>>Airport warning</option>
247
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') {
248
+	print ' selected';
249
+}
250
+?>>Navigation warning</option>
251
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') {
252
+	print ' selected';
253
+}
254
+?>>Enroute warning</option>
213 255
 					</select
214 256
 				</li>
215 257
 			</ul>
@@ -237,7 +279,10 @@  discard block
 block discarded – undo
237 279
 		    <div class="form-group">
238 280
 			<label><?php echo _("From:"); ?></label>
239 281
 			<div class='input-group date' id='datetimepicker1'>
240
-			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC'; ?>" required />
282
+			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') {
283
+	print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC';
284
+}
285
+?>" required />
241 286
 			    <span class="input-group-addon">
242 287
 				<span class="glyphicon glyphicon-calendar"></span>
243 288
 			    </span>
@@ -246,7 +291,10 @@  discard block
 block discarded – undo
246 291
 		    <div class="form-group">
247 292
 			<label><?php echo _("To:"); ?></label>
248 293
 			<div class='input-group date' id='datetimepicker2'>
249
-			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC'; ?>" />
294
+			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') {
295
+	print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC';
296
+}
297
+?>" />
250 298
 			    <span class="input-group-addon">
251 299
 				<span class="glyphicon glyphicon-calendar"></span>
252 300
 			    </span>
@@ -278,8 +326,20 @@  discard block
 block discarded – undo
278 326
 		    </script>
279 327
 		<li><?php echo _("Playback speed:"); ?>
280 328
 		    <div class="range">
281
-			<input type="range" min="0" max="50" step="1" id="archivespeed" 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'; ?>">
282
-			<output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>
329
+			<input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) {
330
+	print $_POST['archivespeed'];
331
+} elseif (isset($_COOKIE['archive_speed'])) {
332
+	print $_COOKIE['archive_speed'];
333
+} else {
334
+	print '1';
335
+}
336
+?>">
337
+			<output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) {
338
+	print $_COOKIE['archive_speed'];
339
+} else {
340
+	print '1';
341
+}
342
+?></output>
283 343
 		    </div>
284 344
 		</li>
285 345
 		<?php
@@ -308,14 +368,20 @@  discard block
 block discarded – undo
308 368
 		    <li><?php echo _("Type of Map:"); ?>
309 369
 			    <?php
310 370
 				if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
311
-					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
312
-					else $MapType = $_COOKIE['MapType'];
371
+					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') {
372
+						$MapType = $globalMapProvider;
373
+					} else {
374
+						$MapType = $_COOKIE['MapType'];
375
+					}
313 376
 			    ?>
314 377
 			<select  class="selectpicker" onchange="mapType(this);">
315 378
 			    <?php
316 379
 				} else {
317
-					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') $MapType = $globalMapProvider;
318
-					else $MapType = $_COOKIE['MapType3D'];
380
+					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') {
381
+						$MapType = $globalMapProvider;
382
+					} else {
383
+						$MapType = $_COOKIE['MapType3D'];
384
+					}
319 385
 			    ?>
320 386
 			<select  class="selectpicker" onchange="mapType3D(this);">
321 387
 			    <?php
@@ -324,24 +390,48 @@  discard block
 block discarded – undo
324 390
 			    <?php
325 391
 				if (isset($globalMapOffline) && $globalMapOffline === TRUE) {
326 392
 			    ?>
327
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
393
+			    <option value="offline"<?php if ($MapType == 'offline') {
394
+	print ' selected';
395
+}
396
+?>>Natural Earth (local)</option>
328 397
 			    <?php
329 398
 				} else {
330 399
 				    if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) {
331 400
 			    ?>
332
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
401
+			    <option value="offline"<?php if ($MapType == 'offline') {
402
+	print ' selected';
403
+}
404
+?>>Natural Earth (local)</option>
333 405
 			    <?php
334 406
 				    }
335 407
 			    ?>
336
-			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option>
337
-			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option>
338
-			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') print ' selected'; ?>>ArcGIS Ocean</option>
408
+			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') {
409
+	print ' selected';
410
+}
411
+?>>ArcGIS Streetmap</option>
412
+			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') {
413
+	print ' selected';
414
+}
415
+?>>ArcGIS Satellite</option>
416
+			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') {
417
+	print ' selected';
418
+}
419
+?>>ArcGIS Ocean</option>
339 420
 			    <?php
340 421
 				    if (isset($globalBingMapKey) && $globalBingMapKey != '') {
341 422
 			    ?>
342
-			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
343
-			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
344
-			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
423
+			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') {
424
+	print ' selected';
425
+}
426
+?>>Bing-Aerial</option>
427
+			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') {
428
+	print ' selected';
429
+}
430
+?>>Bing-Hybrid</option>
431
+			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') {
432
+	print ' selected';
433
+}
434
+?>>Bing-Road</option>
345 435
 			    <?php
346 436
 				    }
347 437
 			    ?>
@@ -351,59 +441,143 @@  discard block
 block discarded – undo
351 441
 			    <?php
352 442
 					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
353 443
 			    ?>
354
-			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
355
-			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
356
-			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
444
+			    <option value="Here-Aerial"<?php if ($MapType == 'Here') {
445
+	print ' selected';
446
+}
447
+?>>Here-Aerial</option>
448
+			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') {
449
+	print ' selected';
450
+}
451
+?>>Here-Hybrid</option>
452
+			    <option value="Here-Road"<?php if ($MapType == 'Here') {
453
+	print ' selected';
454
+}
455
+?>>Here-Road</option>
357 456
 			    <?php
358 457
 					}
359 458
 			    ?>
360 459
 			    <?php
361 460
 					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
362 461
 			    ?>
363
-			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
364
-			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
365
-			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
366
-			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
462
+			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') {
463
+	print ' selected';
464
+}
465
+?>>Google Roadmap</option>
466
+			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') {
467
+	print ' selected';
468
+}
469
+?>>Google Satellite</option>
470
+			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') {
471
+	print ' selected';
472
+}
473
+?>>Google Hybrid</option>
474
+			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') {
475
+	print ' selected';
476
+}
477
+?>>Google Terrain</option>
367 478
 			    <?php
368 479
 					}
369 480
 			    ?>
370 481
 			    <?php
371 482
 					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
372 483
 			    ?>
373
-			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
374
-			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
375
-			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
484
+			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') {
485
+	print ' selected';
486
+}
487
+?>>MapQuest-OSM</option>
488
+			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') {
489
+	print ' selected';
490
+}
491
+?>>MapQuest-Aerial</option>
492
+			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') {
493
+	print ' selected';
494
+}
495
+?>>MapQuest-Hybrid</option>
376 496
 			    <?php
377 497
 					}
378 498
 			    ?>
379
-			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
380
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option>
499
+			    <option value="Yandex"<?php if ($MapType == 'Yandex') {
500
+	print ' selected';
501
+}
502
+?>>Yandex</option>
503
+			    <option value="offline"<?php if ($MapType == 'offline') {
504
+	print ' selected';
505
+}
506
+?>>Natural Earth</option>
381 507
 			    <?php
382 508
 				    }
383 509
 			    ?>
384
-			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option>
510
+			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') {
511
+	print ' selected';
512
+}
513
+?>>National Geographic Street</option>
385 514
 			    <?php
386 515
 				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
387
-					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
388
-					else $MapBoxId = $_COOKIE['MapTypeId'];
516
+					if (!isset($_COOKIE['MapTypeId'])) {
517
+						$MapBoxId = 'default';
518
+					} else {
519
+						$MapBoxId = $_COOKIE['MapTypeId'];
520
+					}
389 521
 			    ?>
390
-			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option>
391
-			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
392
-			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
393
-			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
394
-			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>
395
-			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>
396
-			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>
397
-			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>
398
-			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>
399
-			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>
400
-			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>
401
-			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
402
-			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
522
+			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') {
523
+	print ' selected';
524
+}
525
+?>>Mapbox GL</option>
526
+			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') {
527
+	print ' selected';
528
+}
529
+?>>Mapbox default</option>
530
+			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') {
531
+	print ' selected';
532
+}
533
+?>>Mapbox streets</option>
534
+			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') {
535
+	print ' selected';
536
+}
537
+?>>Mapbox light</option>
538
+			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') {
539
+	print ' selected';
540
+}
541
+?>>Mapbox dark</option>
542
+			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') {
543
+	print ' selected';
544
+}
545
+?>>Mapbox satellite</option>
546
+			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') {
547
+	print ' selected';
548
+}
549
+?>>Mapbox streets-satellite</option>
550
+			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') {
551
+	print ' selected';
552
+}
553
+?>>Mapbox streets-basic</option>
554
+			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') {
555
+	print ' selected';
556
+}
557
+?>>Mapbox comic</option>
558
+			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') {
559
+	print ' selected';
560
+}
561
+?>>Mapbox outdoors</option>
562
+			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') {
563
+	print ' selected';
564
+}
565
+?>>Mapbox pencil</option>
566
+			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') {
567
+	print ' selected';
568
+}
569
+?>>Mapbox pirates</option>
570
+			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') {
571
+	print ' selected';
572
+}
573
+?>>Mapbox emerald</option>
403 574
 			    <?php
404 575
 				    }
405 576
 			    ?>
406
-			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
577
+			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') {
578
+	print ' selected';
579
+}
580
+?>>OpenStreetMap</option>
407 581
 			    <?php
408 582
 				}
409 583
 			    ?>
@@ -414,10 +588,22 @@  discard block
 block discarded – undo
414 588
 ?>
415 589
 		    <li><?php echo _("Type of Terrain:"); ?>
416 590
 			<select  class="selectpicker" onchange="terrainType(this);">
417
-			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
418
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
419
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
420
-			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option>
591
+			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') {
592
+	print ' selected';
593
+}
594
+?>>stk terrain</option>
595
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') {
596
+	print ' selected';
597
+}
598
+?>>ellipsoid</option>
599
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') {
600
+	print ' selected';
601
+}
602
+?>>vr terrain</option>
603
+			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') {
604
+	print ' selected';
605
+}
606
+?>>ArticDEM</option>
421 607
 			</select>
422 608
 		    </li>
423 609
 <?php
@@ -427,59 +613,116 @@  discard block
 block discarded – undo
427 613
 <?php
428 614
     if (isset($globalMap3D) && $globalMap3D) {
429 615
 ?>
430
-		    <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') print 'checked'; ?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li>
616
+		    <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') {
617
+	print 'checked';
618
+}
619
+?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li>
431 620
 <?php
432 621
     }
433 622
 ?>
434 623
 <?php
435 624
     if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
436 625
 ?>
437
-		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
626
+		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') {
627
+	print 'checked';
628
+}
629
+?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
438 630
 
439 631
 <?php
440 632
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
441 633
 ?>
442
-		    <!--<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>-->
443
-		    <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>
444
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
445
-		    <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>
446
-		    <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>
634
+		    <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') {
635
+	print 'checked';
636
+}
637
+?> ><?php echo _("Display flight info as popup"); ?></label></div></li>-->
638
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) {
639
+	print 'checked';
640
+}
641
+?> ><?php echo _("Display flight path"); ?></label></div></li>
642
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) {
643
+	print 'checked';
644
+}
645
+?> ><?php echo _("Display flight route on click"); ?></label></div></li>
646
+		    <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)) {
647
+	print 'checked';
648
+}
649
+?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
650
+		    <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)) {
651
+	print 'checked';
652
+}
653
+?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
447 654
 <?php
448 655
 	} elseif (!isset($globalTracker) || $globalTracker === TRUE) {
449 656
 ?>
450
-		    <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) print 'checked'; ?> ><?php echo _("Enable map matching"); ?></label></div></li>
657
+		    <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) {
658
+	print 'checked';
659
+}
660
+?> ><?php echo _("Enable map matching"); ?></label></div></li>
451 661
 <?php
452 662
 	}
453 663
 	if (isset($globalSatellite) && $globalSatellite === TRUE) {
454 664
 ?>
455
-		    <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>
665
+		    <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)) {
666
+	print 'checked';
667
+}
668
+?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
456 669
 <?php
457 670
 	}
458 671
     }
459 672
 ?>
460
-		    <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>
461
-		    <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>
462
-		    <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>
463
-		    <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>
673
+		    <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'])) {
674
+	print 'checked';
675
+}
676
+?> ><?php echo _("Display airports on map"); ?></label></div></li>
677
+		    <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))) {
678
+	print 'checked';
679
+}
680
+?> ><?php echo _("Display ground station on map"); ?></label></div></li>
681
+		    <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))) {
682
+	print 'checked';
683
+}
684
+?> ><?php echo _("Display weather station on map"); ?></label></div></li>
685
+		    <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))) {
686
+	print 'checked';
687
+}
688
+?> ><?php echo _("Display lightning on map"); ?></label></div></li>
464 689
 <?php
465 690
 	if (isset($globalFires)) {
466 691
 ?>
467
-		    <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>
692
+		    <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))) {
693
+	print 'checked';
694
+}
695
+?> ><?php echo _("Display fires on map"); ?></label></div></li>
468 696
 <?php
469 697
 	}
470 698
 	if (isset($globalMap3D) && $globalMap3D) {
471 699
 ?>
472
-		    <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') print 'checked'; ?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li>
700
+		    <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') {
701
+	print 'checked';
702
+}
703
+?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li>
473 704
 <?php
474 705
 	}
475 706
 ?>
476 707
 <?php
477 708
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
478 709
 ?>
479
-		    <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>
480
-		    <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) print 'checked'; ?> ><?php echo _("Use shadows"); ?></label></div></li>
481
-		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
482
-		    <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) print 'checked'; ?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li>
710
+		    <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')) {
711
+	print 'checked';
712
+}
713
+?> ><?php echo _("Show mini-map"); ?></label></div></li>
714
+		    <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) {
715
+	print 'checked';
716
+}
717
+?> ><?php echo _("Use shadows"); ?></label></div></li>
718
+		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) {
719
+	print 'checked';
720
+}
721
+?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
722
+		    <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) {
723
+	print 'checked';
724
+}
725
+?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li>
483 726
 <?php
484 727
     }
485 728
     if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
@@ -492,17 +735,25 @@  discard block
 block discarded – undo
492 735
 			if (function_exists('array_column')) {
493 736
 			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
494 737
 		    ?>
495
-		    <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>
738
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
739
+	print 'checked';
740
+}
741
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
496 742
 		    <?php
497 743
 			    }
498 744
 			} elseif (isset($globalSources)) {
499 745
 			    $dispolar = false;
500 746
 			    foreach ($globalSources as $testsource) {
501
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
747
+			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) {
748
+			        	$dispolar = true;
749
+			        }
502 750
 			    }
503 751
 			    if ($dispolar) {
504 752
 		    ?>
505
-		    <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>
753
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
754
+	print 'checked';
755
+}
756
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
506 757
 		    <?php
507 758
 			    }
508 759
 		        }
@@ -515,11 +766,21 @@  discard block
 block discarded – undo
515 766
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
516 767
 		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
517 768
 		    ?>
518
-		    <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>
769
+		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') {
770
+	print 'checked';
771
+}
772
+?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
519 773
 		    <?php 
520 774
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
521 775
 		    ?>
522
-			<li><?php echo _("Aircraft icon color:"); ?><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'; ?>"></li>
776
+			<li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
777
+	print $_COOKIE['IconColor'];
778
+} elseif (isset($globalAircraftIconColor)) {
779
+	print $globalAircraftIconColor;
780
+} else {
781
+	print '1a3151';
782
+}
783
+?>"></li>
523 784
 		    <?php
524 785
 				}
525 786
 			    }
@@ -530,7 +791,14 @@  discard block
 block discarded – undo
530 791
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
531 792
 		    ?>
532 793
 		    <li><?php echo _("Marine icon color:"); ?>
533
-			<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'; ?>">
794
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
795
+	print $_COOKIE['MarineIconColor'];
796
+} elseif (isset($globalMarineIconColor)) {
797
+	print $globalMarineIconColor;
798
+} else {
799
+	print '1a3151';
800
+}
801
+?>">
534 802
 		    </li>
535 803
 		    <?php
536 804
 			    }
@@ -541,7 +809,14 @@  discard block
 block discarded – undo
541 809
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
542 810
 		    ?>
543 811
 		    <li><?php echo _("Tracker icon color:"); ?>
544
-			<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'; ?>">
812
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
813
+	print $_COOKIE['TrackerIconColor'];
814
+} elseif (isset($globalTrackerIconColor)) {
815
+	print $globalTrackerIconColor;
816
+} else {
817
+	print '1a3151';
818
+}
819
+?>">
545 820
 		    </li>
546 821
 		    <?php
547 822
 			    }
@@ -552,8 +827,22 @@  discard block
 block discarded – undo
552 827
 		    ?>
553 828
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
554 829
 			<div class="range">
555
-			    <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'; ?>">
556
-			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>
830
+			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) {
831
+	print $_COOKIE['AirportZoom'];
832
+} elseif (isset($globalAirportZoom)) {
833
+	print $globalAirportZoom;
834
+} else {
835
+	print '7';
836
+}
837
+?>">
838
+			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) {
839
+	print $_COOKIE['AirportZoom'];
840
+} elseif (isset($globalAirportZoom)) {
841
+	print $globalAirportZoom;
842
+} else {
843
+	print '7';
844
+}
845
+?></output>
557 846
 			</div>
558 847
 		    </li>
559 848
 		    <?php
@@ -564,17 +853,40 @@  discard block
 block discarded – undo
564 853
 ?>
565 854
 		    <li><?php echo _("Set scaling factor for rendering resolution:"); ?>
566 855
 			<div class="range">
567
-			    <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?>">
568
-			    <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?></output>
856
+			    <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) {
857
+	print $_COOKIE['resolutionScale'];
858
+} else {
859
+	print '1';
860
+}
861
+?>">
862
+			    <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) {
863
+	print $_COOKIE['resolutionScale'];
864
+} else {
865
+	print '1';
866
+}
867
+?></output>
569 868
 			</div>
570 869
 		    </li>
571 870
 <?php
572 871
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
573 872
 ?>
574
-		    <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>
575
-		    <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"); ?>&nbsp;
873
+		    <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') {
874
+	print 'checked';
875
+}
876
+?> > <?php echo _("Use airlines liveries"); ?></li>
877
+		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') {
878
+	print 'checked';
879
+}
880
+?> > <?php echo _("Force Aircraft color"); ?>&nbsp;
576 881
 		    <!--<li><?php echo _("Aircraft icon color:"); ?>-->
577
-			<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'; ?>">
882
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
883
+	print $_COOKIE['IconColor'];
884
+} elseif (isset($globalAircraftIconColor)) {
885
+	print $globalAircraftIconColor;
886
+} else {
887
+	print 'ff0000';
888
+}
889
+?>">
578 890
 		    </li>
579 891
 <?php
580 892
 	}
@@ -582,9 +894,19 @@  discard block
 block discarded – undo
582 894
 <?php
583 895
 	if (isset($globalMarine) && $globalMarine === TRUE) {
584 896
 ?>
585
-		    <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"); ?>&nbsp;
897
+		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') {
898
+	print 'checked';
899
+}
900
+?> ><?php echo _("Force Marine color"); ?>&nbsp;
586 901
 		    <!--<li><?php echo _("Marine icon color:"); ?>-->
587
-			<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'; ?>">
902
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
903
+	print $_COOKIE['MarineIconColor'];
904
+} elseif (isset($globalMarineIconColor)) {
905
+	print $globalMarineIconColor;
906
+} else {
907
+	print 'ff0000';
908
+}
909
+?>">
588 910
 		    </li>
589 911
 <?php
590 912
 	}
@@ -592,9 +914,19 @@  discard block
 block discarded – undo
592 914
 <?php
593 915
 	if (isset($globalTracker) && $globalTracker === TRUE) {
594 916
 ?>
595
-		    <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"); ?>&nbsp;
917
+		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') {
918
+	print 'checked';
919
+}
920
+?> ><?php echo _("Force Tracker color"); ?>&nbsp;
596 921
 		    <!--<li><?php echo _("Tracker icon color:"); ?>-->
597
-			<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'; ?>">
922
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
923
+	print $_COOKIE['TrackerIconColor'];
924
+} elseif (isset($globalTrackerIconColor)) {
925
+	print $globalTrackerIconColor;
926
+} else {
927
+	print 'ff0000';
928
+}
929
+?>">
598 930
 		    </li>
599 931
 <?php
600 932
 	}
@@ -602,22 +934,46 @@  discard block
 block discarded – undo
602 934
 ?>
603 935
 		    <li><?php echo _("Distance unit:"); ?>
604 936
 			<select class="selectpicker" onchange="unitdistance(this);">
605
-			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
606
-			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>
607
-			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>
937
+			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
938
+	echo ' selected';
939
+}
940
+?>>km</option>
941
+			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
942
+	echo ' selected';
943
+}
944
+?>>nm</option>
945
+			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
946
+	echo ' selected';
947
+}
948
+?>>mi</option>
608 949
 		        </select>
609 950
 		    </li>
610 951
 		    <li><?php echo _("Altitude unit:"); ?>
611 952
 			<select class="selectpicker" onchange="unitaltitude(this);">
612
-			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>
613
-			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>
953
+			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) {
954
+	echo ' selected';
955
+}
956
+?>>m</option>
957
+			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
958
+	echo ' selected';
959
+}
960
+?>>feet</option>
614 961
 		        </select>
615 962
 		    </li>
616 963
 		    <li><?php echo _("Speed unit:"); ?>
617 964
 			<select class="selectpicker" onchange="unitspeed(this);">
618
-			    <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>
619
-			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>
620
-			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>
965
+			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) {
966
+	echo ' selected';
967
+}
968
+?>>km/h</option>
969
+			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
970
+	echo ' selected';
971
+}
972
+?>>mph</option>
973
+			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
974
+	echo ' selected';
975
+}
976
+?>>knots</option>
621 977
 		        </select>
622 978
 		    </li>
623 979
 
@@ -635,9 +991,18 @@  discard block
 block discarded – undo
635 991
 		    <?php
636 992
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
637 993
 		    ?>
638
-			<?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 } ?>
639
-			<?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 } ?>
640
-			<?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 } ?>
994
+			<?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'])) {
995
+	print 'checked';
996
+}
997
+?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
998
+			<?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'])) {
999
+	print 'checked';
1000
+}
1001
+?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
1002
+			<?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'])) {
1003
+	print 'checked';
1004
+}
1005
+?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
641 1006
 		    <?php
642 1007
 			}
643 1008
 		    ?>
@@ -645,10 +1010,16 @@  discard block
 block discarded – undo
645 1010
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
646 1011
 		    ?>
647 1012
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
648
-			    <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>
1013
+			    <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'])) {
1014
+	print 'checked';
1015
+}
1016
+?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
649 1017
 			<?php } ?>
650 1018
 			<?php if (isset($globalAPRS) && $globalAPRS) { ?>
651
-			    <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>
1019
+			    <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'])) {
1020
+	print 'checked';
1021
+}
1022
+?> ><?php echo _("Display APRS data"); ?></label></div></li>
652 1023
 			<?php } ?>
653 1024
 		    <?php
654 1025
 			}
@@ -665,7 +1036,9 @@  discard block
 block discarded – undo
665 1036
 				}
666 1037
 				foreach($allairlinenames as $airline) {
667 1038
 					$airline_name = $airline['airline_name'];
668
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
1039
+					if (strlen($airline_name) > 30) {
1040
+						$airline_name = substr($airline_name,0,30).'...';
1041
+					}
669 1042
 					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) {
670 1043
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
671 1044
 					} else {
@@ -683,7 +1056,10 @@  discard block
 block discarded – undo
683 1056
 		    <li><?php echo _("Display alliance:"); ?>
684 1057
 		    <br/>
685 1058
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
686
-			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
1059
+			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') {
1060
+	echo ' selected';
1061
+}
1062
+?>><?php echo _("All"); ?></option>
687 1063
 			    <?php
688 1064
 				foreach($allalliancenames as $alliance) {
689 1065
 					$alliance_name = $alliance['alliance'];
@@ -742,10 +1118,22 @@  discard block
 block discarded – undo
742 1118
 		    ?>
743 1119
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
744 1120
 			<select class="selectpicker" onchange="airlinestype(this);">
745
-			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
746
-			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option>
747
-			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option>
748
-			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option>
1121
+			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') {
1122
+	echo ' selected';
1123
+}
1124
+?>><?php echo _("All"); ?></option>
1125
+			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') {
1126
+	echo ' selected';
1127
+}
1128
+?>><?php echo _("Passenger"); ?></option>
1129
+			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') {
1130
+	echo ' selected';
1131
+}
1132
+?>><?php echo _("Cargo"); ?></option>
1133
+			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') {
1134
+	echo ' selected';
1135
+}
1136
+?>><?php echo _("Military"); ?></option>
749 1137
 			</select>
750 1138
 		    </li>
751 1139
 		    <?php
@@ -759,7 +1147,10 @@  discard block
 block discarded – undo
759 1147
 		    ?>
760 1148
 		    <li>
761 1149
 			<?php echo _("Display vessels with MMSI:"); ?>
762
-			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" />
1150
+			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) {
1151
+	print $_COOKIE['filter_mmsi'];
1152
+}
1153
+?>" />
763 1154
 		    </li>
764 1155
 			<?php
765 1156
 				if (isset($globalVM) && $globalVM) {
@@ -786,7 +1177,10 @@  discard block
 block discarded – undo
786 1177
 		    ?>
787 1178
 		    <li>
788 1179
 			<?php echo _("Display with ident:"); ?>
789
-			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
1180
+			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) {
1181
+	print $_COOKIE['filter_ident'];
1182
+}
1183
+?>" />
790 1184
 		    </li>
791 1185
 		</ul>
792 1186
 	    </form>
@@ -802,7 +1196,10 @@  discard block
 block discarded – undo
802 1196
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
803 1197
 	    <form>
804 1198
 		<ul>
805
-		    <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>
1199
+		    <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'])) {
1200
+	print 'checked';
1201
+}
1202
+?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
806 1203
 		    <li><?php echo _("Type:"); ?>
807 1204
 			<select class="selectpicker" multiple onchange="sattypes(this);">
808 1205
 			    <?php
@@ -810,25 +1207,45 @@  discard block
 block discarded – undo
810 1207
 				$types = $Satellite->get_tle_types();
811 1208
 				foreach ($types as $type) {
812 1209
 					$type_name = $type['tle_type'];
813
-					if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';
814
-					else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';
815
-					else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';
816
-					else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';
817
-					else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';
818
-					else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';
819
-					else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';
820
-					else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';
821
-					else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';
822
-					else if ($type_name == 'resource') $type_name = 'Earth Resources';
823
-					else if ($type_name == 'stations') $type_name = 'Space Stations';
824
-					else if ($type_name == 'geo') $type_name = 'Geostationary';
825
-					else if ($type_name == 'amateur') $type_name = 'Amateur Radio';
826
-					else if ($type_name == 'x-comm') $type_name = 'Experimental';
827
-					else if ($type_name == 'other-comm') $type_name = 'Other Comm';
828
-					else if ($type_name == 'science') $type_name = 'Space & Earth Science';
829
-					else if ($type_name == 'military') $type_name = 'Miscellaneous Military';
830
-					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
831
-					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
1210
+					if ($type_name == 'musson') {
1211
+						$type_name = 'Russian LEO Navigation';
1212
+					} else if ($type_name == 'nnss') {
1213
+						$type_name = 'Navi Navigation Satellite System';
1214
+					} else if ($type_name == 'sbas') {
1215
+						$type_name = 'Satellite-Based Augmentation System';
1216
+					} else if ($type_name == 'glo-ops') {
1217
+						$type_name = 'Glonass Operational';
1218
+					} else if ($type_name == 'gps-ops') {
1219
+						$type_name = 'GPS Operational';
1220
+					} else if ($type_name == 'argos') {
1221
+						$type_name = 'ARGOS Data Collection System';
1222
+					} else if ($type_name == 'tdrss') {
1223
+						$type_name = 'Tracking and Data Relay Satellite System';
1224
+					} else if ($type_name == 'sarsat') {
1225
+						$type_name = 'Search & Rescue';
1226
+					} else if ($type_name == 'dmc') {
1227
+						$type_name = 'Disaster Monitoring';
1228
+					} else if ($type_name == 'resource') {
1229
+						$type_name = 'Earth Resources';
1230
+					} else if ($type_name == 'stations') {
1231
+						$type_name = 'Space Stations';
1232
+					} else if ($type_name == 'geo') {
1233
+						$type_name = 'Geostationary';
1234
+					} else if ($type_name == 'amateur') {
1235
+						$type_name = 'Amateur Radio';
1236
+					} else if ($type_name == 'x-comm') {
1237
+						$type_name = 'Experimental';
1238
+					} else if ($type_name == 'other-comm') {
1239
+						$type_name = 'Other Comm';
1240
+					} else if ($type_name == 'science') {
1241
+						$type_name = 'Space & Earth Science';
1242
+					} else if ($type_name == 'military') {
1243
+						$type_name = 'Miscellaneous Military';
1244
+					} else if ($type_name == 'radar') {
1245
+						$type_name = 'Radar Calibration';
1246
+					} else if ($type_name == 'tle-new') {
1247
+						$type_name = 'Last 30 days launches';
1248
+					}
832 1249
 					
833 1250
 					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
834 1251
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
Please login to merge, or discard this patch.