From e79ec21fc8c03262ca4e16b68c08705495b7d2e5 Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Mon, 16 Sep 2024 23:13:07 +0200 Subject: Theme stuff --- src/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/index.php') diff --git a/src/index.php b/src/index.php index fac57a5..1807608 100644 --- a/src/index.php +++ b/src/index.php @@ -1115,6 +1115,14 @@ if ($_action === "auth") { } elseif ($_action === "ji18n") { header("Content-Type: application/javascript; charset=UTF-8"); echo 'var I18N_MESSAGES = ' . json_encode(i18n_get_message_store(i18n_get_current_locale()), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ";\n"; +} elseif ($_action === "debug/list-themes") { + header("Content-Type: text/plain"); + foreach (scandir($dir = __DIR__ . '/themes/') as $ent) { + if ($ent[0] === "." || !is_dir($dir . "/" . $ent) || !is_file($theme_file = $dir . "/" . $ent . "/theme.json")) + continue; + $theme_info = json_decode(file_get_contents($theme_file)); + echo $ent . "\t" . $theme_info->name . "\n"; + } } elseif ($_action === "ctheme") { // options $enableLogging = true; -- cgit v1.2.3