Beta Support for Dark Mode has been added to the theme options

This commit is contained in:
johnnyq
2025-07-24 14:58:06 -04:00
parent 4d71eb5de0
commit e014e516e6
7 changed files with 27 additions and 6 deletions

View File

@@ -6,12 +6,14 @@ if (isset($_POST['edit_theme_settings'])) {
validateCSRFToken($_POST['csrf_token']);
$dark_mode = intval($_POST['dark_mode'] ?? 0);
$theme = preg_replace("/[^0-9a-zA-Z-]/", "", sanitizeInput($_POST['edit_theme_settings']));
mysqli_query($mysqli,"UPDATE settings SET config_theme = '$theme' WHERE company_id = 1");
mysqli_query($mysqli,"UPDATE settings SET config_theme = '$theme', config_theme_dark = $dark_mode WHERE company_id = 1");
// Logging
logAction("Settings", "Edit", "$session_name edited theme settings");
logAction("Settings", "Edit", "$session_name edited theme settings $dark_mode");
$_SESSION['alert_message'] = "Changed theme to <strong>$theme</strong>";