page_structure.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. function render_page_header($page_title) {
  3. global $settings; ?>
  4. <!DOCTYPE html>
  5. <html class="<?= $settings['theme'] ?>">
  6. <head>
  7. <title><?= htmlspecialchars($page_title) ?> - <?= PROJECT_NAME ?></title>
  8. <meta charset="utf-8">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <meta http-equiv="Content-Security-Policy" content="default-src 'self';" />
  11. <link href="<?= BASE_URL ?>/main.css" rel="stylesheet">
  12. </head>
  13. <body>
  14. <nav>
  15. <div class="container">
  16. <div class="title">
  17. <a href="<?= BASE_URL ?>/"><?= PROJECT_NAME ?></a>
  18. </div>
  19. <form class="search-bar" action="<?= BASE_URL ?>/tags/" method="post">
  20. <input type="text" name="q" placeholder="<?= get_string('search.placeholder') ?>" required>
  21. </form>
  22. <div>
  23. <a href="<?= BASE_URL ?>/settings/"><?= get_string('settings.title') ?></a>
  24. </div>
  25. </div>
  26. </nav>
  27. <main><?php
  28. }
  29. function render_page_footer() { ?>
  30. </main>
  31. <footer>
  32. <div class="container">
  33. <div><?= sprintf('%s v%s', PROJECT_NAME, PROJECT_VERSION) ?></div>
  34. <div><a target="_blank" href="<?= PROJECT_URL ?>"><?= get_string('source-code') ?></a></div>
  35. <div><a target="_blank" href="<?= BASE_URL ?>/LICENSE"><?= get_string('license') ?></a></div>
  36. </div>
  37. </footer>
  38. </body>
  39. </html><?php
  40. }