BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

publicheader.php 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. declare(strict_types=1);
  3. $ENV = ENV::go();
  4. global $LoggedUser;
  5. echo <<<HTML
  6. <!doctype html>
  7. <html>
  8. <head>
  9. <title>$PageTitle</title>
  10. HTML;
  11. echo View::commonMeta();
  12. echo "<link href='$ENV->STATIC_SERVER/styles/public.css?v="
  13. . filemtime(SERVER_ROOT.'/static/styles/public.css')
  14. . "' rel='stylesheet' type='text/css'>";
  15. # Load JS
  16. $Scripts = array_filter(
  17. array_merge(
  18. [
  19. 'vendor/jquery.min',
  20. 'global',
  21. 'ajax.class',
  22. 'cookie.class',
  23. 'storage.class',
  24. 'public',
  25. 'u2f'
  26. ],
  27. explode(',', $JSIncludes)
  28. )
  29. );
  30. foreach ($Scripts as $Script) {
  31. View::pushAsset(
  32. "$ENV->STATIC_SERVER/functions/$Script.js",
  33. 'script'
  34. );
  35. }
  36. # Load CSS
  37. $Styles = ['vendor/normalize', 'global', 'public'];
  38. foreach ($Styles as $Style) {
  39. echo View::pushAsset(
  40. "$ENV->STATIC_SERVER/styles/$Style.css",
  41. 'style'
  42. );
  43. }
  44. # Fonts
  45. echo View::pushAsset(
  46. # Only Noto Sans available on public pages
  47. "$ENV->STATIC_SERVER/styles/assets/fonts/noto/woff2/NotoSans-SemiCondensed.woff2",
  48. 'font'
  49. );
  50. echo <<<HTML
  51. </head>
  52. <body>
  53. <header>
  54. <a href="login.php">Log In</a>
  55. HTML;
  56. if ($ENV->OPEN_REGISTRATION) {
  57. echo '<a href="register.php">Register</a>';
  58. }
  59. $Email = $ENV->HELP->Email;
  60. $Subject = $ENV->HELP->Subject;
  61. $Body = $ENV->HELP->Body;
  62. echo "<a href='mailto:$Email?subject=$Subject&body=$Body'>Support</a>";
  63. echo <<<HTML
  64. </header>
  65. <main>
  66. <h1 id="logo">
  67. <a href="/" aria-label="Front page"></a>
  68. </h1>
  69. HTML;