@@ -4,12 +4,22 @@ 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 | - if (isset($_SESSION['identitied'])) unset($_SESSION['identified']); |
|
12 | -} |
|
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 | + if (isset($_SESSION['identitied'])) { |
|
20 | + unset($_SESSION['identified']); |
|
21 | + } |
|
22 | + } |
|
13 | 23 | /* |
14 | 24 | if (isset($_SESSION['errorlst'])) { |
15 | 25 | header('Content-Encoding: none;'); |
@@ -131,7 +141,9 @@ discard block |
||
131 | 141 | if (count($alllng) != count($availablelng)) { |
132 | 142 | $notavailable = array(); |
133 | 143 | foreach($alllng as $lng) { |
134 | - if (!isset($availablelng[$lng])) $notavailable[] = $lng; |
|
144 | + if (!isset($availablelng[$lng])) { |
|
145 | + $notavailable[] = $lng; |
|
146 | + } |
|
135 | 147 | } |
136 | 148 | 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>'; |
137 | 149 | } |
@@ -170,7 +182,10 @@ discard block |
||
170 | 182 | <legend>Install script configuration</legend> |
171 | 183 | <p> |
172 | 184 | <label for="installpass">Install password</label> |
173 | - <input type="password" name="installpass" id="installpass" value="<?php if (isset($globalInstallPassword)) print $globalInstallPassword; ?>" /> |
|
185 | + <input type="password" name="installpass" id="installpass" value="<?php if (isset($globalInstallPassword)) { |
|
186 | + print $globalInstallPassword; |
|
187 | +} |
|
188 | +?>" /> |
|
174 | 189 | </p> |
175 | 190 | <p class="help-block">Password needed to access this install script. If empty, to access this script, you will need to change the $globalInstalled setting in require/settings.php to FALSE</p> |
176 | 191 | </fieldset> |
@@ -200,31 +215,49 @@ discard block |
||
200 | 215 | </div> |
201 | 216 | <p> |
202 | 217 | <label for="dbhost">Database hostname</label> |
203 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
218 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
219 | + print $globalDBhost; |
|
220 | +} |
|
221 | +?>" /> |
|
204 | 222 | </p> |
205 | 223 | <p> |
206 | 224 | <label for="dbport">Database port</label> |
207 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
225 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
226 | + print $globalDBport; |
|
227 | +} |
|
228 | +?>" /> |
|
208 | 229 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
209 | 230 | </p> |
210 | 231 | <p> |
211 | 232 | <label for="dbname">Database name</label> |
212 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
233 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
234 | + print $globalDBname; |
|
235 | +} |
|
236 | +?>" /> |
|
213 | 237 | </p> |
214 | 238 | <p> |
215 | 239 | <label for="dbuser">Database user</label> |
216 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
240 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
241 | + print $globalDBuser; |
|
242 | +} |
|
243 | +?>" /> |
|
217 | 244 | </p> |
218 | 245 | <p> |
219 | 246 | <label for="dbuserpass">Database user password</label> |
220 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
247 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
248 | + print $globalDBpass; |
|
249 | +} |
|
250 | +?>" /> |
|
221 | 251 | </p> |
222 | 252 | </fieldset> |
223 | 253 | <fieldset id="site"> |
224 | 254 | <legend>Site configuration</legend> |
225 | 255 | <p> |
226 | 256 | <label for="sitename">Site name</label> |
227 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
257 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
258 | + print $globalName; |
|
259 | +} |
|
260 | +?>" /> |
|
228 | 261 | </p> |
229 | 262 | <p> |
230 | 263 | <label for="siteurl">Site directory</label> |
@@ -237,18 +270,27 @@ discard block |
||
237 | 270 | } |
238 | 271 | } |
239 | 272 | ?> |
240 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
273 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
274 | + print $globalURL; |
|
275 | +} |
|
276 | +?>" /> |
|
241 | 277 | <p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
242 | 278 | <p class="help-block">Can be empty</p> |
243 | 279 | </p> |
244 | 280 | <p> |
245 | 281 | <label for="timezone">Timezone</label> |
246 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
282 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
283 | + print $globalTimezone; |
|
284 | +} |
|
285 | +?>" /> |
|
247 | 286 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
248 | 287 | </p> |
249 | 288 | <p> |
250 | 289 | <label for="language">Language</label> |
251 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
290 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
291 | + print $globalLanguage; |
|
292 | +} |
|
293 | +?>" /> |
|
252 | 294 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
253 | 295 | </p> |
254 | 296 | </fieldset> |
@@ -268,11 +310,17 @@ discard block |
||
268 | 310 | <div id="mapbox_data"> |
269 | 311 | <p> |
270 | 312 | <label for="mapboxid">Mapbox id</label> |
271 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
313 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
314 | + print $globalMapboxId; |
|
315 | +} |
|
316 | +?>" /> |
|
272 | 317 | </p> |
273 | 318 | <p> |
274 | 319 | <label for="mapboxtoken">Mapbox token</label> |
275 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
320 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
321 | + print $globalMapboxToken; |
|
322 | +} |
|
323 | +?>" /> |
|
276 | 324 | </p> |
277 | 325 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
278 | 326 | </div> |
@@ -280,7 +328,10 @@ discard block |
||
280 | 328 | <div id="google_data"> |
281 | 329 | <p> |
282 | 330 | <label for="googlekey">Google API key</label> |
283 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
331 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
332 | + print $globalGoogleAPIKey; |
|
333 | +} |
|
334 | +?>" /> |
|
284 | 335 | <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> |
285 | 336 | </p> |
286 | 337 | </div> |
@@ -288,7 +339,10 @@ discard block |
||
288 | 339 | <div id="bing_data"> |
289 | 340 | <p> |
290 | 341 | <label for="bingkey">Bing Map key</label> |
291 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
342 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
343 | + print $globalBingMapKey; |
|
344 | +} |
|
345 | +?>" /> |
|
292 | 346 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
293 | 347 | </p> |
294 | 348 | </div> |
@@ -296,7 +350,10 @@ discard block |
||
296 | 350 | <div id="mapquest_data"> |
297 | 351 | <p> |
298 | 352 | <label for="mapquestkey">MapQuest key</label> |
299 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
353 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
354 | + print $globalMapQuestKey; |
|
355 | +} |
|
356 | +?>" /> |
|
300 | 357 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
301 | 358 | </p> |
302 | 359 | </div> |
@@ -304,11 +361,17 @@ discard block |
||
304 | 361 | <div id="here_data"> |
305 | 362 | <p> |
306 | 363 | <label for="hereappid">Here App_Id</label> |
307 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
364 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
365 | + print $globalHereappId; |
|
366 | +} |
|
367 | +?>" /> |
|
308 | 368 | </p> |
309 | 369 | <p> |
310 | 370 | <label for="hereappcode">Here App_Code</label> |
311 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
371 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
372 | + print $globalHereappCode; |
|
373 | +} |
|
374 | +?>" /> |
|
312 | 375 | </p> |
313 | 376 | <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> |
314 | 377 | </div> |
@@ -316,7 +379,10 @@ discard block |
||
316 | 379 | <div id="openweathermap_data"> |
317 | 380 | <p> |
318 | 381 | <label for="openweathermapkey">OpenWeatherMap key (weather layer)</label> |
319 | - <input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" /> |
|
382 | + <input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) { |
|
383 | + print $globalOpenWeatherMapKey; |
|
384 | +} |
|
385 | +?>" /> |
|
320 | 386 | <p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p> |
321 | 387 | </p> |
322 | 388 | </div> |
@@ -345,42 +411,86 @@ discard block |
||
345 | 411 | <legend>Coverage area</legend> |
346 | 412 | <p> |
347 | 413 | <label for="latitudemax">The maximum latitude (north)</label> |
348 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
414 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
415 | + print $globalLatitudeMax; |
|
416 | +} |
|
417 | +?>" /> |
|
349 | 418 | </p> |
350 | 419 | <p> |
351 | 420 | <label for="latitudemin">The minimum latitude (south)</label> |
352 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
421 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
422 | + print $globalLatitudeMin; |
|
423 | +} |
|
424 | +?>" /> |
|
353 | 425 | </p> |
354 | 426 | <p> |
355 | 427 | <label for="longitudemax">The maximum longitude (west)</label> |
356 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
428 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
429 | + print $globalLongitudeMax; |
|
430 | +} |
|
431 | +?>" /> |
|
357 | 432 | </p> |
358 | 433 | <p> |
359 | 434 | <label for="longitudemin">The minimum longitude (east)</label> |
360 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
435 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
436 | + print $globalLongitudeMin; |
|
437 | +} |
|
438 | +?>" /> |
|
361 | 439 | </p> |
362 | 440 | <p> |
363 | 441 | <label for="latitudecenter">The latitude center</label> |
364 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
442 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
443 | + print $globalCenterLatitude; |
|
444 | +} |
|
445 | +?>" /> |
|
365 | 446 | </p> |
366 | 447 | <p> |
367 | 448 | <label for="longitudecenter">The longitude center</label> |
368 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
449 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
450 | + print $globalCenterLongitude; |
|
451 | +} |
|
452 | +?>" /> |
|
369 | 453 | </p> |
370 | 454 | <p> |
371 | 455 | <label for="livezoom">Default Zoom on live map</label> |
372 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
456 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
457 | + print $globalLiveZoom; |
|
458 | +} else { |
|
459 | + print '9'; |
|
460 | +} |
|
461 | +?>" /> |
|
373 | 462 | </p> |
374 | 463 | <p> |
375 | 464 | <label for="squawk_country">Country for squawk usage</label> |
376 | 465 | <select name="squawk_country" id="squawk_country"> |
377 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
378 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
379 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
380 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
381 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
382 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
383 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
466 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
467 | + print ' selected '; |
|
468 | +} |
|
469 | +?>>UK</option> |
|
470 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
471 | + print ' selected '; |
|
472 | +} |
|
473 | +?>>NZ</option> |
|
474 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
475 | + print ' selected '; |
|
476 | +} |
|
477 | +?>>US</option> |
|
478 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
479 | + print ' selected '; |
|
480 | +} |
|
481 | +?>>AU</option> |
|
482 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
483 | + print ' selected '; |
|
484 | +} |
|
485 | +?>>NL</option> |
|
486 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
487 | + print ' selected '; |
|
488 | +} |
|
489 | +?>>FR</option> |
|
490 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
491 | + print ' selected '; |
|
492 | +} |
|
493 | +?>>TR</option> |
|
384 | 494 | </select> |
385 | 495 | </p> |
386 | 496 | </fieldset> |
@@ -389,15 +499,24 @@ discard block |
||
389 | 499 | <p><i>Only put in DB flights that are inside a circle</i></p> |
390 | 500 | <p> |
391 | 501 | <label for="latitude">Center latitude</label> |
392 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
502 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
503 | + echo $globalDistanceIgnore['latitude']; |
|
504 | +} |
|
505 | +?>" /> |
|
393 | 506 | </p> |
394 | 507 | <p> |
395 | 508 | <label for="longitude">Center longitude</label> |
396 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
509 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
510 | + echo $globalDistanceIgnore['longitude']; |
|
511 | +} |
|
512 | +?>" /> |
|
397 | 513 | </p> |
398 | 514 | <p> |
399 | 515 | <label for="Distance">Distance (in km)</label> |
400 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
516 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
517 | + echo $globalDistanceIgnore['distance']; |
|
518 | +} |
|
519 | +?>" /> |
|
401 | 520 | </p> |
402 | 521 | </fieldset> |
403 | 522 | <fieldset id="sourceloc"> |
@@ -523,22 +642,34 @@ discard block |
||
523 | 642 | <div id="flightaware_data"> |
524 | 643 | <p> |
525 | 644 | <label for="flightawareusername">FlightAware username</label> |
526 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
645 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
646 | + print $globalFlightAwareUsername; |
|
647 | +} |
|
648 | +?>" /> |
|
527 | 649 | </p> |
528 | 650 | <p> |
529 | 651 | <label for="flightawarepassword">FlightAware password/API key</label> |
530 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
652 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
653 | + print $globalFlightAwarePassword; |
|
654 | +} |
|
655 | +?>" /> |
|
531 | 656 | </p> |
532 | 657 | </div> |
533 | 658 | --> |
534 | 659 | <div id="sailaway_data"> |
535 | 660 | <p> |
536 | 661 | <label for="sailawayemail">Sailaway email</label> |
537 | - <input type="text" name="sailawayemail" id="sailawayemail" value="<?php if (isset($globalSailaway['email'])) print $globalSailaway['email']; ?>" /> |
|
662 | + <input type="text" name="sailawayemail" id="sailawayemail" value="<?php if (isset($globalSailaway['email'])) { |
|
663 | + print $globalSailaway['email']; |
|
664 | +} |
|
665 | +?>" /> |
|
538 | 666 | </p> |
539 | 667 | <p> |
540 | 668 | <label for="sailawaypassword">Sailaway password</label> |
541 | - <input type="text" name="sailawaypassword" id="sailawaypassword" value="<?php if (isset($globalSailaway['password'])) print $globalSailaway['password']; ?>" /> |
|
669 | + <input type="text" name="sailawaypassword" id="sailawaypassword" value="<?php if (isset($globalSailaway['password'])) { |
|
670 | + print $globalSailaway['password']; |
|
671 | +} |
|
672 | +?>" /> |
|
542 | 673 | </p> |
543 | 674 | </div> |
544 | 675 | |
@@ -580,7 +711,10 @@ discard block |
||
580 | 711 | if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
581 | 712 | ?> |
582 | 713 | <td><input type="text" name="host[]" value="<?php print $source['host']; ?>" /></td> |
583 | - <td><input type="text" name="port[]" class="col-xs-2" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
|
714 | + <td><input type="text" name="port[]" class="col-xs-2" value="<?php if (isset($source['port'])) { |
|
715 | + print $source['port']; |
|
716 | +} |
|
717 | +?>" /></td> |
|
584 | 718 | <?php |
585 | 719 | } else { |
586 | 720 | $hostport = explode(':',$source['host']); |
@@ -599,39 +733,126 @@ discard block |
||
599 | 733 | ?> |
600 | 734 | <td> |
601 | 735 | <select name="format[]"> |
602 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
603 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
604 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
605 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
606 | - <option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option> |
|
607 | - <option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') print 'selected'; ?>>Planefinder client</option> |
|
608 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
609 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
610 | - <option value="radarcapejson" <?php if (isset($source['format']) && $source['format'] == 'radarcapejson') print 'selected'; ?>>Radarcape json</option> |
|
611 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
612 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
613 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
614 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
615 | - <option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option> |
|
616 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
617 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
618 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
619 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
620 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
621 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
622 | - <option value="acarsjson" <?php if (isset($source['format']) && $source['format'] == 'acarsjson') print 'selected'; ?>>ACARS from acarsdec json and vdlm2dec</option> |
|
623 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
624 | - <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option> |
|
625 | - <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option> |
|
626 | - <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option> |
|
627 | - <option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') print 'selected'; ?>>Sailaway</option> |
|
736 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
737 | + print 'selected'; |
|
738 | +} |
|
739 | +?>>Auto</option> |
|
740 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
741 | + print 'selected'; |
|
742 | +} |
|
743 | +?>>SBS</option> |
|
744 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
745 | + print 'selected'; |
|
746 | +} |
|
747 | +?>>TSV</option> |
|
748 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
749 | + print 'selected'; |
|
750 | +} |
|
751 | +?>>Raw</option> |
|
752 | + <option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') { |
|
753 | + print 'selected'; |
|
754 | +} |
|
755 | +?>>Dump1090 aircraft.json</option> |
|
756 | + <option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') { |
|
757 | + print 'selected'; |
|
758 | +} |
|
759 | +?>>Planefinder client</option> |
|
760 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
761 | + print 'selected'; |
|
762 | +} |
|
763 | +?>>APRS</option> |
|
764 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
765 | + print 'selected'; |
|
766 | +} |
|
767 | +?>>Radarcape deltadb.txt</option> |
|
768 | + <option value="radarcapejson" <?php if (isset($source['format']) && $source['format'] == 'radarcapejson') { |
|
769 | + print 'selected'; |
|
770 | +} |
|
771 | +?>>Radarcape json</option> |
|
772 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
773 | + print 'selected'; |
|
774 | +} |
|
775 | +?>>Vatsim</option> |
|
776 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
777 | + print 'selected'; |
|
778 | +} |
|
779 | +?>>Virtual Radar Server AircraftList.json</option> |
|
780 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
781 | + print 'selected'; |
|
782 | +} |
|
783 | +?>>Virtual Radar Server TCP</option> |
|
784 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
785 | + print 'selected'; |
|
786 | +} |
|
787 | +?>>phpVMS</option> |
|
788 | + <option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
789 | + print 'selected'; |
|
790 | +} |
|
791 | +?>>Virtual Airline Operations System (VAOS)</option> |
|
792 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
793 | + print 'selected'; |
|
794 | +} |
|
795 | +?>>Virtual Airlines Manager</option> |
|
796 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
797 | + print 'selected'; |
|
798 | +} |
|
799 | +?>>IVAO</option> |
|
800 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
801 | + print 'selected'; |
|
802 | +} |
|
803 | +?>>FlightGear Multiplayer</option> |
|
804 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
805 | + print 'selected'; |
|
806 | +} |
|
807 | +?>>FlightGear Singleplayer</option> |
|
808 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
809 | + print 'selected'; |
|
810 | +} |
|
811 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
812 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
813 | + print 'selected'; |
|
814 | +} |
|
815 | +?>>ACARS SBS-3 over TCP</option> |
|
816 | + <option value="acarsjson" <?php if (isset($source['format']) && $source['format'] == 'acarsjson') { |
|
817 | + print 'selected'; |
|
818 | +} |
|
819 | +?>>ACARS from acarsdec json and vdlm2dec</option> |
|
820 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
821 | + print 'selected'; |
|
822 | +} |
|
823 | +?>>NMEA AIS over TCP</option> |
|
824 | + <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') { |
|
825 | + print 'selected'; |
|
826 | +} |
|
827 | +?>>AirWhere website</option> |
|
828 | + <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') { |
|
829 | + print 'selected'; |
|
830 | +} |
|
831 | +?>>HidnSeek Callback</option> |
|
832 | + <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') { |
|
833 | + print 'selected'; |
|
834 | +} |
|
835 | +?>>Blitzortung</option> |
|
836 | + <option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') { |
|
837 | + print 'selected'; |
|
838 | +} |
|
839 | +?>>Sailaway</option> |
|
628 | 840 | </select> |
629 | 841 | </td> |
630 | 842 | <td> |
631 | - <input type="text" name="name[]" value="<?php if (isset($source['name'])) print $source['name']; ?>" /> |
|
843 | + <input type="text" name="name[]" value="<?php if (isset($source['name'])) { |
|
844 | + print $source['name']; |
|
845 | +} |
|
846 | +?>" /> |
|
632 | 847 | </td> |
633 | - <td><input type="checkbox" name="sourcestats[]" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td> |
|
634 | - <td><input type="checkbox" name="noarchive[]" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td> |
|
848 | + <td><input type="checkbox" name="sourcestats[]" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) { |
|
849 | + print 'checked'; |
|
850 | +} |
|
851 | +?> /></td> |
|
852 | + <td><input type="checkbox" name="noarchive[]" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) { |
|
853 | + print 'checked'; |
|
854 | +} |
|
855 | +?> /></td> |
|
635 | 856 | <td> |
636 | 857 | <select name="timezones[]"> |
637 | 858 | <?php |
@@ -641,7 +862,9 @@ discard block |
||
641 | 862 | print '<option selected>'.$timezones.'</option>'; |
642 | 863 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
643 | 864 | print '<option selected>'.$timezones.'</option>'; |
644 | - } else print '<option>'.$timezones.'</option>'; |
|
865 | + } else { |
|
866 | + print '<option>'.$timezones.'</option>'; |
|
867 | + } |
|
645 | 868 | } |
646 | 869 | ?> |
647 | 870 | </select> |
@@ -697,7 +920,9 @@ discard block |
||
697 | 920 | foreach($timezonelist as $timezones){ |
698 | 921 | if ($timezones == 'UTC') { |
699 | 922 | print '<option selected>'.$timezones.'</option>'; |
700 | - } else print '<option>'.$timezones.'</option>'; |
|
923 | + } else { |
|
924 | + print '<option>'.$timezones.'</option>'; |
|
925 | + } |
|
701 | 926 | } |
702 | 927 | ?> |
703 | 928 | </select> |
@@ -722,11 +947,17 @@ discard block |
||
722 | 947 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
723 | 948 | <p> |
724 | 949 | <label for="acarshost">ACARS UDP host</label> |
725 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
950 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
951 | + print $globalACARSHost; |
|
952 | +} |
|
953 | +?>" /> |
|
726 | 954 | </p> |
727 | 955 | <p> |
728 | 956 | <label for="acarsport">ACARS UDP port</label> |
729 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
957 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
958 | + print $globalACARSPort; |
|
959 | +} |
|
960 | +?>" /> |
|
730 | 961 | </p> |
731 | 962 | <p class="help-block"><i>daemon-acars.php</i> can only be run as daemon. It's an alternate script for ACARS data, <i>daemon-spotter.php</i> may be better.</p> |
732 | 963 | </fieldset> |
@@ -753,17 +984,38 @@ discard block |
||
753 | 984 | <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td> |
754 | 985 | <td> |
755 | 986 | <select name="newslang[]"> |
756 | - <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option> |
|
757 | - <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option> |
|
987 | + <option value="en"<?php if ($lng == 'en') { |
|
988 | + print ' selected'; |
|
989 | +} |
|
990 | +?>>English</option> |
|
991 | + <option value="fr"<?php if ($lng == 'fr') { |
|
992 | + print ' selected'; |
|
993 | +} |
|
994 | +?>>French</option> |
|
758 | 995 | </select> |
759 | 996 | </td> |
760 | 997 | <td> |
761 | 998 | <select name="newstype[]"> |
762 | - <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option> |
|
763 | - <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option> |
|
764 | - <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option> |
|
765 | - <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option> |
|
766 | - <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option> |
|
999 | + <option value="global"<?php if ($type == 'global') { |
|
1000 | + print ' selected'; |
|
1001 | +} |
|
1002 | +?>>Global</option> |
|
1003 | + <option value="aircraft"<?php if ($type == 'aircraft') { |
|
1004 | + print ' selected'; |
|
1005 | +} |
|
1006 | +?>>Aircraft</option> |
|
1007 | + <option value="marine"<?php if ($type == 'marine') { |
|
1008 | + print ' selected'; |
|
1009 | +} |
|
1010 | +?>>Marine</option> |
|
1011 | + <option value="tracker"<?php if ($type == 'tracker') { |
|
1012 | + print ' selected'; |
|
1013 | +} |
|
1014 | +?>>Tracker</option> |
|
1015 | + <option value="satellite"<?php if ($type == 'Satellite') { |
|
1016 | + print ' selected'; |
|
1017 | +} |
|
1018 | +?>>Satellite</option> |
|
767 | 1019 | </select> |
768 | 1020 | </td> |
769 | 1021 | <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td> |
@@ -847,7 +1099,10 @@ discard block |
||
847 | 1099 | </p> |
848 | 1100 | <p> |
849 | 1101 | <label for="corsproxy">CORS proxy</label> |
850 | - <input type="text" name="corsproxy" id="corsproxy" value="<?php if (isset($globalCORSproxy)) print $globalCORSproxy; else print 'https://galvanize-cors-proxy.herokuapp.com/' ?>" /> |
|
1102 | + <input type="text" name="corsproxy" id="corsproxy" value="<?php if (isset($globalCORSproxy)) { |
|
1103 | + print $globalCORSproxy; |
|
1104 | +} else { |
|
1105 | + print 'https://galvanize-cors-proxy.herokuapp.com/' ?>" /> |
|
851 | 1106 | <p class="help-block">CORS proxy used for some WMS servers</p> |
852 | 1107 | </p> |
853 | 1108 | <!-- |
@@ -910,13 +1165,18 @@ discard block |
||
910 | 1165 | <div id="schedules_options"> |
911 | 1166 | <p> |
912 | 1167 | <label for="britishairways">British Airways API Key</label> |
913 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
1168 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; |
|
1169 | +} |
|
1170 | +?>" /> |
|
914 | 1171 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
915 | 1172 | </p> |
916 | 1173 | <!-- |
917 | 1174 | <p> |
918 | 1175 | <label for="transavia">Transavia Test API Consumer Key</label> |
919 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
1176 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
1177 | + print $globalTransaviaKey; |
|
1178 | +} |
|
1179 | +?>" /> |
|
920 | 1180 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
921 | 1181 | </p> |
922 | 1182 | --> |
@@ -925,10 +1185,16 @@ discard block |
||
925 | 1185 | <b>Lufthansa API Key</b> |
926 | 1186 | <p> |
927 | 1187 | <label for="lufthansakey">Key</label> |
928 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
1188 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
1189 | + print $globalLufthansaKey['key']; |
|
1190 | +} |
|
1191 | +?>" /> |
|
929 | 1192 | </p><p> |
930 | 1193 | <label for="lufthansasecret">Secret</label> |
931 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
1194 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
1195 | + print $globalLufthansaKey['secret']; |
|
1196 | +} |
|
1197 | +?>" /> |
|
932 | 1198 | </p> |
933 | 1199 | </div> |
934 | 1200 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -938,11 +1204,17 @@ discard block |
||
938 | 1204 | <b>FlightAware API Key</b> |
939 | 1205 | <p> |
940 | 1206 | <label for="flightawareusername">Username</label> |
941 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
1207 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
1208 | + print $globalFlightAwareUsername; |
|
1209 | +} |
|
1210 | +?>" /> |
|
942 | 1211 | </p> |
943 | 1212 | <p> |
944 | 1213 | <label for="flightawarepassword">API key</label> |
945 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
1214 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
1215 | + print $globalFlightAwarePassword; |
|
1216 | +} |
|
1217 | +?>" /> |
|
946 | 1218 | </p> |
947 | 1219 | </div> |
948 | 1220 | <p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p> |
@@ -959,10 +1231,22 @@ discard block |
||
959 | 1231 | <p> |
960 | 1232 | <label for="mapmatchingsource">Map Matching source</label> |
961 | 1233 | <select name="mapmatchingsource" id="mapmatchingsource"> |
962 | - <option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>FlightAirMap Map Matching</option> |
|
963 | - <option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option> |
|
964 | - <option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') print 'selected="selected" '; ?>>OSMR</option> |
|
965 | - <option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option> |
|
1234 | + <option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) { |
|
1235 | + print 'selected="selected" '; |
|
1236 | +} |
|
1237 | +?>>FlightAirMap Map Matching</option> |
|
1238 | + <option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') { |
|
1239 | + print 'selected="selected" '; |
|
1240 | +} |
|
1241 | +?>>GraphHopper</option> |
|
1242 | + <option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') { |
|
1243 | + print 'selected="selected" '; |
|
1244 | +} |
|
1245 | +?>>OSMR</option> |
|
1246 | + <option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') { |
|
1247 | + print 'selected="selected" '; |
|
1248 | +} |
|
1249 | +?>>Mapbox</option> |
|
966 | 1250 | </select> |
967 | 1251 | <p class="help-block">Mapbox need the API Key defined in map section.</p> |
968 | 1252 | <p class="help-block">FlightAirMap Map Matching is free, without API key but limited to about 100 input points to keep fast results.</p> |
@@ -970,7 +1254,10 @@ discard block |
||
970 | 1254 | <br /> |
971 | 1255 | <p> |
972 | 1256 | <label for="graphhopper">GraphHopper API Key</label> |
973 | - <input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" /> |
|
1257 | + <input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) { |
|
1258 | + print $globalGraphHopperKey; |
|
1259 | +} |
|
1260 | +?>" /> |
|
974 | 1261 | <p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p> |
975 | 1262 | </p> |
976 | 1263 | </div> |
@@ -988,7 +1275,10 @@ discard block |
||
988 | 1275 | </p> |
989 | 1276 | <p> |
990 | 1277 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
991 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
1278 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
1279 | + print $globalNOTAMSource; |
|
1280 | +} |
|
1281 | +?>" /> |
|
992 | 1282 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
993 | 1283 | </p> |
994 | 1284 | <br /> |
@@ -1004,14 +1294,20 @@ discard block |
||
1004 | 1294 | <div id="metarsrc"> |
1005 | 1295 | <p> |
1006 | 1296 | <label for="metarsource">URL of your METAR source</label> |
1007 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
1297 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
1298 | + print $globalMETARurl; |
|
1299 | +} |
|
1300 | +?>" /> |
|
1008 | 1301 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
1009 | 1302 | </p> |
1010 | 1303 | </div> |
1011 | 1304 | <br /> |
1012 | 1305 | <p> |
1013 | 1306 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
1014 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
1307 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
1308 | + print $globalBitlyAccessToken; |
|
1309 | +} |
|
1310 | +?>" /> |
|
1015 | 1311 | </p> |
1016 | 1312 | <br /> |
1017 | 1313 | <p> |
@@ -1027,11 +1323,26 @@ discard block |
||
1027 | 1323 | <p> |
1028 | 1324 | <label for="geoid_source">Geoid Source</label> |
1029 | 1325 | <select name="geoid_source" id="geoid_source"> |
1030 | - <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option> |
|
1031 | - <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option> |
|
1032 | - <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option> |
|
1033 | - <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option> |
|
1034 | - <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option> |
|
1326 | + <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') { |
|
1327 | + print ' selected="selected"'; |
|
1328 | +} |
|
1329 | +?>>EGM96 15' (2.1MB)</option> |
|
1330 | + <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') { |
|
1331 | + print ' selected="selected"'; |
|
1332 | +} |
|
1333 | +?>>EGM96 5' (19MB)</option> |
|
1334 | + <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') { |
|
1335 | + print ' selected="selected"'; |
|
1336 | +} |
|
1337 | +?>>EGM2008 5' (19MB)</option> |
|
1338 | + <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') { |
|
1339 | + print ' selected="selected"'; |
|
1340 | +} |
|
1341 | +?>>EGM2008 2.5' (75MB)</option> |
|
1342 | + <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') { |
|
1343 | + print ' selected="selected"'; |
|
1344 | +} |
|
1345 | +?>>EGM2008 1' (470MB)</option> |
|
1035 | 1346 | </select> |
1036 | 1347 | <p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p> |
1037 | 1348 | </p> |
@@ -1053,7 +1364,12 @@ discard block |
||
1053 | 1364 | </p> |
1054 | 1365 | <p> |
1055 | 1366 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
1056 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" /> |
|
1367 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
1368 | + print $globalArchiveMonths; |
|
1369 | +} else { |
|
1370 | + echo '1'; |
|
1371 | +} |
|
1372 | +?>" /> |
|
1057 | 1373 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
1058 | 1374 | </p> |
1059 | 1375 | <p> |
@@ -1063,12 +1379,22 @@ discard block |
||
1063 | 1379 | </p> |
1064 | 1380 | <p> |
1065 | 1381 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
1066 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" /> |
|
1382 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
1383 | + print $globalArchiveKeepMonths; |
|
1384 | +} else { |
|
1385 | + echo '1'; |
|
1386 | +} |
|
1387 | +?>" /> |
|
1067 | 1388 | <p class="help-block">0 to disable</p> |
1068 | 1389 | </p> |
1069 | 1390 | <p> |
1070 | 1391 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
1071 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" /> |
|
1392 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
1393 | + print $globalArchiveKeepTrackMonths; |
|
1394 | +} else { |
|
1395 | + echo '1'; |
|
1396 | +} |
|
1397 | +?>" /> |
|
1072 | 1398 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
1073 | 1399 | </p> |
1074 | 1400 | <br /> |
@@ -1078,7 +1404,12 @@ discard block |
||
1078 | 1404 | <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> |
1079 | 1405 | <div id="cronends"> |
1080 | 1406 | <label for="cronend">Run script for xx seconds</label> |
1081 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
1407 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
1408 | + print $globalCronEnd; |
|
1409 | +} else { |
|
1410 | + print '0'; |
|
1411 | +} |
|
1412 | +?>" /> |
|
1082 | 1413 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
1083 | 1414 | </div> |
1084 | 1415 | </p> |
@@ -1137,20 +1468,40 @@ discard block |
||
1137 | 1468 | <br /> |
1138 | 1469 | <p> |
1139 | 1470 | <label for="refresh">Show flights detected since xxx seconds</label> |
1140 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
1471 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
1472 | + echo $globalLiveInterval; |
|
1473 | +} else { |
|
1474 | + echo '200'; |
|
1475 | +} |
|
1476 | +?>" /> |
|
1141 | 1477 | </p> |
1142 | 1478 | <p> |
1143 | 1479 | <label for="maprefresh">Live map refresh (in seconds)</label> |
1144 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
1480 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
1481 | + echo $globalMapRefresh; |
|
1482 | +} else { |
|
1483 | + echo '30'; |
|
1484 | +} |
|
1485 | +?>" /> |
|
1145 | 1486 | </p> |
1146 | 1487 | <p> |
1147 | 1488 | <label for="mapidle">Map idle timeout (in minutes)</label> |
1148 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
1489 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
1490 | + echo $globalMapIdleTimeout; |
|
1491 | +} else { |
|
1492 | + echo '30'; |
|
1493 | +} |
|
1494 | +?>" /> |
|
1149 | 1495 | <p class="help-block">0 to disable</p> |
1150 | 1496 | </p> |
1151 | 1497 | <p> |
1152 | 1498 | <label for="minfetch">HTTP/file source fetch every xxx seconds</label> |
1153 | - <input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) echo $globalMinFetch; else echo '20'; ?>" /> |
|
1499 | + <input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) { |
|
1500 | + echo $globalMinFetch; |
|
1501 | +} else { |
|
1502 | + echo '20'; |
|
1503 | +} |
|
1504 | +?>" /> |
|
1154 | 1505 | </p> |
1155 | 1506 | <p> |
1156 | 1507 | <label for="bbox">Only display flights that we can see on screen (bounding box)</label> |
@@ -1169,12 +1520,20 @@ discard block |
||
1169 | 1520 | <br /> |
1170 | 1521 | <p> |
1171 | 1522 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
1172 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
1523 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
1524 | + echo $globalClosestMinDist; |
|
1525 | +} else { |
|
1526 | + echo '50'; |
|
1527 | +} |
|
1528 | +?>" /> |
|
1173 | 1529 | </p> |
1174 | 1530 | <br /> |
1175 | 1531 | <p> |
1176 | 1532 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
1177 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
1533 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
1534 | + echo $globalAircraftSize; |
|
1535 | +} |
|
1536 | +?>" /> |
|
1178 | 1537 | </p> |
1179 | 1538 | <br /> |
1180 | 1539 | <p> |
@@ -1193,22 +1552,42 @@ discard block |
||
1193 | 1552 | <br /> |
1194 | 1553 | <p> |
1195 | 1554 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
1196 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
1555 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
1556 | + echo $globalAircraftIconColor; |
|
1557 | +} else { |
|
1558 | + echo '1a3151'; |
|
1559 | +} |
|
1560 | +?>" /> |
|
1197 | 1561 | </p> |
1198 | 1562 | <br /> |
1199 | 1563 | <p> |
1200 | 1564 | <label for="marineiconcolor">Color of marine icon on map</label> |
1201 | - <input type="color" name="marineiconcolor" id="marineiconcolor" value="#<?php if (isset($globalMarineIconColor)) echo $globalMarineIconColor; else echo '43d1d8'; ?>" /> |
|
1565 | + <input type="color" name="marineiconcolor" id="marineiconcolor" value="#<?php if (isset($globalMarineIconColor)) { |
|
1566 | + echo $globalMarineIconColor; |
|
1567 | +} else { |
|
1568 | + echo '43d1d8'; |
|
1569 | +} |
|
1570 | +?>" /> |
|
1202 | 1571 | </p> |
1203 | 1572 | <br /> |
1204 | 1573 | <p> |
1205 | 1574 | <label for="trackericoncolor">Color of tracker icon on map</label> |
1206 | - <input type="color" name="trackericoncolor" id="trackericoncolor" value="#<?php if (isset($globalTrackerIconColor)) echo $globalTrackerIconColor; else echo '1a3151'; ?>" /> |
|
1575 | + <input type="color" name="trackericoncolor" id="trackericoncolor" value="#<?php if (isset($globalTrackerIconColor)) { |
|
1576 | + echo $globalTrackerIconColor; |
|
1577 | +} else { |
|
1578 | + echo '1a3151'; |
|
1579 | +} |
|
1580 | +?>" /> |
|
1207 | 1581 | </p> |
1208 | 1582 | <br /> |
1209 | 1583 | <p> |
1210 | 1584 | <label for="satelliteiconcolor">Color of satellite icon on map</label> |
1211 | - <input type="color" name="satelliteiconcolor" id="satelliteiconcolor" value="#<?php if (isset($globalSatelliteIconColor)) echo $globalSatelliteIconColor; else echo '1a3151'; ?>" /> |
|
1585 | + <input type="color" name="satelliteiconcolor" id="satelliteiconcolor" value="#<?php if (isset($globalSatelliteIconColor)) { |
|
1586 | + echo $globalSatelliteIconColor; |
|
1587 | +} else { |
|
1588 | + echo '1a3151'; |
|
1589 | +} |
|
1590 | +?>" /> |
|
1212 | 1591 | </p> |
1213 | 1592 | <?php |
1214 | 1593 | if (!is_writable('../cache')) { |
@@ -1232,14 +1611,27 @@ discard block |
||
1232 | 1611 | <p> |
1233 | 1612 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
1234 | 1613 | <div class="range"> |
1235 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
1236 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
1614 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
1615 | + echo $globalAirportZoom; |
|
1616 | +} else { |
|
1617 | + echo '7'; |
|
1618 | +} |
|
1619 | +?>" /> |
|
1620 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
1621 | + echo $globalAirportZoom; |
|
1622 | +} else { |
|
1623 | + echo '7'; |
|
1624 | +} |
|
1625 | +?></output> |
|
1237 | 1626 | </div> |
1238 | 1627 | </p> |
1239 | 1628 | <br /> |
1240 | 1629 | <p> |
1241 | 1630 | <label for="customcss">Custom CSS web path</label> |
1242 | - <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" /> |
|
1631 | + <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) { |
|
1632 | + echo $globalCustomCSS; |
|
1633 | +} |
|
1634 | +?>" /> |
|
1243 | 1635 | </p> |
1244 | 1636 | </fieldset> |
1245 | 1637 | <input type="submit" name="submit" value="Create/Update database & write setup" /> |
@@ -1269,8 +1661,12 @@ discard block |
||
1269 | 1661 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
1270 | 1662 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
1271 | 1663 | |
1272 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
1273 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1664 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
1665 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
1666 | + } |
|
1667 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
1668 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1669 | + } |
|
1274 | 1670 | |
1275 | 1671 | $_SESSION['database_root'] = $dbroot; |
1276 | 1672 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -1348,15 +1744,23 @@ discard block |
||
1348 | 1744 | $source_city = $_POST['source_city']; |
1349 | 1745 | $source_country = $_POST['source_country']; |
1350 | 1746 | $source_ref = $_POST['source_ref']; |
1351 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
1352 | - else $source_id = array(); |
|
1747 | + if (isset($source_id)) { |
|
1748 | + $source_id = $_POST['source_id']; |
|
1749 | + } else { |
|
1750 | + $source_id = array(); |
|
1751 | + } |
|
1353 | 1752 | |
1354 | 1753 | $sources = array(); |
1355 | 1754 | foreach ($source_name as $keys => $name) { |
1356 | - 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]); |
|
1357 | - 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]); |
|
1755 | + if (isset($source_id[$keys])) { |
|
1756 | + $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]); |
|
1757 | + } else { |
|
1758 | + $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]); |
|
1759 | + } |
|
1760 | + } |
|
1761 | + if (count($sources) > 0) { |
|
1762 | + $_SESSION['sources'] = $sources; |
|
1358 | 1763 | } |
1359 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
1360 | 1764 | |
1361 | 1765 | $newsurl = $_POST['newsurl']; |
1362 | 1766 | $newslng = $_POST['newslang']; |
@@ -1369,7 +1773,9 @@ discard block |
||
1369 | 1773 | $lng = $newslng[$newskey]; |
1370 | 1774 | if (isset($newsfeeds[$type][$lng])) { |
1371 | 1775 | $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url)); |
1372 | - } else $newsfeeds[$type][$lng] = array($url); |
|
1776 | + } else { |
|
1777 | + $newsfeeds[$type][$lng] = array($url); |
|
1778 | + } |
|
1373 | 1779 | } |
1374 | 1780 | } |
1375 | 1781 | $settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds)); |
@@ -1394,17 +1800,29 @@ discard block |
||
1394 | 1800 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
1395 | 1801 | |
1396 | 1802 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
1397 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1398 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1803 | + if ($globalaircraft == 'aircraft') { |
|
1804 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1805 | + } else { |
|
1806 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1807 | + } |
|
1399 | 1808 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
1400 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1401 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1809 | + if ($globaltracker == 'tracker') { |
|
1810 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1811 | + } else { |
|
1812 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1813 | + } |
|
1402 | 1814 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
1403 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1404 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1815 | + if ($globalmarine == 'marine') { |
|
1816 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1817 | + } else { |
|
1818 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1819 | + } |
|
1405 | 1820 | $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING); |
1406 | - if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
1407 | - else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
1821 | + if ($globalsatellite == 'satellite') { |
|
1822 | + $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
1823 | + } else { |
|
1824 | + $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
1825 | + } |
|
1408 | 1826 | |
1409 | 1827 | /* |
1410 | 1828 | $globalSBS1Hosts = array(); |
@@ -1426,23 +1844,37 @@ discard block |
||
1426 | 1844 | $name = $_POST['name']; |
1427 | 1845 | $format = $_POST['format']; |
1428 | 1846 | $timezones = $_POST['timezones']; |
1429 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
1430 | - else $sourcestats = array(); |
|
1431 | - if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive']; |
|
1432 | - else $noarchive = array(); |
|
1847 | + if (isset($_POST['sourcestats'])) { |
|
1848 | + $sourcestats = $_POST['sourcestats']; |
|
1849 | + } else { |
|
1850 | + $sourcestats = array(); |
|
1851 | + } |
|
1852 | + if (isset($_POST['noarchive'])) { |
|
1853 | + $noarchive = $_POST['noarchive']; |
|
1854 | + } else { |
|
1855 | + $noarchive = array(); |
|
1856 | + } |
|
1433 | 1857 | $gSources = array(); |
1434 | 1858 | $forcepilots = false; |
1435 | 1859 | foreach ($host as $key => $h) { |
1436 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
1437 | - else $cov = 'FALSE'; |
|
1438 | - if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
|
1439 | - else $arch = 'FALSE'; |
|
1860 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
1861 | + $cov = 'TRUE'; |
|
1862 | + } else { |
|
1863 | + $cov = 'FALSE'; |
|
1864 | + } |
|
1865 | + if (isset($noarchive[$key]) && $noarchive[$key] == 1) { |
|
1866 | + $arch = 'TRUE'; |
|
1867 | + } else { |
|
1868 | + $arch = 'FALSE'; |
|
1869 | + } |
|
1440 | 1870 | if (strpos($format[$key],'_callback')) { |
1441 | 1871 | $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
1442 | 1872 | } elseif ($format[$key] != 'auto' || ($h != '' || $name[$key] != '')) { |
1443 | 1873 | $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
1444 | 1874 | } |
1445 | - if ($format[$key] == 'airwhere') $forcepilots = true; |
|
1875 | + if ($format[$key] == 'airwhere') { |
|
1876 | + $forcepilots = true; |
|
1877 | + } |
|
1446 | 1878 | } |
1447 | 1879 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
1448 | 1880 | |
@@ -1473,7 +1905,9 @@ discard block |
||
1473 | 1905 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
1474 | 1906 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1475 | 1907 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
1476 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1908 | + } else { |
|
1909 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1910 | + } |
|
1477 | 1911 | |
1478 | 1912 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
1479 | 1913 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1514,7 +1948,9 @@ discard block |
||
1514 | 1948 | |
1515 | 1949 | // Create in settings.php keys not yet configurable if not already here |
1516 | 1950 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1517 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1951 | + if (!isset($globalDebug)) { |
|
1952 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1953 | + } |
|
1518 | 1954 | |
1519 | 1955 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
1520 | 1956 | if ($resetyearstats == 'resetyearstats') { |
@@ -1557,37 +1993,56 @@ discard block |
||
1557 | 1993 | } |
1558 | 1994 | */ |
1559 | 1995 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
1560 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1561 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1562 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1563 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1996 | + if ($globalsbs == 'sbs') { |
|
1997 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1998 | + } else { |
|
1999 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
2000 | + } |
|
2001 | + if ($globalaprs == 'aprs') { |
|
2002 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
2003 | + } else { |
|
2004 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
2005 | + } |
|
1564 | 2006 | $va = false; |
1565 | 2007 | if ($globalivao == 'ivao') { |
1566 | 2008 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
1567 | 2009 | $va = true; |
1568 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
2010 | + } else { |
|
2011 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
2012 | + } |
|
1569 | 2013 | if ($globalvatsim == 'vatsim') { |
1570 | 2014 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
1571 | 2015 | $va = true; |
1572 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
2016 | + } else { |
|
2017 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
2018 | + } |
|
1573 | 2019 | if ($globalphpvms == 'phpvms') { |
1574 | 2020 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
1575 | 2021 | $va = true; |
1576 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
2022 | + } else { |
|
2023 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
2024 | + } |
|
1577 | 2025 | if ($globalvam == 'vam') { |
1578 | 2026 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
1579 | 2027 | $va = true; |
1580 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
2028 | + } else { |
|
2029 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
2030 | + } |
|
1581 | 2031 | if ($va) { |
1582 | 2032 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
1583 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
2033 | + } else { |
|
2034 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
2035 | + } |
|
1584 | 2036 | if ($globalva == 'va' || $va) { |
1585 | 2037 | $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
1586 | 2038 | $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
1587 | 2039 | } else { |
1588 | 2040 | $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
1589 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1590 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
2041 | + if ($forcepilots) { |
|
2042 | + $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
2043 | + } else { |
|
2044 | + $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
2045 | + } |
|
1591 | 2046 | } |
1592 | 2047 | if ($globalvm == 'vm') { |
1593 | 2048 | $settings = array_merge($settings,array('globalVM' => 'TRUE')); |
@@ -1847,7 +2302,9 @@ discard block |
||
1847 | 2302 | $graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING); |
1848 | 2303 | $settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper)); |
1849 | 2304 | |
1850 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
2305 | + if (!isset($globalTransaction)) { |
|
2306 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
2307 | + } |
|
1851 | 2308 | |
1852 | 2309 | // Set some defaults values... |
1853 | 2310 | if (!isset($globalAircraftImageSources)) { |
@@ -1862,15 +2319,23 @@ discard block |
||
1862 | 2319 | |
1863 | 2320 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1864 | 2321 | |
1865 | - if ($error == '') settings::modify_settings($settings); |
|
1866 | - if ($error == '') settings::comment_settings($settings_comment); |
|
2322 | + if ($error == '') { |
|
2323 | + settings::modify_settings($settings); |
|
2324 | + } |
|
2325 | + if ($error == '') { |
|
2326 | + settings::comment_settings($settings_comment); |
|
2327 | + } |
|
1867 | 2328 | if ($error != '') { |
1868 | 2329 | print '<div class="info column">'.$error.'</div>'; |
1869 | 2330 | require('../footer.php'); |
1870 | 2331 | exit; |
1871 | 2332 | } else { |
1872 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
1873 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
2333 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
2334 | + $_SESSION['waypoints'] = 1; |
|
2335 | + } |
|
2336 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
2337 | + $_SESSION['owner'] = 1; |
|
2338 | + } |
|
1874 | 2339 | if (isset($_POST['createdb'])) { |
1875 | 2340 | $_SESSION['install'] = 'database_create'; |
1876 | 2341 | } else { |
@@ -1907,10 +2372,18 @@ discard block |
||
1907 | 2372 | $popw = false; |
1908 | 2373 | foreach ($_SESSION['done'] as $done) { |
1909 | 2374 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
1910 | - if ($done == 'Create database') $pop = true; |
|
1911 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1912 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1913 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
2375 | + if ($done == 'Create database') { |
|
2376 | + $pop = true; |
|
2377 | + } |
|
2378 | + if ($_SESSION['install'] == 'database_create') { |
|
2379 | + $pop = true; |
|
2380 | + } |
|
2381 | + if ($_SESSION['install'] == 'database_import') { |
|
2382 | + $popi = true; |
|
2383 | + } |
|
2384 | + if ($_SESSION['install'] == 'waypoints') { |
|
2385 | + $popw = true; |
|
2386 | + } |
|
1914 | 2387 | } |
1915 | 2388 | if ($pop) { |
1916 | 2389 | sleep(5); |
@@ -1921,7 +2394,9 @@ discard block |
||
1921 | 2394 | } else if ($popw) { |
1922 | 2395 | sleep(5); |
1923 | 2396 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
1924 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
2397 | + } else { |
|
2398 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
2399 | + } |
|
1925 | 2400 | print '</div></ul>'; |
1926 | 2401 | print '<div id="error"></div>'; |
1927 | 2402 | /* foreach ($_SESSION['done'] as $done) { |