@@ -4,11 +4,19 @@ discard block |
||
4 | 4 | if (isset($_SESSION['error'])) { |
5 | 5 | header('Content-Encoding: none;'); |
6 | 6 | echo 'Error : '.$_SESSION['error'].' - Resetting install... You need to fix the problem and run install again.'; |
7 | - if (isset($_SESSION['error'])) unset($_SESSION['error']); |
|
8 | - if (isset($_SESSION['errorlst'])) unset($_SESSION['errorlst']); |
|
9 | - if (isset($_SESSION['next'])) unset($_SESSION['next']); |
|
10 | - if (isset($_SESSION['install'])) unset($_SESSION['install']); |
|
11 | -} |
|
7 | + if (isset($_SESSION['error'])) { |
|
8 | + unset($_SESSION['error']); |
|
9 | + } |
|
10 | + if (isset($_SESSION['errorlst'])) { |
|
11 | + unset($_SESSION['errorlst']); |
|
12 | + } |
|
13 | + if (isset($_SESSION['next'])) { |
|
14 | + unset($_SESSION['next']); |
|
15 | + } |
|
16 | + if (isset($_SESSION['install'])) { |
|
17 | + unset($_SESSION['install']); |
|
18 | + } |
|
19 | + } |
|
12 | 20 | /* |
13 | 21 | if (isset($_SESSION['errorlst'])) { |
14 | 22 | header('Content-Encoding: none;'); |
@@ -114,7 +122,9 @@ discard block |
||
114 | 122 | if (count($alllng) != count($availablelng)) { |
115 | 123 | $notavailable = array(); |
116 | 124 | foreach($alllng as $lng) { |
117 | - if (!isset($availablelng[$lng])) $notavailable[] = $lng; |
|
125 | + if (!isset($availablelng[$lng])) { |
|
126 | + $notavailable[] = $lng; |
|
127 | + } |
|
118 | 128 | } |
119 | 129 | print '<div class="alert alert-warning">The following translation can\'t be used on your system: '.implode(', ',$notavailable).'. You need to add the system locales: <a href="https://github.com/Ysurac/FlightAirMap/wiki/Translation">documentation</a>.</div>'; |
120 | 130 | } |
@@ -175,31 +185,49 @@ discard block |
||
175 | 185 | </div> |
176 | 186 | <p> |
177 | 187 | <label for="dbhost">Database hostname</label> |
178 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
188 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
189 | + print $globalDBhost; |
|
190 | +} |
|
191 | +?>" /> |
|
179 | 192 | </p> |
180 | 193 | <p> |
181 | 194 | <label for="dbport">Database port</label> |
182 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
195 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
196 | + print $globalDBport; |
|
197 | +} |
|
198 | +?>" /> |
|
183 | 199 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
184 | 200 | </p> |
185 | 201 | <p> |
186 | 202 | <label for="dbname">Database name</label> |
187 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
203 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
204 | + print $globalDBname; |
|
205 | +} |
|
206 | +?>" /> |
|
188 | 207 | </p> |
189 | 208 | <p> |
190 | 209 | <label for="dbuser">Database user</label> |
191 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
210 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
211 | + print $globalDBuser; |
|
212 | +} |
|
213 | +?>" /> |
|
192 | 214 | </p> |
193 | 215 | <p> |
194 | 216 | <label for="dbuserpass">Database user password</label> |
195 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
217 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
218 | + print $globalDBpass; |
|
219 | +} |
|
220 | +?>" /> |
|
196 | 221 | </p> |
197 | 222 | </fieldset> |
198 | 223 | <fieldset id="site"> |
199 | 224 | <legend>Site configuration</legend> |
200 | 225 | <p> |
201 | 226 | <label for="sitename">Site name</label> |
202 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
227 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
228 | + print $globalName; |
|
229 | +} |
|
230 | +?>" /> |
|
203 | 231 | </p> |
204 | 232 | <p> |
205 | 233 | <label for="siteurl">Site directory</label> |
@@ -212,18 +240,27 @@ discard block |
||
212 | 240 | } |
213 | 241 | } |
214 | 242 | ?> |
215 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
243 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
244 | + print $globalURL; |
|
245 | +} |
|
246 | +?>" /> |
|
216 | 247 | <p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
217 | 248 | <p class="help-block">Can be empty</p> |
218 | 249 | </p> |
219 | 250 | <p> |
220 | 251 | <label for="timezone">Timezone</label> |
221 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
252 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
253 | + print $globalTimezone; |
|
254 | +} |
|
255 | +?>" /> |
|
222 | 256 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
223 | 257 | </p> |
224 | 258 | <p> |
225 | 259 | <label for="language">Language</label> |
226 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
260 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
261 | + print $globalLanguage; |
|
262 | +} |
|
263 | +?>" /> |
|
227 | 264 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
228 | 265 | </p> |
229 | 266 | </fieldset> |
@@ -243,11 +280,17 @@ discard block |
||
243 | 280 | <div id="mapbox_data"> |
244 | 281 | <p> |
245 | 282 | <label for="mapboxid">Mapbox id</label> |
246 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
283 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
284 | + print $globalMapboxId; |
|
285 | +} |
|
286 | +?>" /> |
|
247 | 287 | </p> |
248 | 288 | <p> |
249 | 289 | <label for="mapboxtoken">Mapbox token</label> |
250 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
290 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
291 | + print $globalMapboxToken; |
|
292 | +} |
|
293 | +?>" /> |
|
251 | 294 | </p> |
252 | 295 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
253 | 296 | </div> |
@@ -255,7 +298,10 @@ discard block |
||
255 | 298 | <div id="google_data"> |
256 | 299 | <p> |
257 | 300 | <label for="googlekey">Google API key</label> |
258 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
301 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
302 | + print $globalGoogleAPIKey; |
|
303 | +} |
|
304 | +?>" /> |
|
259 | 305 | <p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p> |
260 | 306 | </p> |
261 | 307 | </div> |
@@ -263,7 +309,10 @@ discard block |
||
263 | 309 | <div id="bing_data"> |
264 | 310 | <p> |
265 | 311 | <label for="bingkey">Bing Map key</label> |
266 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
312 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
313 | + print $globalBingMapKey; |
|
314 | +} |
|
315 | +?>" /> |
|
267 | 316 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
268 | 317 | </p> |
269 | 318 | </div> |
@@ -271,7 +320,10 @@ discard block |
||
271 | 320 | <div id="mapquest_data"> |
272 | 321 | <p> |
273 | 322 | <label for="mapquestkey">MapQuest key</label> |
274 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
323 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
324 | + print $globalMapQuestKey; |
|
325 | +} |
|
326 | +?>" /> |
|
275 | 327 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
276 | 328 | </p> |
277 | 329 | </div> |
@@ -279,11 +331,17 @@ discard block |
||
279 | 331 | <div id="here_data"> |
280 | 332 | <p> |
281 | 333 | <label for="hereappid">Here App_Id</label> |
282 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
334 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
335 | + print $globalHereappId; |
|
336 | +} |
|
337 | +?>" /> |
|
283 | 338 | </p> |
284 | 339 | <p> |
285 | 340 | <label for="hereappcode">Here App_Code</label> |
286 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
341 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
342 | + print $globalHereappCode; |
|
343 | +} |
|
344 | +?>" /> |
|
287 | 345 | </p> |
288 | 346 | <p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p> |
289 | 347 | </div> |
@@ -291,7 +349,10 @@ discard block |
||
291 | 349 | <div id="openweathermap_data"> |
292 | 350 | <p> |
293 | 351 | <label for="openweathermapkey">OpenWeatherMap key (weather layer)</label> |
294 | - <input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" /> |
|
352 | + <input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) { |
|
353 | + print $globalOpenWeatherMapKey; |
|
354 | +} |
|
355 | +?>" /> |
|
295 | 356 | <p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p> |
296 | 357 | </p> |
297 | 358 | </div> |
@@ -320,42 +381,86 @@ discard block |
||
320 | 381 | <legend>Coverage area</legend> |
321 | 382 | <p> |
322 | 383 | <label for="latitudemax">The maximum latitude (north)</label> |
323 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
384 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
385 | + print $globalLatitudeMax; |
|
386 | +} |
|
387 | +?>" /> |
|
324 | 388 | </p> |
325 | 389 | <p> |
326 | 390 | <label for="latitudemin">The minimum latitude (south)</label> |
327 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
391 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
392 | + print $globalLatitudeMin; |
|
393 | +} |
|
394 | +?>" /> |
|
328 | 395 | </p> |
329 | 396 | <p> |
330 | 397 | <label for="longitudemax">The maximum longitude (west)</label> |
331 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
398 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
399 | + print $globalLongitudeMax; |
|
400 | +} |
|
401 | +?>" /> |
|
332 | 402 | </p> |
333 | 403 | <p> |
334 | 404 | <label for="longitudemin">The minimum longitude (east)</label> |
335 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
405 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
406 | + print $globalLongitudeMin; |
|
407 | +} |
|
408 | +?>" /> |
|
336 | 409 | </p> |
337 | 410 | <p> |
338 | 411 | <label for="latitudecenter">The latitude center</label> |
339 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
412 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
413 | + print $globalCenterLatitude; |
|
414 | +} |
|
415 | +?>" /> |
|
340 | 416 | </p> |
341 | 417 | <p> |
342 | 418 | <label for="longitudecenter">The longitude center</label> |
343 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
419 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
420 | + print $globalCenterLongitude; |
|
421 | +} |
|
422 | +?>" /> |
|
344 | 423 | </p> |
345 | 424 | <p> |
346 | 425 | <label for="livezoom">Default Zoom on live map</label> |
347 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
426 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
427 | + print $globalLiveZoom; |
|
428 | +} else { |
|
429 | + print '9'; |
|
430 | +} |
|
431 | +?>" /> |
|
348 | 432 | </p> |
349 | 433 | <p> |
350 | 434 | <label for="squawk_country">Country for squawk usage</label> |
351 | 435 | <select name="squawk_country" id="squawk_country"> |
352 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
353 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
354 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
355 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
356 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
357 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
358 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
436 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
437 | + print ' selected '; |
|
438 | +} |
|
439 | +?>>UK</option> |
|
440 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
441 | + print ' selected '; |
|
442 | +} |
|
443 | +?>>NZ</option> |
|
444 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
445 | + print ' selected '; |
|
446 | +} |
|
447 | +?>>US</option> |
|
448 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
449 | + print ' selected '; |
|
450 | +} |
|
451 | +?>>AU</option> |
|
452 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
453 | + print ' selected '; |
|
454 | +} |
|
455 | +?>>NL</option> |
|
456 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
457 | + print ' selected '; |
|
458 | +} |
|
459 | +?>>FR</option> |
|
460 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
461 | + print ' selected '; |
|
462 | +} |
|
463 | +?>>TR</option> |
|
359 | 464 | </select> |
360 | 465 | </p> |
361 | 466 | </fieldset> |
@@ -364,15 +469,24 @@ discard block |
||
364 | 469 | <p><i>Only put in DB flights that are inside a circle</i></p> |
365 | 470 | <p> |
366 | 471 | <label for="latitude">Center latitude</label> |
367 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
472 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
473 | + echo $globalDistanceIgnore['latitude']; |
|
474 | +} |
|
475 | +?>" /> |
|
368 | 476 | </p> |
369 | 477 | <p> |
370 | 478 | <label for="longitude">Center longitude</label> |
371 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
479 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
480 | + echo $globalDistanceIgnore['longitude']; |
|
481 | +} |
|
482 | +?>" /> |
|
372 | 483 | </p> |
373 | 484 | <p> |
374 | 485 | <label for="Distance">Distance (in km)</label> |
375 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
486 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
487 | + echo $globalDistanceIgnore['distance']; |
|
488 | +} |
|
489 | +?>" /> |
|
376 | 490 | </p> |
377 | 491 | </fieldset> |
378 | 492 | <fieldset id="sourceloc"> |
@@ -495,22 +609,34 @@ discard block |
||
495 | 609 | <div id="flightaware_data"> |
496 | 610 | <p> |
497 | 611 | <label for="flightawareusername">FlightAware username</label> |
498 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
612 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
613 | + print $globalFlightAwareUsername; |
|
614 | +} |
|
615 | +?>" /> |
|
499 | 616 | </p> |
500 | 617 | <p> |
501 | 618 | <label for="flightawarepassword">FlightAware password/API key</label> |
502 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
619 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
620 | + print $globalFlightAwarePassword; |
|
621 | +} |
|
622 | +?>" /> |
|
503 | 623 | </p> |
504 | 624 | </div> |
505 | 625 | --> |
506 | 626 | <div id="sailaway_data"> |
507 | 627 | <p> |
508 | 628 | <label for="sailawayemail">Sailaway email</label> |
509 | - <input type="text" name="sailawayemail" id="sailawayemail" value="<?php if (isset($globalSailaway['email'])) print $globalSailaway['email']; ?>" /> |
|
629 | + <input type="text" name="sailawayemail" id="sailawayemail" value="<?php if (isset($globalSailaway['email'])) { |
|
630 | + print $globalSailaway['email']; |
|
631 | +} |
|
632 | +?>" /> |
|
510 | 633 | </p> |
511 | 634 | <p> |
512 | 635 | <label for="sailawaypassword">Sailaway password</label> |
513 | - <input type="text" name="sailawaypassword" id="sailawaypassword" value="<?php if (isset($globalSailaway['password'])) print $globalSailaway['password']; ?>" /> |
|
636 | + <input type="text" name="sailawaypassword" id="sailawaypassword" value="<?php if (isset($globalSailaway['password'])) { |
|
637 | + print $globalSailaway['password']; |
|
638 | +} |
|
639 | +?>" /> |
|
514 | 640 | </p> |
515 | 641 | </div> |
516 | 642 | |
@@ -552,7 +678,10 @@ discard block |
||
552 | 678 | if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
553 | 679 | ?> |
554 | 680 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
555 | - <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
|
681 | + <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) { |
|
682 | + print $source['port']; |
|
683 | +} |
|
684 | +?>" /></td> |
|
556 | 685 | <?php |
557 | 686 | } else { |
558 | 687 | $hostport = explode(':',$source['host']); |
@@ -571,37 +700,118 @@ discard block |
||
571 | 700 | ?> |
572 | 701 | <td> |
573 | 702 | <select name="format[]" id="format"> |
574 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
575 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
576 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
577 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
578 | - <option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option> |
|
579 | - <option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') print 'selected'; ?>>Planefinder client</option> |
|
580 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
581 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
582 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
583 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
584 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
585 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
586 | - <option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option> |
|
587 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
588 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
589 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
590 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
591 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
592 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
593 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
594 | - <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option> |
|
595 | - <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option> |
|
596 | - <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option> |
|
597 | - <option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') print 'selected'; ?>>Sailaway</option> |
|
703 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
704 | + print 'selected'; |
|
705 | +} |
|
706 | +?>>Auto</option> |
|
707 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
708 | + print 'selected'; |
|
709 | +} |
|
710 | +?>>SBS</option> |
|
711 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
712 | + print 'selected'; |
|
713 | +} |
|
714 | +?>>TSV</option> |
|
715 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
716 | + print 'selected'; |
|
717 | +} |
|
718 | +?>>Raw</option> |
|
719 | + <option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') { |
|
720 | + print 'selected'; |
|
721 | +} |
|
722 | +?>>Dump1090 aircraft.json</option> |
|
723 | + <option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') { |
|
724 | + print 'selected'; |
|
725 | +} |
|
726 | +?>>Planefinder client</option> |
|
727 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
728 | + print 'selected'; |
|
729 | +} |
|
730 | +?>>APRS</option> |
|
731 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
732 | + print 'selected'; |
|
733 | +} |
|
734 | +?>>Radarcape deltadb.txt</option> |
|
735 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
736 | + print 'selected'; |
|
737 | +} |
|
738 | +?>>Vatsim</option> |
|
739 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
740 | + print 'selected'; |
|
741 | +} |
|
742 | +?>>Virtual Radar Server AircraftList.json</option> |
|
743 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
744 | + print 'selected'; |
|
745 | +} |
|
746 | +?>>Virtual Radar Server TCP</option> |
|
747 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
748 | + print 'selected'; |
|
749 | +} |
|
750 | +?>>phpVMS</option> |
|
751 | + <option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
752 | + print 'selected'; |
|
753 | +} |
|
754 | +?>>Virtual Airline Operations System (VAOS)</option> |
|
755 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
756 | + print 'selected'; |
|
757 | +} |
|
758 | +?>>Virtual Airlines Manager</option> |
|
759 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
760 | + print 'selected'; |
|
761 | +} |
|
762 | +?>>IVAO</option> |
|
763 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
764 | + print 'selected'; |
|
765 | +} |
|
766 | +?>>FlightGear Multiplayer</option> |
|
767 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
768 | + print 'selected'; |
|
769 | +} |
|
770 | +?>>FlightGear Singleplayer</option> |
|
771 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
772 | + print 'selected'; |
|
773 | +} |
|
774 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
775 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
776 | + print 'selected'; |
|
777 | +} |
|
778 | +?>>ACARS SBS-3 over TCP</option> |
|
779 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
780 | + print 'selected'; |
|
781 | +} |
|
782 | +?>>NMEA AIS over TCP</option> |
|
783 | + <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') { |
|
784 | + print 'selected'; |
|
785 | +} |
|
786 | +?>>AirWhere website</option> |
|
787 | + <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') { |
|
788 | + print 'selected'; |
|
789 | +} |
|
790 | +?>>HidnSeek Callback</option> |
|
791 | + <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') { |
|
792 | + print 'selected'; |
|
793 | +} |
|
794 | +?>>Blitzortung</option> |
|
795 | + <option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') { |
|
796 | + print 'selected'; |
|
797 | +} |
|
798 | +?>>Sailaway</option> |
|
598 | 799 | </select> |
599 | 800 | </td> |
600 | 801 | <td> |
601 | - <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /> |
|
802 | + <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
803 | + print $source['name']; |
|
804 | +} |
|
805 | +?>" /> |
|
602 | 806 | </td> |
603 | - <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td> |
|
604 | - <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td> |
|
807 | + <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) { |
|
808 | + print 'checked'; |
|
809 | +} |
|
810 | +?> /></td> |
|
811 | + <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) { |
|
812 | + print 'checked'; |
|
813 | +} |
|
814 | +?> /></td> |
|
605 | 815 | <td> |
606 | 816 | <select name="timezones[]" id="timezones"> |
607 | 817 | <?php |
@@ -611,7 +821,9 @@ discard block |
||
611 | 821 | print '<option selected>'.$timezones.'</option>'; |
612 | 822 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
613 | 823 | print '<option selected>'.$timezones.'</option>'; |
614 | - } else print '<option>'.$timezones.'</option>'; |
|
824 | + } else { |
|
825 | + print '<option>'.$timezones.'</option>'; |
|
826 | + } |
|
615 | 827 | } |
616 | 828 | ?> |
617 | 829 | </select> |
@@ -665,7 +877,9 @@ discard block |
||
665 | 877 | foreach($timezonelist as $timezones){ |
666 | 878 | if ($timezones == 'UTC') { |
667 | 879 | print '<option selected>'.$timezones.'</option>'; |
668 | - } else print '<option>'.$timezones.'</option>'; |
|
880 | + } else { |
|
881 | + print '<option>'.$timezones.'</option>'; |
|
882 | + } |
|
669 | 883 | } |
670 | 884 | ?> |
671 | 885 | </select> |
@@ -690,11 +904,17 @@ discard block |
||
690 | 904 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
691 | 905 | <p> |
692 | 906 | <label for="acarshost">ACARS UDP host</label> |
693 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
907 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
908 | + print $globalACARSHost; |
|
909 | +} |
|
910 | +?>" /> |
|
694 | 911 | </p> |
695 | 912 | <p> |
696 | 913 | <label for="acarsport">ACARS UDP port</label> |
697 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
914 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
915 | + print $globalACARSPort; |
|
916 | +} |
|
917 | +?>" /> |
|
698 | 918 | </p> |
699 | 919 | </fieldset> |
700 | 920 | </div> |
@@ -720,17 +940,38 @@ discard block |
||
720 | 940 | <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td> |
721 | 941 | <td> |
722 | 942 | <select name="newslang[]"> |
723 | - <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option> |
|
724 | - <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option> |
|
943 | + <option value="en"<?php if ($lng == 'en') { |
|
944 | + print ' selected'; |
|
945 | +} |
|
946 | +?>>English</option> |
|
947 | + <option value="fr"<?php if ($lng == 'fr') { |
|
948 | + print ' selected'; |
|
949 | +} |
|
950 | +?>>French</option> |
|
725 | 951 | </select> |
726 | 952 | </td> |
727 | 953 | <td> |
728 | 954 | <select name="newstype[]"> |
729 | - <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option> |
|
730 | - <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option> |
|
731 | - <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option> |
|
732 | - <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option> |
|
733 | - <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option> |
|
955 | + <option value="global"<?php if ($type == 'global') { |
|
956 | + print ' selected'; |
|
957 | +} |
|
958 | +?>>Global</option> |
|
959 | + <option value="aircraft"<?php if ($type == 'aircraft') { |
|
960 | + print ' selected'; |
|
961 | +} |
|
962 | +?>>Aircraft</option> |
|
963 | + <option value="marine"<?php if ($type == 'marine') { |
|
964 | + print ' selected'; |
|
965 | +} |
|
966 | +?>>Marine</option> |
|
967 | + <option value="tracker"<?php if ($type == 'tracker') { |
|
968 | + print ' selected'; |
|
969 | +} |
|
970 | +?>>Tracker</option> |
|
971 | + <option value="satellite"<?php if ($type == 'Satellite') { |
|
972 | + print ' selected'; |
|
973 | +} |
|
974 | +?>>Satellite</option> |
|
734 | 975 | </select> |
735 | 976 | </td> |
736 | 977 | <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td> |
@@ -872,13 +1113,19 @@ discard block |
||
872 | 1113 | <div id="schedules_options"> |
873 | 1114 | <p> |
874 | 1115 | <label for="britishairways">British Airways API Key</label> |
875 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
1116 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
1117 | + print $globalBritishAirwaysKey; |
|
1118 | +} |
|
1119 | +?>" /> |
|
876 | 1120 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
877 | 1121 | </p> |
878 | 1122 | <!-- |
879 | 1123 | <p> |
880 | 1124 | <label for="transavia">Transavia Test API Consumer Key</label> |
881 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
1125 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
1126 | + print $globalTransaviaKey; |
|
1127 | +} |
|
1128 | +?>" /> |
|
882 | 1129 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
883 | 1130 | </p> |
884 | 1131 | --> |
@@ -887,10 +1134,16 @@ discard block |
||
887 | 1134 | <b>Lufthansa API Key</b> |
888 | 1135 | <p> |
889 | 1136 | <label for="lufthansakey">Key</label> |
890 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
1137 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
1138 | + print $globalLufthansaKey['key']; |
|
1139 | +} |
|
1140 | +?>" /> |
|
891 | 1141 | </p><p> |
892 | 1142 | <label for="lufthansasecret">Secret</label> |
893 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
1143 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
1144 | + print $globalLufthansaKey['secret']; |
|
1145 | +} |
|
1146 | +?>" /> |
|
894 | 1147 | </p> |
895 | 1148 | </div> |
896 | 1149 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -900,11 +1153,17 @@ discard block |
||
900 | 1153 | <b>FlightAware API Key</b> |
901 | 1154 | <p> |
902 | 1155 | <label for="flightawareusername">Username</label> |
903 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
1156 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
1157 | + print $globalFlightAwareUsername; |
|
1158 | +} |
|
1159 | +?>" /> |
|
904 | 1160 | </p> |
905 | 1161 | <p> |
906 | 1162 | <label for="flightawarepassword">API key</label> |
907 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
1163 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
1164 | + print $globalFlightAwarePassword; |
|
1165 | +} |
|
1166 | +?>" /> |
|
908 | 1167 | </p> |
909 | 1168 | </div> |
910 | 1169 | <p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p> |
@@ -921,10 +1180,22 @@ discard block |
||
921 | 1180 | <p> |
922 | 1181 | <label for="mapmatchingsource">Map Matching source</label> |
923 | 1182 | <select name="mapmatchingsource" id="mapmatchingsource"> |
924 | - <option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>FlightAirMap Map Matching</option> |
|
925 | - <option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option> |
|
926 | - <option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') print 'selected="selected" '; ?>>OSMR</option> |
|
927 | - <option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option> |
|
1183 | + <option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) { |
|
1184 | + print 'selected="selected" '; |
|
1185 | +} |
|
1186 | +?>>FlightAirMap Map Matching</option> |
|
1187 | + <option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') { |
|
1188 | + print 'selected="selected" '; |
|
1189 | +} |
|
1190 | +?>>GraphHopper</option> |
|
1191 | + <option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') { |
|
1192 | + print 'selected="selected" '; |
|
1193 | +} |
|
1194 | +?>>OSMR</option> |
|
1195 | + <option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') { |
|
1196 | + print 'selected="selected" '; |
|
1197 | +} |
|
1198 | +?>>Mapbox</option> |
|
928 | 1199 | </select> |
929 | 1200 | <p class="help-block">Mapbox need the API Key defined in map section.</p> |
930 | 1201 | <p class="help-block">FlightAirMap Map Matching is free, without API key but limited to about 100 input points to keep fast results.</p> |
@@ -932,7 +1203,10 @@ discard block |
||
932 | 1203 | <br /> |
933 | 1204 | <p> |
934 | 1205 | <label for="graphhopper">GraphHopper API Key</label> |
935 | - <input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" /> |
|
1206 | + <input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) { |
|
1207 | + print $globalGraphHopperKey; |
|
1208 | +} |
|
1209 | +?>" /> |
|
936 | 1210 | <p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p> |
937 | 1211 | </p> |
938 | 1212 | </div> |
@@ -950,7 +1224,10 @@ discard block |
||
950 | 1224 | </p> |
951 | 1225 | <p> |
952 | 1226 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
953 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
1227 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
1228 | + print $globalNOTAMSource; |
|
1229 | +} |
|
1230 | +?>" /> |
|
954 | 1231 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
955 | 1232 | </p> |
956 | 1233 | <br /> |
@@ -966,14 +1243,20 @@ discard block |
||
966 | 1243 | <div id="metarsrc"> |
967 | 1244 | <p> |
968 | 1245 | <label for="metarsource">URL of your METAR source</label> |
969 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
1246 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
1247 | + print $globalMETARurl; |
|
1248 | +} |
|
1249 | +?>" /> |
|
970 | 1250 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
971 | 1251 | </p> |
972 | 1252 | </div> |
973 | 1253 | <br /> |
974 | 1254 | <p> |
975 | 1255 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
976 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
1256 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
1257 | + print $globalBitlyAccessToken; |
|
1258 | +} |
|
1259 | +?>" /> |
|
977 | 1260 | </p> |
978 | 1261 | <br /> |
979 | 1262 | <p> |
@@ -989,11 +1272,26 @@ discard block |
||
989 | 1272 | <p> |
990 | 1273 | <label for="geoid_source">Geoid Source</label> |
991 | 1274 | <select name="geoid_source" id="geoid_source"> |
992 | - <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option> |
|
993 | - <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option> |
|
994 | - <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option> |
|
995 | - <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option> |
|
996 | - <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option> |
|
1275 | + <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') { |
|
1276 | + print ' selected="selected"'; |
|
1277 | +} |
|
1278 | +?>>EGM96 15' (2.1MB)</option> |
|
1279 | + <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') { |
|
1280 | + print ' selected="selected"'; |
|
1281 | +} |
|
1282 | +?>>EGM96 5' (19MB)</option> |
|
1283 | + <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') { |
|
1284 | + print ' selected="selected"'; |
|
1285 | +} |
|
1286 | +?>>EGM2008 5' (19MB)</option> |
|
1287 | + <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') { |
|
1288 | + print ' selected="selected"'; |
|
1289 | +} |
|
1290 | +?>>EGM2008 2.5' (75MB)</option> |
|
1291 | + <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') { |
|
1292 | + print ' selected="selected"'; |
|
1293 | +} |
|
1294 | +?>>EGM2008 1' (470MB)</option> |
|
997 | 1295 | </select> |
998 | 1296 | <p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p> |
999 | 1297 | </p> |
@@ -1015,7 +1313,12 @@ discard block |
||
1015 | 1313 | </p> |
1016 | 1314 | <p> |
1017 | 1315 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
1018 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" /> |
|
1316 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
1317 | + print $globalArchiveMonths; |
|
1318 | +} else { |
|
1319 | + echo '1'; |
|
1320 | +} |
|
1321 | +?>" /> |
|
1019 | 1322 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
1020 | 1323 | </p> |
1021 | 1324 | <p> |
@@ -1025,12 +1328,22 @@ discard block |
||
1025 | 1328 | </p> |
1026 | 1329 | <p> |
1027 | 1330 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
1028 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" /> |
|
1331 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
1332 | + print $globalArchiveKeepMonths; |
|
1333 | +} else { |
|
1334 | + echo '1'; |
|
1335 | +} |
|
1336 | +?>" /> |
|
1029 | 1337 | <p class="help-block">0 to disable</p> |
1030 | 1338 | </p> |
1031 | 1339 | <p> |
1032 | 1340 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
1033 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" /> |
|
1341 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
1342 | + print $globalArchiveKeepTrackMonths; |
|
1343 | +} else { |
|
1344 | + echo '1'; |
|
1345 | +} |
|
1346 | +?>" /> |
|
1034 | 1347 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
1035 | 1348 | </p> |
1036 | 1349 | <br /> |
@@ -1040,7 +1353,12 @@ discard block |
||
1040 | 1353 | <p class="help-block">Uncheck if the script is running as cron job. You should always run it as daemon when it's possible.</p> |
1041 | 1354 | <div id="cronends"> |
1042 | 1355 | <label for="cronend">Run script for xx seconds</label> |
1043 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
1356 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
1357 | + print $globalCronEnd; |
|
1358 | +} else { |
|
1359 | + print '0'; |
|
1360 | +} |
|
1361 | +?>" /> |
|
1044 | 1362 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
1045 | 1363 | </div> |
1046 | 1364 | </p> |
@@ -1099,20 +1417,40 @@ discard block |
||
1099 | 1417 | <br /> |
1100 | 1418 | <p> |
1101 | 1419 | <label for="refresh">Show flights detected since xxx seconds</label> |
1102 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
1420 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
1421 | + echo $globalLiveInterval; |
|
1422 | +} else { |
|
1423 | + echo '200'; |
|
1424 | +} |
|
1425 | +?>" /> |
|
1103 | 1426 | </p> |
1104 | 1427 | <p> |
1105 | 1428 | <label for="maprefresh">Live map refresh (in seconds)</label> |
1106 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
1429 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
1430 | + echo $globalMapRefresh; |
|
1431 | +} else { |
|
1432 | + echo '30'; |
|
1433 | +} |
|
1434 | +?>" /> |
|
1107 | 1435 | </p> |
1108 | 1436 | <p> |
1109 | 1437 | <label for="mapidle">Map idle timeout (in minutes)</label> |
1110 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
1438 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
1439 | + echo $globalMapIdleTimeout; |
|
1440 | +} else { |
|
1441 | + echo '30'; |
|
1442 | +} |
|
1443 | +?>" /> |
|
1111 | 1444 | <p class="help-block">0 to disable</p> |
1112 | 1445 | </p> |
1113 | 1446 | <p> |
1114 | 1447 | <label for="minfetch">HTTP/file source fetch every xxx seconds</label> |
1115 | - <input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) echo $globalMinFetch; else echo '20'; ?>" /> |
|
1448 | + <input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) { |
|
1449 | + echo $globalMinFetch; |
|
1450 | +} else { |
|
1451 | + echo '20'; |
|
1452 | +} |
|
1453 | +?>" /> |
|
1116 | 1454 | </p> |
1117 | 1455 | <p> |
1118 | 1456 | <label for="bbox">Only display flights that we can see on screen (bounding box)</label> |
@@ -1131,12 +1469,20 @@ discard block |
||
1131 | 1469 | <br /> |
1132 | 1470 | <p> |
1133 | 1471 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
1134 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
1472 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
1473 | + echo $globalClosestMinDist; |
|
1474 | +} else { |
|
1475 | + echo '50'; |
|
1476 | +} |
|
1477 | +?>" /> |
|
1135 | 1478 | </p> |
1136 | 1479 | <br /> |
1137 | 1480 | <p> |
1138 | 1481 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
1139 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
1482 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
1483 | + echo $globalAircraftSize; |
|
1484 | +} |
|
1485 | +?>" /> |
|
1140 | 1486 | </p> |
1141 | 1487 | <br /> |
1142 | 1488 | <p> |
@@ -1155,22 +1501,42 @@ discard block |
||
1155 | 1501 | <br /> |
1156 | 1502 | <p> |
1157 | 1503 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
1158 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
1504 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
1505 | + echo $globalAircraftIconColor; |
|
1506 | +} else { |
|
1507 | + echo '1a3151'; |
|
1508 | +} |
|
1509 | +?>" /> |
|
1159 | 1510 | </p> |
1160 | 1511 | <br /> |
1161 | 1512 | <p> |
1162 | 1513 | <label for="marineiconcolor">Color of marine icon on map</label> |
1163 | - <input type="color" name="marineiconcolor" id="marineiconcolor" value="#<?php if (isset($globalMarineIconColor)) echo $globalMarineIconColor; else echo '43d1d8'; ?>" /> |
|
1514 | + <input type="color" name="marineiconcolor" id="marineiconcolor" value="#<?php if (isset($globalMarineIconColor)) { |
|
1515 | + echo $globalMarineIconColor; |
|
1516 | +} else { |
|
1517 | + echo '43d1d8'; |
|
1518 | +} |
|
1519 | +?>" /> |
|
1164 | 1520 | </p> |
1165 | 1521 | <br /> |
1166 | 1522 | <p> |
1167 | 1523 | <label for="trackericoncolor">Color of tracker icon on map</label> |
1168 | - <input type="color" name="trackericoncolor" id="trackericoncolor" value="#<?php if (isset($globalTrackerIconColor)) echo $globalTrackerIconColor; else echo '1a3151'; ?>" /> |
|
1524 | + <input type="color" name="trackericoncolor" id="trackericoncolor" value="#<?php if (isset($globalTrackerIconColor)) { |
|
1525 | + echo $globalTrackerIconColor; |
|
1526 | +} else { |
|
1527 | + echo '1a3151'; |
|
1528 | +} |
|
1529 | +?>" /> |
|
1169 | 1530 | </p> |
1170 | 1531 | <br /> |
1171 | 1532 | <p> |
1172 | 1533 | <label for="satelliteiconcolor">Color of satellite icon on map</label> |
1173 | - <input type="color" name="satelliteiconcolor" id="satelliteiconcolor" value="#<?php if (isset($globalSatelliteIconColor)) echo $globalSatelliteIconColor; else echo '1a3151'; ?>" /> |
|
1534 | + <input type="color" name="satelliteiconcolor" id="satelliteiconcolor" value="#<?php if (isset($globalSatelliteIconColor)) { |
|
1535 | + echo $globalSatelliteIconColor; |
|
1536 | +} else { |
|
1537 | + echo '1a3151'; |
|
1538 | +} |
|
1539 | +?>" /> |
|
1174 | 1540 | </p> |
1175 | 1541 | <?php |
1176 | 1542 | if (!is_writable('../cache')) { |
@@ -1194,14 +1560,27 @@ discard block |
||
1194 | 1560 | <p> |
1195 | 1561 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
1196 | 1562 | <div class="range"> |
1197 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
1198 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
1563 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
1564 | + echo $globalAirportZoom; |
|
1565 | +} else { |
|
1566 | + echo '7'; |
|
1567 | +} |
|
1568 | +?>" /> |
|
1569 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
1570 | + echo $globalAirportZoom; |
|
1571 | +} else { |
|
1572 | + echo '7'; |
|
1573 | +} |
|
1574 | +?></output> |
|
1199 | 1575 | </div> |
1200 | 1576 | </p> |
1201 | 1577 | <br /> |
1202 | 1578 | <p> |
1203 | 1579 | <label for="customcss">Custom CSS web path</label> |
1204 | - <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" /> |
|
1580 | + <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) { |
|
1581 | + echo $globalCustomCSS; |
|
1582 | +} |
|
1583 | +?>" /> |
|
1205 | 1584 | </p> |
1206 | 1585 | </fieldset> |
1207 | 1586 | <input type="submit" name="submit" value="Create/Update database & write setup" /> |
@@ -1228,8 +1607,12 @@ discard block |
||
1228 | 1607 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
1229 | 1608 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
1230 | 1609 | |
1231 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
1232 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1610 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
1611 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
1612 | + } |
|
1613 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
1614 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1615 | + } |
|
1233 | 1616 | |
1234 | 1617 | $_SESSION['database_root'] = $dbroot; |
1235 | 1618 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -1307,15 +1690,23 @@ discard block |
||
1307 | 1690 | $source_city = $_POST['source_city']; |
1308 | 1691 | $source_country = $_POST['source_country']; |
1309 | 1692 | $source_ref = $_POST['source_ref']; |
1310 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
1311 | - else $source_id = array(); |
|
1693 | + if (isset($source_id)) { |
|
1694 | + $source_id = $_POST['source_id']; |
|
1695 | + } else { |
|
1696 | + $source_id = array(); |
|
1697 | + } |
|
1312 | 1698 | |
1313 | 1699 | $sources = array(); |
1314 | 1700 | foreach ($source_name as $keys => $name) { |
1315 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1316 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1701 | + if (isset($source_id[$keys])) { |
|
1702 | + $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1703 | + } else { |
|
1704 | + $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1705 | + } |
|
1706 | + } |
|
1707 | + if (count($sources) > 0) { |
|
1708 | + $_SESSION['sources'] = $sources; |
|
1317 | 1709 | } |
1318 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
1319 | 1710 | |
1320 | 1711 | $newsurl = $_POST['newsurl']; |
1321 | 1712 | $newslng = $_POST['newslang']; |
@@ -1328,7 +1719,9 @@ discard block |
||
1328 | 1719 | $lng = $newslng[$newskey]; |
1329 | 1720 | if (isset($newsfeeds[$type][$lng])) { |
1330 | 1721 | $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url)); |
1331 | - } else $newsfeeds[$type][$lng] = array($url); |
|
1722 | + } else { |
|
1723 | + $newsfeeds[$type][$lng] = array($url); |
|
1724 | + } |
|
1332 | 1725 | } |
1333 | 1726 | } |
1334 | 1727 | $settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds)); |
@@ -1353,17 +1746,29 @@ discard block |
||
1353 | 1746 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
1354 | 1747 | |
1355 | 1748 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
1356 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1357 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1749 | + if ($globalaircraft == 'aircraft') { |
|
1750 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1751 | + } else { |
|
1752 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1753 | + } |
|
1358 | 1754 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
1359 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1360 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1755 | + if ($globaltracker == 'tracker') { |
|
1756 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1757 | + } else { |
|
1758 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1759 | + } |
|
1361 | 1760 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
1362 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1363 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1761 | + if ($globalmarine == 'marine') { |
|
1762 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1763 | + } else { |
|
1764 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1765 | + } |
|
1364 | 1766 | $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING); |
1365 | - if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
1366 | - else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
1767 | + if ($globalsatellite == 'satellite') { |
|
1768 | + $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
1769 | + } else { |
|
1770 | + $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
1771 | + } |
|
1367 | 1772 | |
1368 | 1773 | /* |
1369 | 1774 | $globalSBS1Hosts = array(); |
@@ -1385,23 +1790,37 @@ discard block |
||
1385 | 1790 | $name = $_POST['name']; |
1386 | 1791 | $format = $_POST['format']; |
1387 | 1792 | $timezones = $_POST['timezones']; |
1388 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
1389 | - else $sourcestats = array(); |
|
1390 | - if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive']; |
|
1391 | - else $noarchive = array(); |
|
1793 | + if (isset($_POST['sourcestats'])) { |
|
1794 | + $sourcestats = $_POST['sourcestats']; |
|
1795 | + } else { |
|
1796 | + $sourcestats = array(); |
|
1797 | + } |
|
1798 | + if (isset($_POST['noarchive'])) { |
|
1799 | + $noarchive = $_POST['noarchive']; |
|
1800 | + } else { |
|
1801 | + $noarchive = array(); |
|
1802 | + } |
|
1392 | 1803 | $gSources = array(); |
1393 | 1804 | $forcepilots = false; |
1394 | 1805 | foreach ($host as $key => $h) { |
1395 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
1396 | - else $cov = 'FALSE'; |
|
1397 | - if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
|
1398 | - else $arch = 'FALSE'; |
|
1806 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
1807 | + $cov = 'TRUE'; |
|
1808 | + } else { |
|
1809 | + $cov = 'FALSE'; |
|
1810 | + } |
|
1811 | + if (isset($noarchive[$key]) && $noarchive[$key] == 1) { |
|
1812 | + $arch = 'TRUE'; |
|
1813 | + } else { |
|
1814 | + $arch = 'FALSE'; |
|
1815 | + } |
|
1399 | 1816 | if (strpos($format[$key],'_callback')) { |
1400 | 1817 | $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
1401 | 1818 | } elseif ($format[$key] != 'auto' || ($h != '' || $name[$key] != '')) { |
1402 | 1819 | $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
1403 | 1820 | } |
1404 | - if ($format[$key] == 'airwhere') $forcepilots = true; |
|
1821 | + if ($format[$key] == 'airwhere') { |
|
1822 | + $forcepilots = true; |
|
1823 | + } |
|
1405 | 1824 | } |
1406 | 1825 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
1407 | 1826 | |
@@ -1432,7 +1851,9 @@ discard block |
||
1432 | 1851 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
1433 | 1852 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1434 | 1853 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
1435 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1854 | + } else { |
|
1855 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1856 | + } |
|
1436 | 1857 | |
1437 | 1858 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
1438 | 1859 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1473,7 +1894,9 @@ discard block |
||
1473 | 1894 | |
1474 | 1895 | // Create in settings.php keys not yet configurable if not already here |
1475 | 1896 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1476 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1897 | + if (!isset($globalDebug)) { |
|
1898 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1899 | + } |
|
1477 | 1900 | |
1478 | 1901 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
1479 | 1902 | if ($resetyearstats == 'resetyearstats') { |
@@ -1516,37 +1939,56 @@ discard block |
||
1516 | 1939 | } |
1517 | 1940 | */ |
1518 | 1941 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
1519 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1520 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1521 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1522 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1942 | + if ($globalsbs == 'sbs') { |
|
1943 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1944 | + } else { |
|
1945 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1946 | + } |
|
1947 | + if ($globalaprs == 'aprs') { |
|
1948 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1949 | + } else { |
|
1950 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1951 | + } |
|
1523 | 1952 | $va = false; |
1524 | 1953 | if ($globalivao == 'ivao') { |
1525 | 1954 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
1526 | 1955 | $va = true; |
1527 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1956 | + } else { |
|
1957 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1958 | + } |
|
1528 | 1959 | if ($globalvatsim == 'vatsim') { |
1529 | 1960 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
1530 | 1961 | $va = true; |
1531 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1962 | + } else { |
|
1963 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1964 | + } |
|
1532 | 1965 | if ($globalphpvms == 'phpvms') { |
1533 | 1966 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
1534 | 1967 | $va = true; |
1535 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1968 | + } else { |
|
1969 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1970 | + } |
|
1536 | 1971 | if ($globalvam == 'vam') { |
1537 | 1972 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
1538 | 1973 | $va = true; |
1539 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1974 | + } else { |
|
1975 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1976 | + } |
|
1540 | 1977 | if ($va) { |
1541 | 1978 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
1542 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1979 | + } else { |
|
1980 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1981 | + } |
|
1543 | 1982 | if ($globalva == 'va' || $va) { |
1544 | 1983 | $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
1545 | 1984 | $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
1546 | 1985 | } else { |
1547 | 1986 | $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
1548 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1549 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1987 | + if ($forcepilots) { |
|
1988 | + $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1989 | + } else { |
|
1990 | + $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1991 | + } |
|
1550 | 1992 | } |
1551 | 1993 | if ($globalvm == 'vm') { |
1552 | 1994 | $settings = array_merge($settings,array('globalVM' => 'TRUE')); |
@@ -1803,7 +2245,9 @@ discard block |
||
1803 | 2245 | $graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING); |
1804 | 2246 | $settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper)); |
1805 | 2247 | |
1806 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
2248 | + if (!isset($globalTransaction)) { |
|
2249 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
2250 | + } |
|
1807 | 2251 | |
1808 | 2252 | // Set some defaults values... |
1809 | 2253 | if (!isset($globalAircraftImageSources)) { |
@@ -1818,15 +2262,23 @@ discard block |
||
1818 | 2262 | |
1819 | 2263 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1820 | 2264 | |
1821 | - if ($error == '') settings::modify_settings($settings); |
|
1822 | - if ($error == '') settings::comment_settings($settings_comment); |
|
2265 | + if ($error == '') { |
|
2266 | + settings::modify_settings($settings); |
|
2267 | + } |
|
2268 | + if ($error == '') { |
|
2269 | + settings::comment_settings($settings_comment); |
|
2270 | + } |
|
1823 | 2271 | if ($error != '') { |
1824 | 2272 | print '<div class="info column">'.$error.'</div>'; |
1825 | 2273 | require('../footer.php'); |
1826 | 2274 | exit; |
1827 | 2275 | } else { |
1828 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
1829 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
2276 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
2277 | + $_SESSION['waypoints'] = 1; |
|
2278 | + } |
|
2279 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
2280 | + $_SESSION['owner'] = 1; |
|
2281 | + } |
|
1830 | 2282 | if (isset($_POST['createdb'])) { |
1831 | 2283 | $_SESSION['install'] = 'database_create'; |
1832 | 2284 | } else { |
@@ -1863,10 +2315,18 @@ discard block |
||
1863 | 2315 | $popw = false; |
1864 | 2316 | foreach ($_SESSION['done'] as $done) { |
1865 | 2317 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
1866 | - if ($done == 'Create database') $pop = true; |
|
1867 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1868 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1869 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
2318 | + if ($done == 'Create database') { |
|
2319 | + $pop = true; |
|
2320 | + } |
|
2321 | + if ($_SESSION['install'] == 'database_create') { |
|
2322 | + $pop = true; |
|
2323 | + } |
|
2324 | + if ($_SESSION['install'] == 'database_import') { |
|
2325 | + $popi = true; |
|
2326 | + } |
|
2327 | + if ($_SESSION['install'] == 'waypoints') { |
|
2328 | + $popw = true; |
|
2329 | + } |
|
1870 | 2330 | } |
1871 | 2331 | if ($pop) { |
1872 | 2332 | sleep(5); |
@@ -1877,7 +2337,9 @@ discard block |
||
1877 | 2337 | } else if ($popw) { |
1878 | 2338 | sleep(5); |
1879 | 2339 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
1880 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
2340 | + } else { |
|
2341 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
2342 | + } |
|
1881 | 2343 | print '</div></ul>'; |
1882 | 2344 | print '<div id="error"></div>'; |
1883 | 2345 | /* foreach ($_SESSION['done'] as $done) { |
@@ -12,11 +12,18 @@ discard block |
||
12 | 12 | setcookie("MapFormat",'2d'); |
13 | 13 | |
14 | 14 | // Compressed GeoJson is used if true |
15 | -if (!isset($globalJsonCompress)) $compress = true; |
|
16 | -else $compress = $globalJsonCompress; |
|
17 | -if (isset($_COOKIE['MarineIconColor'])) $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
18 | -elseif (isset($globalMarineIconColor)) $MarineIconColor = $globalMarineIconColor; |
|
19 | -else $MarineIconColor = '43d1d8'; |
|
15 | +if (!isset($globalJsonCompress)) { |
|
16 | + $compress = true; |
|
17 | +} else { |
|
18 | + $compress = $globalJsonCompress; |
|
19 | +} |
|
20 | +if (isset($_COOKIE['MarineIconColor'])) { |
|
21 | + $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
22 | +} elseif (isset($globalMarineIconColor)) { |
|
23 | + $MarineIconColor = $globalMarineIconColor; |
|
24 | +} else { |
|
25 | + $MarineIconColor = '43d1d8'; |
|
26 | +} |
|
20 | 27 | |
21 | 28 | if (isset($globalVM) && $globalVM) { |
22 | 29 | ?> |
@@ -198,7 +205,12 @@ discard block |
||
198 | 205 | <?php |
199 | 206 | } else { |
200 | 207 | ?> |
201 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
208 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
209 | + print $archiveupdatetime*1000; |
|
210 | +} else { |
|
211 | + print $globalMapRefresh*1000+20000; |
|
212 | +} |
|
213 | +?>+feature.properties.sqt*1000); |
|
202 | 214 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
203 | 215 | <?php |
204 | 216 | } |
@@ -255,7 +267,12 @@ discard block |
||
255 | 267 | <?php |
256 | 268 | } else { |
257 | 269 | ?> |
258 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
270 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
271 | + print $archiveupdatetime*1000; |
|
272 | +} else { |
|
273 | + print $globalMapRefresh*1000+20000; |
|
274 | +} |
|
275 | +?>+feature.properties.sqt*1000); |
|
259 | 276 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
260 | 277 | <?php |
261 | 278 | } |
@@ -311,7 +328,12 @@ discard block |
||
311 | 328 | <?php |
312 | 329 | } else { |
313 | 330 | ?> |
314 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
331 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
332 | + print $archiveupdatetime*1000; |
|
333 | +} else { |
|
334 | + print $globalMapRefresh*1000+20000; |
|
335 | +} |
|
336 | +?>+feature.properties.sqt*1000); |
|
315 | 337 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
316 | 338 | <?php |
317 | 339 | } |
@@ -743,7 +765,12 @@ discard block |
||
743 | 765 | } else { |
744 | 766 | //then load it again every 30 seconds |
745 | 767 | reloadMarinePage = setInterval( |
746 | - function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
768 | + function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
769 | + print $globalMapRefresh*1000; |
|
770 | +} else { |
|
771 | + print '30000'; |
|
772 | +} |
|
773 | +?>); |
|
747 | 774 | } |
748 | 775 | |
749 | 776 | if (getCookie('openseamap') == 'true') loadOpenSeaMap(getCookie('openseamap')); |