@@ -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,11 +609,17 @@ 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 | --> |
@@ -541,7 +661,10 @@ discard block |
||
| 541 | 661 | if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
| 542 | 662 | ?> |
| 543 | 663 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
| 544 | - <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
|
| 664 | + <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) { |
|
| 665 | + print $source['port']; |
|
| 666 | +} |
|
| 667 | +?>" /></td> |
|
| 545 | 668 | <?php |
| 546 | 669 | } else { |
| 547 | 670 | $hostport = explode(':',$source['host']); |
@@ -560,37 +683,118 @@ discard block |
||
| 560 | 683 | ?> |
| 561 | 684 | <td> |
| 562 | 685 | <select name="format[]" id="format"> |
| 563 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
| 564 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
| 565 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
| 566 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
| 567 | - <option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option> |
|
| 568 | - <option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') print 'selected'; ?>>Planefinder client</option> |
|
| 569 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
| 570 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
| 571 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
| 572 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
| 573 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
| 574 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
| 575 | - <option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option> |
|
| 576 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
| 577 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
| 578 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
| 579 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
| 580 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
| 581 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
| 582 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
| 583 | - <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option> |
|
| 584 | - <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option> |
|
| 585 | - <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option> |
|
| 586 | - <option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') print 'selected'; ?>>Sailaway</option> |
|
| 686 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
| 687 | + print 'selected'; |
|
| 688 | +} |
|
| 689 | +?>>Auto</option> |
|
| 690 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
| 691 | + print 'selected'; |
|
| 692 | +} |
|
| 693 | +?>>SBS</option> |
|
| 694 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
| 695 | + print 'selected'; |
|
| 696 | +} |
|
| 697 | +?>>TSV</option> |
|
| 698 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
| 699 | + print 'selected'; |
|
| 700 | +} |
|
| 701 | +?>>Raw</option> |
|
| 702 | + <option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') { |
|
| 703 | + print 'selected'; |
|
| 704 | +} |
|
| 705 | +?>>Dump1090 aircraft.json</option> |
|
| 706 | + <option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') { |
|
| 707 | + print 'selected'; |
|
| 708 | +} |
|
| 709 | +?>>Planefinder client</option> |
|
| 710 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
| 711 | + print 'selected'; |
|
| 712 | +} |
|
| 713 | +?>>APRS</option> |
|
| 714 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
| 715 | + print 'selected'; |
|
| 716 | +} |
|
| 717 | +?>>Radarcape deltadb.txt</option> |
|
| 718 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
| 719 | + print 'selected'; |
|
| 720 | +} |
|
| 721 | +?>>Vatsim</option> |
|
| 722 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
| 723 | + print 'selected'; |
|
| 724 | +} |
|
| 725 | +?>>Virtual Radar Server AircraftList.json</option> |
|
| 726 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
| 727 | + print 'selected'; |
|
| 728 | +} |
|
| 729 | +?>>Virtual Radar Server TCP</option> |
|
| 730 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
| 731 | + print 'selected'; |
|
| 732 | +} |
|
| 733 | +?>>phpVMS</option> |
|
| 734 | + <option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
| 735 | + print 'selected'; |
|
| 736 | +} |
|
| 737 | +?>>Virtual Airline Operations System (VAOS)</option> |
|
| 738 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
| 739 | + print 'selected'; |
|
| 740 | +} |
|
| 741 | +?>>Virtual Airlines Manager</option> |
|
| 742 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
| 743 | + print 'selected'; |
|
| 744 | +} |
|
| 745 | +?>>IVAO</option> |
|
| 746 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
| 747 | + print 'selected'; |
|
| 748 | +} |
|
| 749 | +?>>FlightGear Multiplayer</option> |
|
| 750 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
| 751 | + print 'selected'; |
|
| 752 | +} |
|
| 753 | +?>>FlightGear Singleplayer</option> |
|
| 754 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
| 755 | + print 'selected'; |
|
| 756 | +} |
|
| 757 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
| 758 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
| 759 | + print 'selected'; |
|
| 760 | +} |
|
| 761 | +?>>ACARS SBS-3 over TCP</option> |
|
| 762 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
| 763 | + print 'selected'; |
|
| 764 | +} |
|
| 765 | +?>>NMEA AIS over TCP</option> |
|
| 766 | + <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') { |
|
| 767 | + print 'selected'; |
|
| 768 | +} |
|
| 769 | +?>>AirWhere website</option> |
|
| 770 | + <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') { |
|
| 771 | + print 'selected'; |
|
| 772 | +} |
|
| 773 | +?>>HidnSeek Callback</option> |
|
| 774 | + <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') { |
|
| 775 | + print 'selected'; |
|
| 776 | +} |
|
| 777 | +?>>Blitzortung</option> |
|
| 778 | + <option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') { |
|
| 779 | + print 'selected'; |
|
| 780 | +} |
|
| 781 | +?>>Sailaway</option> |
|
| 587 | 782 | </select> |
| 588 | 783 | </td> |
| 589 | 784 | <td> |
| 590 | - <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /> |
|
| 785 | + <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
| 786 | + print $source['name']; |
|
| 787 | +} |
|
| 788 | +?>" /> |
|
| 591 | 789 | </td> |
| 592 | - <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> |
|
| 593 | - <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> |
|
| 790 | + <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']) { |
|
| 791 | + print 'checked'; |
|
| 792 | +} |
|
| 793 | +?> /></td> |
|
| 794 | + <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) { |
|
| 795 | + print 'checked'; |
|
| 796 | +} |
|
| 797 | +?> /></td> |
|
| 594 | 798 | <td> |
| 595 | 799 | <select name="timezones[]" id="timezones"> |
| 596 | 800 | <?php |
@@ -600,7 +804,9 @@ discard block |
||
| 600 | 804 | print '<option selected>'.$timezones.'</option>'; |
| 601 | 805 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
| 602 | 806 | print '<option selected>'.$timezones.'</option>'; |
| 603 | - } else print '<option>'.$timezones.'</option>'; |
|
| 807 | + } else { |
|
| 808 | + print '<option>'.$timezones.'</option>'; |
|
| 809 | + } |
|
| 604 | 810 | } |
| 605 | 811 | ?> |
| 606 | 812 | </select> |
@@ -654,7 +860,9 @@ discard block |
||
| 654 | 860 | foreach($timezonelist as $timezones){ |
| 655 | 861 | if ($timezones == 'UTC') { |
| 656 | 862 | print '<option selected>'.$timezones.'</option>'; |
| 657 | - } else print '<option>'.$timezones.'</option>'; |
|
| 863 | + } else { |
|
| 864 | + print '<option>'.$timezones.'</option>'; |
|
| 865 | + } |
|
| 658 | 866 | } |
| 659 | 867 | ?> |
| 660 | 868 | </select> |
@@ -679,11 +887,17 @@ discard block |
||
| 679 | 887 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
| 680 | 888 | <p> |
| 681 | 889 | <label for="acarshost">ACARS UDP host</label> |
| 682 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
| 890 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
| 891 | + print $globalACARSHost; |
|
| 892 | +} |
|
| 893 | +?>" /> |
|
| 683 | 894 | </p> |
| 684 | 895 | <p> |
| 685 | 896 | <label for="acarsport">ACARS UDP port</label> |
| 686 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
| 897 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
| 898 | + print $globalACARSPort; |
|
| 899 | +} |
|
| 900 | +?>" /> |
|
| 687 | 901 | </p> |
| 688 | 902 | </fieldset> |
| 689 | 903 | </div> |
@@ -709,17 +923,38 @@ discard block |
||
| 709 | 923 | <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td> |
| 710 | 924 | <td> |
| 711 | 925 | <select name="newslang[]"> |
| 712 | - <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option> |
|
| 713 | - <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option> |
|
| 926 | + <option value="en"<?php if ($lng == 'en') { |
|
| 927 | + print ' selected'; |
|
| 928 | +} |
|
| 929 | +?>>English</option> |
|
| 930 | + <option value="fr"<?php if ($lng == 'fr') { |
|
| 931 | + print ' selected'; |
|
| 932 | +} |
|
| 933 | +?>>French</option> |
|
| 714 | 934 | </select> |
| 715 | 935 | </td> |
| 716 | 936 | <td> |
| 717 | 937 | <select name="newstype[]"> |
| 718 | - <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option> |
|
| 719 | - <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option> |
|
| 720 | - <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option> |
|
| 721 | - <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option> |
|
| 722 | - <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option> |
|
| 938 | + <option value="global"<?php if ($type == 'global') { |
|
| 939 | + print ' selected'; |
|
| 940 | +} |
|
| 941 | +?>>Global</option> |
|
| 942 | + <option value="aircraft"<?php if ($type == 'aircraft') { |
|
| 943 | + print ' selected'; |
|
| 944 | +} |
|
| 945 | +?>>Aircraft</option> |
|
| 946 | + <option value="marine"<?php if ($type == 'marine') { |
|
| 947 | + print ' selected'; |
|
| 948 | +} |
|
| 949 | +?>>Marine</option> |
|
| 950 | + <option value="tracker"<?php if ($type == 'tracker') { |
|
| 951 | + print ' selected'; |
|
| 952 | +} |
|
| 953 | +?>>Tracker</option> |
|
| 954 | + <option value="satellite"<?php if ($type == 'Satellite') { |
|
| 955 | + print ' selected'; |
|
| 956 | +} |
|
| 957 | +?>>Satellite</option> |
|
| 723 | 958 | </select> |
| 724 | 959 | </td> |
| 725 | 960 | <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td> |
@@ -861,13 +1096,19 @@ discard block |
||
| 861 | 1096 | <div id="schedules_options"> |
| 862 | 1097 | <p> |
| 863 | 1098 | <label for="britishairways">British Airways API Key</label> |
| 864 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
| 1099 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
| 1100 | + print $globalBritishAirwaysKey; |
|
| 1101 | +} |
|
| 1102 | +?>" /> |
|
| 865 | 1103 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
| 866 | 1104 | </p> |
| 867 | 1105 | <!-- |
| 868 | 1106 | <p> |
| 869 | 1107 | <label for="transavia">Transavia Test API Consumer Key</label> |
| 870 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
| 1108 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
| 1109 | + print $globalTransaviaKey; |
|
| 1110 | +} |
|
| 1111 | +?>" /> |
|
| 871 | 1112 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
| 872 | 1113 | </p> |
| 873 | 1114 | --> |
@@ -876,10 +1117,16 @@ discard block |
||
| 876 | 1117 | <b>Lufthansa API Key</b> |
| 877 | 1118 | <p> |
| 878 | 1119 | <label for="lufthansakey">Key</label> |
| 879 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
| 1120 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
| 1121 | + print $globalLufthansaKey['key']; |
|
| 1122 | +} |
|
| 1123 | +?>" /> |
|
| 880 | 1124 | </p><p> |
| 881 | 1125 | <label for="lufthansasecret">Secret</label> |
| 882 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
| 1126 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
| 1127 | + print $globalLufthansaKey['secret']; |
|
| 1128 | +} |
|
| 1129 | +?>" /> |
|
| 883 | 1130 | </p> |
| 884 | 1131 | </div> |
| 885 | 1132 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -889,11 +1136,17 @@ discard block |
||
| 889 | 1136 | <b>FlightAware API Key</b> |
| 890 | 1137 | <p> |
| 891 | 1138 | <label for="flightawareusername">Username</label> |
| 892 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
| 1139 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
| 1140 | + print $globalFlightAwareUsername; |
|
| 1141 | +} |
|
| 1142 | +?>" /> |
|
| 893 | 1143 | </p> |
| 894 | 1144 | <p> |
| 895 | 1145 | <label for="flightawarepassword">API key</label> |
| 896 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
| 1146 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
| 1147 | + print $globalFlightAwarePassword; |
|
| 1148 | +} |
|
| 1149 | +?>" /> |
|
| 897 | 1150 | </p> |
| 898 | 1151 | </div> |
| 899 | 1152 | <p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p> |
@@ -910,10 +1163,22 @@ discard block |
||
| 910 | 1163 | <p> |
| 911 | 1164 | <label for="mapmatchingsource">Map Matching source</label> |
| 912 | 1165 | <select name="mapmatchingsource" id="mapmatchingsource"> |
| 913 | - <option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>FlightAirMap Map Matching</option> |
|
| 914 | - <option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option> |
|
| 915 | - <option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') print 'selected="selected" '; ?>>OSMR</option> |
|
| 916 | - <option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option> |
|
| 1166 | + <option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) { |
|
| 1167 | + print 'selected="selected" '; |
|
| 1168 | +} |
|
| 1169 | +?>>FlightAirMap Map Matching</option> |
|
| 1170 | + <option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') { |
|
| 1171 | + print 'selected="selected" '; |
|
| 1172 | +} |
|
| 1173 | +?>>GraphHopper</option> |
|
| 1174 | + <option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') { |
|
| 1175 | + print 'selected="selected" '; |
|
| 1176 | +} |
|
| 1177 | +?>>OSMR</option> |
|
| 1178 | + <option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') { |
|
| 1179 | + print 'selected="selected" '; |
|
| 1180 | +} |
|
| 1181 | +?>>Mapbox</option> |
|
| 917 | 1182 | </select> |
| 918 | 1183 | <p class="help-block">Mapbox need the API Key defined in map section.</p> |
| 919 | 1184 | <p class="help-block">FlightAirMap Map Matching is free, without API key but limited to about 100 input points to keep fast results.</p> |
@@ -921,7 +1186,10 @@ discard block |
||
| 921 | 1186 | <br /> |
| 922 | 1187 | <p> |
| 923 | 1188 | <label for="graphhopper">GraphHopper API Key</label> |
| 924 | - <input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" /> |
|
| 1189 | + <input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) { |
|
| 1190 | + print $globalGraphHopperKey; |
|
| 1191 | +} |
|
| 1192 | +?>" /> |
|
| 925 | 1193 | <p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p> |
| 926 | 1194 | </p> |
| 927 | 1195 | </div> |
@@ -939,7 +1207,10 @@ discard block |
||
| 939 | 1207 | </p> |
| 940 | 1208 | <p> |
| 941 | 1209 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
| 942 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
| 1210 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
| 1211 | + print $globalNOTAMSource; |
|
| 1212 | +} |
|
| 1213 | +?>" /> |
|
| 943 | 1214 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
| 944 | 1215 | </p> |
| 945 | 1216 | <br /> |
@@ -955,14 +1226,20 @@ discard block |
||
| 955 | 1226 | <div id="metarsrc"> |
| 956 | 1227 | <p> |
| 957 | 1228 | <label for="metarsource">URL of your METAR source</label> |
| 958 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
| 1229 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
| 1230 | + print $globalMETARurl; |
|
| 1231 | +} |
|
| 1232 | +?>" /> |
|
| 959 | 1233 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
| 960 | 1234 | </p> |
| 961 | 1235 | </div> |
| 962 | 1236 | <br /> |
| 963 | 1237 | <p> |
| 964 | 1238 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
| 965 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
| 1239 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
| 1240 | + print $globalBitlyAccessToken; |
|
| 1241 | +} |
|
| 1242 | +?>" /> |
|
| 966 | 1243 | </p> |
| 967 | 1244 | <br /> |
| 968 | 1245 | <p> |
@@ -978,11 +1255,26 @@ discard block |
||
| 978 | 1255 | <p> |
| 979 | 1256 | <label for="geoid_source">Geoid Source</label> |
| 980 | 1257 | <select name="geoid_source" id="geoid_source"> |
| 981 | - <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option> |
|
| 982 | - <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option> |
|
| 983 | - <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option> |
|
| 984 | - <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option> |
|
| 985 | - <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option> |
|
| 1258 | + <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') { |
|
| 1259 | + print ' selected="selected"'; |
|
| 1260 | +} |
|
| 1261 | +?>>EGM96 15' (2.1MB)</option> |
|
| 1262 | + <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') { |
|
| 1263 | + print ' selected="selected"'; |
|
| 1264 | +} |
|
| 1265 | +?>>EGM96 5' (19MB)</option> |
|
| 1266 | + <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') { |
|
| 1267 | + print ' selected="selected"'; |
|
| 1268 | +} |
|
| 1269 | +?>>EGM2008 5' (19MB)</option> |
|
| 1270 | + <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') { |
|
| 1271 | + print ' selected="selected"'; |
|
| 1272 | +} |
|
| 1273 | +?>>EGM2008 2.5' (75MB)</option> |
|
| 1274 | + <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') { |
|
| 1275 | + print ' selected="selected"'; |
|
| 1276 | +} |
|
| 1277 | +?>>EGM2008 1' (470MB)</option> |
|
| 986 | 1278 | </select> |
| 987 | 1279 | <p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p> |
| 988 | 1280 | </p> |
@@ -1004,7 +1296,12 @@ discard block |
||
| 1004 | 1296 | </p> |
| 1005 | 1297 | <p> |
| 1006 | 1298 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
| 1007 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" /> |
|
| 1299 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
| 1300 | + print $globalArchiveMonths; |
|
| 1301 | +} else { |
|
| 1302 | + echo '1'; |
|
| 1303 | +} |
|
| 1304 | +?>" /> |
|
| 1008 | 1305 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
| 1009 | 1306 | </p> |
| 1010 | 1307 | <p> |
@@ -1014,12 +1311,22 @@ discard block |
||
| 1014 | 1311 | </p> |
| 1015 | 1312 | <p> |
| 1016 | 1313 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
| 1017 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" /> |
|
| 1314 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
| 1315 | + print $globalArchiveKeepMonths; |
|
| 1316 | +} else { |
|
| 1317 | + echo '1'; |
|
| 1318 | +} |
|
| 1319 | +?>" /> |
|
| 1018 | 1320 | <p class="help-block">0 to disable</p> |
| 1019 | 1321 | </p> |
| 1020 | 1322 | <p> |
| 1021 | 1323 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
| 1022 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" /> |
|
| 1324 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
| 1325 | + print $globalArchiveKeepTrackMonths; |
|
| 1326 | +} else { |
|
| 1327 | + echo '1'; |
|
| 1328 | +} |
|
| 1329 | +?>" /> |
|
| 1023 | 1330 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
| 1024 | 1331 | </p> |
| 1025 | 1332 | <br /> |
@@ -1029,7 +1336,12 @@ discard block |
||
| 1029 | 1336 | <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> |
| 1030 | 1337 | <div id="cronends"> |
| 1031 | 1338 | <label for="cronend">Run script for xx seconds</label> |
| 1032 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
| 1339 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
| 1340 | + print $globalCronEnd; |
|
| 1341 | +} else { |
|
| 1342 | + print '0'; |
|
| 1343 | +} |
|
| 1344 | +?>" /> |
|
| 1033 | 1345 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
| 1034 | 1346 | </div> |
| 1035 | 1347 | </p> |
@@ -1082,20 +1394,40 @@ discard block |
||
| 1082 | 1394 | <br /> |
| 1083 | 1395 | <p> |
| 1084 | 1396 | <label for="refresh">Show flights detected since xxx seconds</label> |
| 1085 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
| 1397 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
| 1398 | + echo $globalLiveInterval; |
|
| 1399 | +} else { |
|
| 1400 | + echo '200'; |
|
| 1401 | +} |
|
| 1402 | +?>" /> |
|
| 1086 | 1403 | </p> |
| 1087 | 1404 | <p> |
| 1088 | 1405 | <label for="maprefresh">Live map refresh (in seconds)</label> |
| 1089 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
| 1406 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
| 1407 | + echo $globalMapRefresh; |
|
| 1408 | +} else { |
|
| 1409 | + echo '30'; |
|
| 1410 | +} |
|
| 1411 | +?>" /> |
|
| 1090 | 1412 | </p> |
| 1091 | 1413 | <p> |
| 1092 | 1414 | <label for="mapidle">Map idle timeout (in minutes)</label> |
| 1093 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
| 1415 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
| 1416 | + echo $globalMapIdleTimeout; |
|
| 1417 | +} else { |
|
| 1418 | + echo '30'; |
|
| 1419 | +} |
|
| 1420 | +?>" /> |
|
| 1094 | 1421 | <p class="help-block">0 to disable</p> |
| 1095 | 1422 | </p> |
| 1096 | 1423 | <p> |
| 1097 | 1424 | <label for="minfetch">HTTP/file source fetch every xxx seconds</label> |
| 1098 | - <input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) echo $globalMinFetch; else echo '20'; ?>" /> |
|
| 1425 | + <input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) { |
|
| 1426 | + echo $globalMinFetch; |
|
| 1427 | +} else { |
|
| 1428 | + echo '20'; |
|
| 1429 | +} |
|
| 1430 | +?>" /> |
|
| 1099 | 1431 | </p> |
| 1100 | 1432 | <p> |
| 1101 | 1433 | <label for="bbox">Only display flights that we can see on screen (bounding box)</label> |
@@ -1109,12 +1441,20 @@ discard block |
||
| 1109 | 1441 | <br /> |
| 1110 | 1442 | <p> |
| 1111 | 1443 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
| 1112 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
| 1444 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
| 1445 | + echo $globalClosestMinDist; |
|
| 1446 | +} else { |
|
| 1447 | + echo '50'; |
|
| 1448 | +} |
|
| 1449 | +?>" /> |
|
| 1113 | 1450 | </p> |
| 1114 | 1451 | <br /> |
| 1115 | 1452 | <p> |
| 1116 | 1453 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
| 1117 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
| 1454 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
| 1455 | + echo $globalAircraftSize; |
|
| 1456 | +} |
|
| 1457 | +?>" /> |
|
| 1118 | 1458 | </p> |
| 1119 | 1459 | <br /> |
| 1120 | 1460 | <p> |
@@ -1133,7 +1473,12 @@ discard block |
||
| 1133 | 1473 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 1134 | 1474 | ?> |
| 1135 | 1475 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
| 1136 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
| 1476 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
| 1477 | + echo $globalAircraftIconColor; |
|
| 1478 | +} else { |
|
| 1479 | + echo '1a3151'; |
|
| 1480 | +} |
|
| 1481 | +?>" /> |
|
| 1137 | 1482 | <?php |
| 1138 | 1483 | if (!is_writable('../cache')) { |
| 1139 | 1484 | ?> |
@@ -1151,14 +1496,27 @@ discard block |
||
| 1151 | 1496 | <p> |
| 1152 | 1497 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
| 1153 | 1498 | <div class="range"> |
| 1154 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
| 1155 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
| 1499 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
| 1500 | + echo $globalAirportZoom; |
|
| 1501 | +} else { |
|
| 1502 | + echo '7'; |
|
| 1503 | +} |
|
| 1504 | +?>" /> |
|
| 1505 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
| 1506 | + echo $globalAirportZoom; |
|
| 1507 | +} else { |
|
| 1508 | + echo '7'; |
|
| 1509 | +} |
|
| 1510 | +?></output> |
|
| 1156 | 1511 | </div> |
| 1157 | 1512 | </p> |
| 1158 | 1513 | <br /> |
| 1159 | 1514 | <p> |
| 1160 | 1515 | <label for="customcss">Custom CSS web path</label> |
| 1161 | - <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" /> |
|
| 1516 | + <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) { |
|
| 1517 | + echo $globalCustomCSS; |
|
| 1518 | +} |
|
| 1519 | +?>" /> |
|
| 1162 | 1520 | </p> |
| 1163 | 1521 | </fieldset> |
| 1164 | 1522 | <input type="submit" name="submit" value="Create/Update database & write setup" /> |
@@ -1185,8 +1543,12 @@ discard block |
||
| 1185 | 1543 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
| 1186 | 1544 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
| 1187 | 1545 | |
| 1188 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
| 1189 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1546 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
| 1547 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
| 1548 | + } |
|
| 1549 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
| 1550 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1551 | + } |
|
| 1190 | 1552 | |
| 1191 | 1553 | $_SESSION['database_root'] = $dbroot; |
| 1192 | 1554 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -1254,15 +1616,23 @@ discard block |
||
| 1254 | 1616 | $source_city = $_POST['source_city']; |
| 1255 | 1617 | $source_country = $_POST['source_country']; |
| 1256 | 1618 | $source_ref = $_POST['source_ref']; |
| 1257 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
| 1258 | - else $source_id = array(); |
|
| 1619 | + if (isset($source_id)) { |
|
| 1620 | + $source_id = $_POST['source_id']; |
|
| 1621 | + } else { |
|
| 1622 | + $source_id = array(); |
|
| 1623 | + } |
|
| 1259 | 1624 | |
| 1260 | 1625 | $sources = array(); |
| 1261 | 1626 | foreach ($source_name as $keys => $name) { |
| 1262 | - 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]); |
|
| 1263 | - 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]); |
|
| 1627 | + if (isset($source_id[$keys])) { |
|
| 1628 | + $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]); |
|
| 1629 | + } else { |
|
| 1630 | + $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]); |
|
| 1631 | + } |
|
| 1632 | + } |
|
| 1633 | + if (count($sources) > 0) { |
|
| 1634 | + $_SESSION['sources'] = $sources; |
|
| 1264 | 1635 | } |
| 1265 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
| 1266 | 1636 | |
| 1267 | 1637 | $newsurl = $_POST['newsurl']; |
| 1268 | 1638 | $newslng = $_POST['newslang']; |
@@ -1275,7 +1645,9 @@ discard block |
||
| 1275 | 1645 | $lng = $newslng[$newskey]; |
| 1276 | 1646 | if (isset($newsfeeds[$type][$lng])) { |
| 1277 | 1647 | $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url)); |
| 1278 | - } else $newsfeeds[$type][$lng] = array($url); |
|
| 1648 | + } else { |
|
| 1649 | + $newsfeeds[$type][$lng] = array($url); |
|
| 1650 | + } |
|
| 1279 | 1651 | } |
| 1280 | 1652 | } |
| 1281 | 1653 | $settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds)); |
@@ -1300,17 +1672,29 @@ discard block |
||
| 1300 | 1672 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
| 1301 | 1673 | |
| 1302 | 1674 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
| 1303 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 1304 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1675 | + if ($globalaircraft == 'aircraft') { |
|
| 1676 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 1677 | + } else { |
|
| 1678 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1679 | + } |
|
| 1305 | 1680 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
| 1306 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 1307 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1681 | + if ($globaltracker == 'tracker') { |
|
| 1682 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 1683 | + } else { |
|
| 1684 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1685 | + } |
|
| 1308 | 1686 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
| 1309 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 1310 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1687 | + if ($globalmarine == 'marine') { |
|
| 1688 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 1689 | + } else { |
|
| 1690 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1691 | + } |
|
| 1311 | 1692 | $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING); |
| 1312 | - if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
| 1313 | - else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
| 1693 | + if ($globalsatellite == 'satellite') { |
|
| 1694 | + $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
| 1695 | + } else { |
|
| 1696 | + $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
| 1697 | + } |
|
| 1314 | 1698 | |
| 1315 | 1699 | /* |
| 1316 | 1700 | $globalSBS1Hosts = array(); |
@@ -1332,23 +1716,37 @@ discard block |
||
| 1332 | 1716 | $name = $_POST['name']; |
| 1333 | 1717 | $format = $_POST['format']; |
| 1334 | 1718 | $timezones = $_POST['timezones']; |
| 1335 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
| 1336 | - else $sourcestats = array(); |
|
| 1337 | - if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive']; |
|
| 1338 | - else $noarchive = array(); |
|
| 1719 | + if (isset($_POST['sourcestats'])) { |
|
| 1720 | + $sourcestats = $_POST['sourcestats']; |
|
| 1721 | + } else { |
|
| 1722 | + $sourcestats = array(); |
|
| 1723 | + } |
|
| 1724 | + if (isset($_POST['noarchive'])) { |
|
| 1725 | + $noarchive = $_POST['noarchive']; |
|
| 1726 | + } else { |
|
| 1727 | + $noarchive = array(); |
|
| 1728 | + } |
|
| 1339 | 1729 | $gSources = array(); |
| 1340 | 1730 | $forcepilots = false; |
| 1341 | 1731 | foreach ($host as $key => $h) { |
| 1342 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
| 1343 | - else $cov = 'FALSE'; |
|
| 1344 | - if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
|
| 1345 | - else $arch = 'FALSE'; |
|
| 1732 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
| 1733 | + $cov = 'TRUE'; |
|
| 1734 | + } else { |
|
| 1735 | + $cov = 'FALSE'; |
|
| 1736 | + } |
|
| 1737 | + if (isset($noarchive[$key]) && $noarchive[$key] == 1) { |
|
| 1738 | + $arch = 'TRUE'; |
|
| 1739 | + } else { |
|
| 1740 | + $arch = 'FALSE'; |
|
| 1741 | + } |
|
| 1346 | 1742 | if (strpos($format[$key],'_callback')) { |
| 1347 | 1743 | $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
| 1348 | 1744 | } elseif ($format[$key] != 'auto' || ($h != '' || $name[$key] != '')) { |
| 1349 | 1745 | $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
| 1350 | 1746 | } |
| 1351 | - if ($format[$key] == 'airwhere') $forcepilots = true; |
|
| 1747 | + if ($format[$key] == 'airwhere') { |
|
| 1748 | + $forcepilots = true; |
|
| 1749 | + } |
|
| 1352 | 1750 | } |
| 1353 | 1751 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
| 1354 | 1752 | |
@@ -1379,7 +1777,9 @@ discard block |
||
| 1379 | 1777 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
| 1380 | 1778 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
| 1381 | 1779 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
| 1382 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1780 | + } else { |
|
| 1781 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1782 | + } |
|
| 1383 | 1783 | |
| 1384 | 1784 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
| 1385 | 1785 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1420,7 +1820,9 @@ discard block |
||
| 1420 | 1820 | |
| 1421 | 1821 | // Create in settings.php keys not yet configurable if not already here |
| 1422 | 1822 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
| 1423 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1823 | + if (!isset($globalDebug)) { |
|
| 1824 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1825 | + } |
|
| 1424 | 1826 | |
| 1425 | 1827 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
| 1426 | 1828 | if ($resetyearstats == 'resetyearstats') { |
@@ -1463,37 +1865,56 @@ discard block |
||
| 1463 | 1865 | } |
| 1464 | 1866 | */ |
| 1465 | 1867 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
| 1466 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1467 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1468 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1469 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1868 | + if ($globalsbs == 'sbs') { |
|
| 1869 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1870 | + } else { |
|
| 1871 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1872 | + } |
|
| 1873 | + if ($globalaprs == 'aprs') { |
|
| 1874 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1875 | + } else { |
|
| 1876 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1877 | + } |
|
| 1470 | 1878 | $va = false; |
| 1471 | 1879 | if ($globalivao == 'ivao') { |
| 1472 | 1880 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
| 1473 | 1881 | $va = true; |
| 1474 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1882 | + } else { |
|
| 1883 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1884 | + } |
|
| 1475 | 1885 | if ($globalvatsim == 'vatsim') { |
| 1476 | 1886 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
| 1477 | 1887 | $va = true; |
| 1478 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1888 | + } else { |
|
| 1889 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1890 | + } |
|
| 1479 | 1891 | if ($globalphpvms == 'phpvms') { |
| 1480 | 1892 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
| 1481 | 1893 | $va = true; |
| 1482 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1894 | + } else { |
|
| 1895 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1896 | + } |
|
| 1483 | 1897 | if ($globalvam == 'vam') { |
| 1484 | 1898 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
| 1485 | 1899 | $va = true; |
| 1486 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1900 | + } else { |
|
| 1901 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1902 | + } |
|
| 1487 | 1903 | if ($va) { |
| 1488 | 1904 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
| 1489 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1905 | + } else { |
|
| 1906 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1907 | + } |
|
| 1490 | 1908 | if ($globalva == 'va' || $va) { |
| 1491 | 1909 | $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
| 1492 | 1910 | $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
| 1493 | 1911 | } else { |
| 1494 | 1912 | $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
| 1495 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1496 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
| 1913 | + if ($forcepilots) { |
|
| 1914 | + $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1915 | + } else { |
|
| 1916 | + $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
| 1917 | + } |
|
| 1497 | 1918 | } |
| 1498 | 1919 | if ($globalvm == 'vm') { |
| 1499 | 1920 | $settings = array_merge($settings,array('globalVM' => 'TRUE')); |
@@ -1732,7 +2153,9 @@ discard block |
||
| 1732 | 2153 | $graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING); |
| 1733 | 2154 | $settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper)); |
| 1734 | 2155 | |
| 1735 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 2156 | + if (!isset($globalTransaction)) { |
|
| 2157 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 2158 | + } |
|
| 1736 | 2159 | |
| 1737 | 2160 | // Set some defaults values... |
| 1738 | 2161 | if (!isset($globalAircraftImageSources)) { |
@@ -1747,15 +2170,23 @@ discard block |
||
| 1747 | 2170 | |
| 1748 | 2171 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
| 1749 | 2172 | |
| 1750 | - if ($error == '') settings::modify_settings($settings); |
|
| 1751 | - if ($error == '') settings::comment_settings($settings_comment); |
|
| 2173 | + if ($error == '') { |
|
| 2174 | + settings::modify_settings($settings); |
|
| 2175 | + } |
|
| 2176 | + if ($error == '') { |
|
| 2177 | + settings::comment_settings($settings_comment); |
|
| 2178 | + } |
|
| 1752 | 2179 | if ($error != '') { |
| 1753 | 2180 | print '<div class="info column">'.$error.'</div>'; |
| 1754 | 2181 | require('../footer.php'); |
| 1755 | 2182 | exit; |
| 1756 | 2183 | } else { |
| 1757 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
| 1758 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
| 2184 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
| 2185 | + $_SESSION['waypoints'] = 1; |
|
| 2186 | + } |
|
| 2187 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
| 2188 | + $_SESSION['owner'] = 1; |
|
| 2189 | + } |
|
| 1759 | 2190 | if (isset($_POST['createdb'])) { |
| 1760 | 2191 | $_SESSION['install'] = 'database_create'; |
| 1761 | 2192 | } else { |
@@ -1792,10 +2223,18 @@ discard block |
||
| 1792 | 2223 | $popw = false; |
| 1793 | 2224 | foreach ($_SESSION['done'] as $done) { |
| 1794 | 2225 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
| 1795 | - if ($done == 'Create database') $pop = true; |
|
| 1796 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
| 1797 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
| 1798 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
| 2226 | + if ($done == 'Create database') { |
|
| 2227 | + $pop = true; |
|
| 2228 | + } |
|
| 2229 | + if ($_SESSION['install'] == 'database_create') { |
|
| 2230 | + $pop = true; |
|
| 2231 | + } |
|
| 2232 | + if ($_SESSION['install'] == 'database_import') { |
|
| 2233 | + $popi = true; |
|
| 2234 | + } |
|
| 2235 | + if ($_SESSION['install'] == 'waypoints') { |
|
| 2236 | + $popw = true; |
|
| 2237 | + } |
|
| 1799 | 2238 | } |
| 1800 | 2239 | if ($pop) { |
| 1801 | 2240 | sleep(5); |
@@ -1806,7 +2245,9 @@ discard block |
||
| 1806 | 2245 | } else if ($popw) { |
| 1807 | 2246 | sleep(5); |
| 1808 | 2247 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
| 1809 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 2248 | + } else { |
|
| 2249 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 2250 | + } |
|
| 1810 | 2251 | print '</div></ul>'; |
| 1811 | 2252 | print '<div id="error"></div>'; |
| 1812 | 2253 | /* foreach ($_SESSION['done'] as $done) { |