diff --git a/front/js/common.js b/front/js/common.js index 41eb0bfa..a2372270 100755 --- a/front/js/common.js +++ b/front/js/common.js @@ -1135,6 +1135,25 @@ function arraysContainSameValues(arr1, arr2) { } } + +// ----------------------------------------------------------------------------- +// apply dark mode + +$(document).ready(function() { + // Assume getSetting is a function that returns true or false for dark mode + if (getSetting("UI_dark_mode") === "True") { + // Add the dark mode stylesheet + setCookie("UI_dark_mode", "True") + $('head').append(''); + // Set the background image for dark mode + $('body').attr('style', 'background-image: url(\'img/boxed-bg-dark.png\');'); + } else { + setCookie("UI_dark_mode", "False") + // Set the background image for light mode + $('body').attr('style', 'background-image: url(\'img/background.png\');'); + } +}); + // ----------------------------------------------------------------------------- // initialize // ----------------------------------------------------------------------------- diff --git a/front/maintenance.php b/front/maintenance.php index 936969ac..cc3cf8cd 100755 --- a/front/maintenance.php +++ b/front/maintenance.php @@ -11,25 +11,7 @@ # cvc90 2023 https://github.com/cvc90 GNU GPLv3 # #---------------------------------------------------------------------------------# -// Skin selector config ---------------------------------------------------- -// -// For security reasons, new language files must be entered into this array. -// The files in the language directory are compared with this array and only -// then accepted. -// -$pia_installed_skins = array('skin-black-light', - 'skin-black', - 'skin-blue-light', - 'skin-blue', - 'skin-green-light', - 'skin-green', - 'skin-purple-light', - 'skin-purple', - 'skin-red-light', - 'skin-red', - 'skin-yellow-light', - 'skin-yellow'); - + //------------------------------------------------------------------------------ ?> @@ -91,34 +73,6 @@ if (count($latestfiles) > 0) $latestbackup_date = date ("Y-m-d H:i:s", filemtime($latestbackup)); } - -// Skin selector ----------------------------------------------------------------- - -if (isset($_POST['submit']) && submit && isset($_POST['skinselector_set'])) { - $pia_skin_set_dir = '../db/'; - $pia_skin_selector = htmlspecialchars($_POST['skinselector']); - if (in_array($pia_skin_selector, $pia_installed_skins)) { - foreach ($pia_installed_skins as $file) { - unlink ($pia_skin_set_dir.'/setting_'.$file); - } - foreach ($pia_installed_skins as $file) { - if (file_exists($pia_skin_set_dir.'/setting_'.$file)) { - $pia_skin_error = True; - break; - } else { - $pia_skin_error = False; - } - } - if ($pia_skin_error == False) { - $testskin = fopen($pia_skin_set_dir.'setting_'.$pia_skin_selector, 'w'); - $pia_skin_test = ''; - echo(""); - } else { - $pia_skin_test = ''; - echo(""); - } - } -} // Table sizes ----------------------------------------------------------------- $tableSizesHTML = ""; @@ -215,13 +169,7 @@ $db->close();