settings.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php require_once "../utilities/index.php" ?>
  2. <?php
  3. $title = "Settings";
  4. ?>
  5. <?php require_once "../elements/header.php" ?>
  6. <?php
  7. foreach ($_GET as $name => $value) {
  8. if (is_array($value))
  9. $value = json_encode($value);
  10. setcookie($name, $value);
  11. };
  12. if (count($_GET)) {
  13. header("Location: " . strtok($_SERVER["REQUEST_URI"], "?"));
  14. exit();
  15. };
  16. ?>
  17. <h1>Settings</h1>
  18. <form>
  19. <div>
  20. <p><b>Theme</b></p>
  21. <p>Whether to adapt to the system theme or always use a light or dark interface.</p>
  22. <p>
  23. <select name="theme">
  24. <?php
  25. foreach ([
  26. "system" => "System",
  27. "light" => "Light",
  28. "dark" => "Dark"
  29. ] as $name => $value) {
  30. echo "<option value=\"" . $name . "\"";
  31. if (isset($_COOKIE["theme"]) && $_COOKIE["theme"] === $name) echo " selected";
  32. echo ">" . $value . "</option>";
  33. };
  34. ?>
  35. </select>
  36. </p>
  37. </div>
  38. <div>
  39. <p><b>Design</b></p>
  40. <p>Whether to, if available, use artist-defined colors on artist and release pages.</p>
  41. <input name="design" type="hidden" value="off">
  42. <input id="design" name="design" type="checkbox" <?php if (isset($_COOKIE["design"]) && $_COOKIE["design"] === "on") echo "checked" ?>>
  43. <label for="design">Enabled</label>
  44. </div>
  45. <div>
  46. <p><b>Details</b></p>
  47. <p>Which of the collapsible details the release page is made up of to expand by default.</p>
  48. <p>
  49. <select name="details[]" multiple size="7">
  50. <?php
  51. foreach ([
  52. "tracklist" => "Tracklist",
  53. "videos" => "Videos",
  54. "lyrics" => "Lyrics",
  55. "credits" => "Credits",
  56. "license" => "License",
  57. "tags" => "Tags",
  58. "recommendations" => "Recommendations"
  59. ] as $name => $value) {
  60. echo "<option value=\"" . $name . "\"";
  61. if (
  62. (isset($_COOKIE["details"]) && in_array($name, json_decode($_COOKIE["details"]))) ||
  63. (!isset($_COOKIE["details"]) && $name === "tracklist")
  64. )
  65. echo " selected";
  66. echo ">" . $value . "</option>";
  67. };
  68. ?>
  69. </select>
  70. </p>
  71. </div>
  72. <div>
  73. <p><b>Images</b></p>
  74. <p>If disabled, speeds up loading and saves data by not loading any images.</p>
  75. <p>
  76. <select name="images">
  77. <?php
  78. foreach ([
  79. "system" => "System",
  80. "enabled" => "Enabled",
  81. "disabled" => "Disabled"
  82. ] as $name => $value) {
  83. echo "<option value=\"" . $name . "\"";
  84. if (isset($_COOKIE["images"]) && $_COOKIE["images"] === $name) echo " selected";
  85. echo ">" . $value . "</option>";
  86. };
  87. ?>
  88. </select>
  89. </p>
  90. </div>
  91. <div>
  92. <p><b>Overflow</b></p>
  93. <p>Whether to allow scrolling each column of the desktop layout independently.</p>
  94. <input name="overflow" type="hidden" value="off">
  95. <input id="overflow" name="overflow" type="checkbox" <?php if (isset($_COOKIE["overflow"]) && $_COOKIE["overflow"] === "on") echo "checked" ?>>
  96. <label for="overflow">Enabled</label>
  97. </div>
  98. <input type="submit" value="Save">
  99. </form>
  100. <?php require_once "../elements/footer.php" ?>