Completed
Push — master ( 58c255...c48aca )
by Yannick
29:20
created
header.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,31 +13,31 @@  discard block
 block discarded – undo
13 13
 
14 14
 
15 15
 if (isset($_GET['3d'])) {
16
-	setcookie('MapFormat','3d');
16
+	setcookie('MapFormat', '3d');
17 17
 } else if (isset($_GET['2d'])) {
18
-	setcookie('MapFormat','2d');
18
+	setcookie('MapFormat', '2d');
19 19
 }
20 20
 
21 21
 if (isset($_POST['archive'])) {
22
-	setcookie('archive','true');
23
-	setcookie('archive_begin',strtotime($_POST['start_date']));
24
-	setcookie('archive_end',strtotime($_POST['end_date']));
25
-	setcookie('archive_speed',$_POST['archivespeed']);
22
+	setcookie('archive', 'true');
23
+	setcookie('archive_begin', strtotime($_POST['start_date']));
24
+	setcookie('archive_end', strtotime($_POST['end_date']));
25
+	setcookie('archive_speed', $_POST['archivespeed']);
26 26
 }
27 27
 if (isset($_POST['noarchive'])) {
28
-	setcookie('archive','false',-1);
29
-	setcookie('archive_begin','',-1);
30
-	setcookie('archive_end','',-1);
31
-	setcookie('archive_speed','',-1);
28
+	setcookie('archive', 'false', -1);
29
+	setcookie('archive_begin', '', -1);
30
+	setcookie('archive_end', '', -1);
31
+	setcookie('archive_speed', '', -1);
32 32
 }
33 33
 // When button "Remove all filters" is clicked
34 34
 if (isset($_POST['removefilters'])) {
35
-	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
36
-	    return strpos($key,'filter_') === 0;
35
+	$allfilters = array_filter(array_keys($_COOKIE), function($key) {
36
+	    return strpos($key, 'filter_') === 0;
37 37
 	});
38 38
 	foreach ($allfilters as $filt) {
39 39
 		unset($_COOKIE[$filt]);
40
-		setcookie($filt,null,-1);
40
+		setcookie($filt, null, -1);
41 41
 	}
42 42
 }
43 43
 ?>
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
242 242
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
243 243
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
244
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
244
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
245 245
 <?php
246 246
 		if (!isset($type) || $type == 'aircraft') {
247 247
 ?>
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
315 315
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
316 316
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
317
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
317
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
318 318
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
319 319
 <?php
320 320
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 ?>
679 679
       <div class="search">
680 680
       <form action="<?php print $globalURL; ?>/search" method="get">
681
-		<input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != ""){ print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>
681
+		<input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != "") { print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button>
682 682
 	</form>
683 683
 	</div>
684 684
   	<div class="social">
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 	print '</div>';
697 697
 }
698 698
 
699
-if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') {
699
+if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') {
700 700
 ?>
701 701
     <div class="top-header clear" role="main">
702 702
 <?php
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
     </div>
710 710
 <?php
711 711
 }
712
-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))
712
+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))
713 713
 {
714 714
     ?>
715 715
     <div class="top-header clear" role="main">
@@ -722,15 +722,15 @@  discard block
 block discarded – undo
722 722
         var zoom = 13;
723 723
 //create the map
724 724
 <?php
725
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
725
+    if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) {
726 726
 ?>
727 727
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
728 728
 <?php
729
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
729
+    } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) {
730 730
 ?>
731 731
   map = L.map('map', { zoomControl:true });
732 732
 <?php
733
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
733
+    } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
734 734
 ?>
735 735
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
736 736
     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);
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
     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);
739 739
     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);
740 740
 <?php
741
-    } 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'])) {
741
+    } 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'])) {
742 742
 ?>
743 743
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
744 744
 <?php
Please login to merge, or discard this patch.
Braces   +77 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,10 +6,15 @@  discard block
 block discarded – undo
6 6
 //gets the page file and stores it in a variable
7 7
 $file_path = pathinfo($_SERVER['SCRIPT_NAME']);
8 8
 $current_page = $file_path['filename'];
9
-if ($globalTimezone == '') $globalTimezone = 'UTC';
9
+if ($globalTimezone == '') {
10
+	$globalTimezone = 'UTC';
11
+}
10 12
 date_default_timezone_set($globalTimezone);
11
-if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType'];
12
-else $MapType = $globalMapProvider;
13
+if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') {
14
+	$MapType = $_COOKIE['MapType'];
15
+} else {
16
+	$MapType = $globalMapProvider;
17
+}
13 18
 
14 19
 
15 20
 if (isset($_GET['3d'])) {
@@ -241,7 +246,13 @@  discard block
 block discarded – undo
241 246
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
242 247
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
243 248
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
244
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
249
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) {
250
+	print '&latitude='.$latitude;
251
+}
252
+?><?php if(isset($longitude)) {
253
+	print '&longitude='.$longitude;
254
+}
255
+?>&<?php print time(); ?>"></script>
245 256
 <?php
246 257
 		if (!isset($type) || $type == 'aircraft') {
247 258
 ?>
@@ -314,7 +325,13 @@  discard block
 block discarded – undo
314 325
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
315 326
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
316 327
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
317
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
328
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) {
329
+	print '&latitude='.$latitude;
330
+}
331
+?><?php if(isset($longitude)) {
332
+	print '&longitude='.$longitude;
333
+}
334
+?>&<?php print time(); ?>"></script>
318 335
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
319 336
 <?php
320 337
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -395,7 +412,12 @@  discard block
 block discarded – undo
395 412
         <span class="icon-bar"></span>
396 413
       </button>
397 414
       <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a>
398
-      <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
415
+      <a class="navbar-brand" href="<?php if ($globalURL == '') {
416
+	print '/';
417
+} else {
418
+	print $globalURL;
419
+}
420
+?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
399 421
     </div>
400 422
     <div class="collapse navbar-collapse">
401 423
 
@@ -434,7 +456,10 @@  discard block
 block discarded – undo
434 456
 <?php
435 457
     }
436 458
 ?>
437
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
459
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
460
+	echo 'right-';
461
+}
462
+?>caret"></b></a>
438 463
           <ul class="dropdown-menu">
439 464
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li>
440 465
 <?php
@@ -505,8 +530,14 @@  discard block
 block discarded – undo
505 530
         </li>
506 531
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
507 532
       	<li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li>
508
-        <li class="dropdown<?php if ($sub) echo '-submenu'; ?>">
509
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
533
+        <li class="dropdown<?php if ($sub) {
534
+	echo '-submenu';
535
+}
536
+?>">
537
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) {
538
+	echo 'right-';
539
+}
540
+?>caret"></b></a>
510 541
           <ul class="dropdown-menu">
511 542
           	<li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li>
512 543
           	<li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li>
@@ -542,7 +573,10 @@  discard block
 block discarded – undo
542 573
 <?php
543 574
 	}
544 575
 ?>
545
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
576
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
577
+	echo 'right-';
578
+}
579
+?>caret"></b></a>
546 580
 		<ul class="dropdown-menu">
547 581
 		    <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li>
548 582
 		    <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -575,7 +609,10 @@  discard block
 block discarded – undo
575 609
 <?php
576 610
 	}
577 611
 ?>
578
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
612
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
613
+	echo 'right-';
614
+}
615
+?>caret"></b></a>
579 616
 		<ul class="dropdown-menu">
580 617
 		    <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li>
581 618
 		    <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -609,7 +646,10 @@  discard block
 block discarded – undo
609 646
 	}
610 647
 ?>
611 648
 <!--
612
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
649
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
650
+	echo 'right-';
651
+}
652
+?>caret"></b></a>
613 653
 		<ul class="dropdown-menu">
614 654
 		    <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li>
615 655
 		    <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -666,7 +706,9 @@  discard block
 block discarded – undo
666 706
   		        $alllang = $Language->getLanguages();
667 707
   		        foreach ($alllang as $key => $lang) {
668 708
   		            print '<option value="'.$key.'"';
669
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
709
+  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) {
710
+  		            	print ' selected ';
711
+  		            }
670 712
   		            print '>'.$lang[0].'</option>';
671 713
   		        }
672 714
   		    ?>
@@ -806,9 +848,24 @@  discard block
 block discarded – undo
806 848
 	$customid = $globalMapProvider;
807 849
 ?>
808 850
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
809
-        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>,
810
-        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
811
-        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
851
+        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
852
+	print $globalMapCustomLayer[$customid]['maxZoom'];
853
+} else {
854
+	print '18';
855
+}
856
+?>,
857
+        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
858
+	print $globalMapCustomLayer[$customid]['minZoom'];
859
+} else {
860
+	print '0';
861
+}
862
+?>,
863
+        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
864
+	print 'false';
865
+} else {
866
+	print 'true';
867
+}
868
+?>,
812 869
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
813 870
     }).addTo(map);
814 871
 <?php
@@ -831,4 +888,7 @@  discard block
 block discarded – undo
831 888
 
832 889
 ?>
833 890
 
834
-<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear">
891
+<section class="container main-content <?php if (strtolower($current_page) == 'index') {
892
+	print 'index ';
893
+}
894
+?>clear">
Please login to merge, or discard this patch.