Skip to content

Commit 3bb09c0

Browse files
authored
Update admin.php
1 parent 95eb284 commit 3bb09c0

1 file changed

Lines changed: 20 additions & 24 deletions

File tree

admin.php

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,13 @@ function compute_end_time(array $e): ?int {
186186
</form>
187187
</div>
188188
<footer><?= $t['title'] . ' ' . $t['version'] . ' ' . $t['footer_text'] ?></footer>
189-
<!-- START: Invisible form not needed in the admin panel because of main.js-->
190-
<form id="uploadForm" style="display:none;" aria-hidden="true" novalidate>
191-
<input type="file" id="fileInput" style="display:none;">
192-
<div id="dropzone" style="display:none;"></div>
193-
<div id="selectedFile" style="display:none;"></div>
194-
</form>
195-
<!-- END: Invisible form not needed in the admin panel because of main.js-->
196-
<script src="js/main.js"></script>
189+
<script>
190+
function changeLang(lang) {
191+
const url = new URL(window.location);
192+
url.searchParams.set('lang', lang);
193+
window.location = url.toString();
194+
}
195+
</script>
197196
</body>
198197
</html>
199198
<?php exit;
@@ -252,14 +251,13 @@ function compute_end_time(array $e): ?int {
252251
</form>
253252
</div>
254253
<footer><?= $t['title'] . ' ' . $t['version'] . ' ' . $t['footer_text'] ?></footer>
255-
<!-- START: Invisible form not needed in the admin panel because of main.js-->
256-
<form id="uploadForm" style="display:none;" aria-hidden="true" novalidate>
257-
<input type="file" id="fileInput" style="display:none;">
258-
<div id="dropzone" style="display:none;"></div>
259-
<div id="selectedFile" style="display:none;"></div>
260-
</form>
261-
<!-- END: Invisible form not needed in the admin panel because of main.js-->
262-
<script src="js/main.js"></script>
254+
<script>
255+
function changeLang(lang) {
256+
const url = new URL(window.location);
257+
url.searchParams.set('lang', lang);
258+
window.location = url.toString();
259+
}
260+
</script>
263261
</body>
264262
</html>
265263
<?php exit;
@@ -521,15 +519,13 @@ function compute_end_time(array $e): ?int {
521519
</div>
522520
</div>
523521
<footer><?= $t['title'] . ' ' . $t['version'] . ' ' . $t['footer_text'] ?></footer>
524-
<!-- START: Invisible form not needed in the admin panel because of main.js-->
525-
<form id="uploadForm" style="display:none;" aria-hidden="true" novalidate>
526-
<input type="file" id="fileInput" style="display:none;">
527-
<div id="dropzone" style="display:none;"></div>
528-
<div id="selectedFile" style="display:none;"></div>
529-
</form>
530-
<!-- END: Invisible form not needed in the admin panel because of main.js-->
531-
<script src="js/main.js"></script>
532522
<script>
523+
function changeLang(lang) {
524+
const url = new URL(window.location);
525+
url.searchParams.set('lang', lang);
526+
window.location = url.toString();
527+
}
528+
533529
document.addEventListener("DOMContentLoaded", () => {
534530

535531
const TEXT_SHOW_UPLOADS = "<?= addslashes($t['show_uploads_button']) ?>";

0 commit comments

Comments
 (0)