From 8d83bd10c4a14cff49c9dc6335638a52875a7c50 Mon Sep 17 00:00:00 2001 From: Sonny Le Date: Fri, 31 May 2024 14:41:26 +0700 Subject: [PATCH] Add feature define Color Mode from client --- framework/library/astroid/Template.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/library/astroid/Template.php b/framework/library/astroid/Template.php index a4c651f3..f2255da2 100644 --- a/framework/library/astroid/Template.php +++ b/framework/library/astroid/Template.php @@ -361,7 +361,9 @@ public function getColorMode() { $color_mode_theme = ''; if ($plg_color_mode && $color_mode) { - $color_mode_theme = Factory::getApplication()->input->cookie->get('astroid-color-mode-'.md5($this->template), $color_mode_default); + $app = Factory::getApplication(); + $client_color = $app->input->get('color_mode', '', 'ALNUM'); + $color_mode_theme = !empty($client_color) ? $client_color : $app->input->cookie->get('astroid-color-mode-'.md5($this->template), $color_mode_default); } return $color_mode_theme; }