From 6c675224dffcdf47025ae62a76e5fb4c1fe48ad7 Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Fri, 13 Sep 2024 13:49:34 -0300 Subject: [PATCH] Update --- objects/functions.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/objects/functions.php b/objects/functions.php index bd527ca731a1..b871da5c77ae 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -5135,6 +5135,36 @@ function getThemesSeparated() } +function isCurrentThemeDark() +{ + global $config; + $isDefaultThemeDark = $config->isDefaultThemeDark(); + if (empty($_COOKIE['themeMode'])) { + // it is default theme + if($isDefaultThemeDark){ + return true; + }else{ + return false; + } + } else { + // it is alrernative theme + if(!$isDefaultThemeDark){ + return true; + }else{ + return false; + } + } +} + +function getBodyClass() +{ + $bodyClass = 'lightTheme'; + if(isCurrentThemeDark()){ + $bodyClass = 'darkTheme'; + } + return $bodyClass; +} + function getCurrentTheme() { global $config;