From c18e0a722597ddc84fb4e6665e058a84f777ced2 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 11 Jan 2021 00:28:22 +0900 Subject: [PATCH] =?UTF-8?q?\#1558=20=EB=B3=B4=EC=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 설정값 명칭을 기존에 사용하던 쿠키값과 동일하게 auto, light, dark로 통일하여 혼동을 방지합니다. - 지나치게 긴 설명문보다는 옵션 명칭 자체가 충분히 의미를 전달할 수 있도록 합니다. - 설명문을 길게 써야 할 경우 매뉴얼에 넣어 주세요. - 설정을 변경하지 않고 저장할 경우, 자동 감지를 기본값으로 합니다. --- classes/module/ModuleHandler.class.php | 10 ++-------- modules/admin/admin.admin.controller.php | 4 ++-- modules/admin/admin.admin.view.php | 9 +-------- modules/admin/lang/en.php | 10 +++++----- modules/admin/lang/ko.php | 10 +++++----- 5 files changed, 15 insertions(+), 28 deletions(-) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 561b2dada..09cce63bc 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -761,14 +761,9 @@ class ModuleHandler extends Handler */ protected function _setModuleColorScheme($site_module_info) { - $color_scheme = null; - - $color_scheme_array = array('off_light'=>'light', 'off_dark' => 'dark'); - if (isset($color_scheme_array[$site_module_info->settings->color_scheme])) + if (isset($site_module_info->settings->color_scheme) && $site_module_info->settings->color_scheme !== 'auto') { - Rhymix\Framework\UA::setColorScheme('auto'); - $color_scheme = $color_scheme_array[$site_module_info->settings->color_scheme]; - Context::addBodyClass('color_scheme_' . $color_scheme); + Context::addBodyClass('color_scheme_' . $site_module_info->settings->color_scheme); } elseif (($color_scheme = Rhymix\Framework\UA::getColorScheme()) !== 'auto') { @@ -776,7 +771,6 @@ class ModuleHandler extends Handler } } - /** * Set SEO information to Context. * diff --git a/modules/admin/admin.admin.controller.php b/modules/admin/admin.admin.controller.php index 46703d689..de838b958 100644 --- a/modules/admin/admin.admin.controller.php +++ b/modules/admin/admin.admin.controller.php @@ -1114,10 +1114,10 @@ class adminAdminController extends admin $vars->html_footer = utf8_trim($vars->html_footer); // Validate the color scheme setting. - $valid_color_scheme_options = array('off_light', 'off_dark', 'auto_light_dark'); + $valid_color_scheme_options = array('auto', 'light', 'dark'); if (!in_array($vars->color_scheme, $valid_color_scheme_options)) { - $vars->color_scheme = 'off_light'; + $vars->color_scheme = 'auto'; } // Merge all settings into an array. diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index f3badaf82..273c76019 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -743,14 +743,7 @@ class adminAdminView extends admin Context::set('favicon_url', $oAdminAdminModel->getFaviconUrl($domain_info->domain_srl)); Context::set('mobicon_url', $oAdminAdminModel->getMobileIconUrl($domain_info->domain_srl)); Context::set('default_image_url', $oAdminAdminModel->getSiteDefaultImageUrl($domain_info->domain_srl)); - - // Get color scheme setting. - $valid_color_scheme_options = array('off_light', 'off_dark', 'auto_light_dark'); - if (!in_array($domain_info->settings->color_scheme, $valid_color_scheme_options)) - { - $domain_info->settings->color_scheme = 'off_light'; - } - Context::set('color_scheme', $domain_info->settings->color_scheme); + Context::set('color_scheme', $domain_info->settings->color_scheme ?? 'auto'); } $this->setTemplateFile('config_domains_edit'); diff --git a/modules/admin/lang/en.php b/modules/admin/lang/en.php index 99e3ba8be..545af3f3f 100644 --- a/modules/admin/lang/en.php +++ b/modules/admin/lang/en.php @@ -300,12 +300,12 @@ $lang->detail_use_mobile_icon = 'The mobile icon should be 57x57 or 114x114, onl $lang->cmd_site_default_image = 'Default Image'; $lang->about_site_default_image = 'This image will be shown when your site is linked to in various social networks. It should be 200x200, either jpg or png format.'; $lang->cmd_site_default_color_scheme = 'Color scheme'; -$lang->about_site_default_color_scheme = 'You can enable dark mode. The module skins, layouts, etc. that you use should be supported. For the developers, the standard can be refer to this page.
Disable (default)
Turn off the dark mode function.
Dark mode (fixed)
Enable the dark mode, but fixed to the dark theme.
Automatic (refer to the client browser settings)
Enable the dark mode, and the clients can switch on or off the dark theme refer to the brower settings or the cookies. The cookies can be modified.
'; +$lang->about_site_default_color_scheme = 'Control how your site responds to dark mode settings in user devices.'; $lang->site_default_color_scheme_options = array( - 'off_light' => 'Disable (default)', - 'off_dark' => 'Dark mode (fixed)', - 'auto_light_dark' => 'Automatic (refer to the client settings)', - ); + 'auto' => 'Automatic detection', + 'light' => 'Light mode only', + 'dark' => 'Dark mode only', +); $lang->use_sso = 'Use SSO?'; $lang->about_use_sso = 'Logging into one domain will automatically log the user into all domains.'; $lang->about_arrange_session = 'Do you want to clean up session?'; diff --git a/modules/admin/lang/ko.php b/modules/admin/lang/ko.php index 9be7a9ba6..3c6d33136 100644 --- a/modules/admin/lang/ko.php +++ b/modules/admin/lang/ko.php @@ -296,12 +296,12 @@ $lang->detail_use_mobile_icon = '57x57 또는 114x114 크기의 png 파일을 $lang->cmd_site_default_image = '사이트 대표 이미지'; $lang->about_site_default_image = 'SNS 등에 이 사이트가 링크되었을 때 표시되는 이미지입니다. 200x200 크기의 jpg 또는 png 파일을 권장합니다.'; $lang->cmd_site_default_color_scheme = '사이트 색상 조합'; -$lang->about_site_default_color_scheme = '다크모드를 사용하도록 설정할 수 있습니다. 사용하는 모듈 스킨, 레이아웃 등이 지원해야 합니다. 표준은 여기를 참고하세요.
사용 안 함 (기본)
다크모드 설정을 사용하지 않습니다.
어두운 색상 (고정)
항상 다크모드의 어두운 색상을 표시합니다.
자동 (접속자의 브라우저 설정)
사이트 접속자의 운영체제 또는 브라우저 설정 또는 쿠키의 설정을 따릅니다. 쿠키는 자동, 밝음, 어두움 세 가지 선택지를 가집니다.
'; +$lang->about_site_default_color_scheme = '사용자 기기가 다크 모드로 지정된 경우 어떻게 반응할지 선택합니다.'; $lang->site_default_color_scheme_options = array( - 'off_light' => '사용 안 함 (기본)', - 'off_dark' => '어두운 색상 (고정)', - 'auto_light_dark' => '자동 (접속자의 설정)', - ); + 'auto' => '기기 상태 자동 감지', + 'light' => '밝은 색상 고정', + 'dark' => '어두운 색상 고정', +); $lang->use_sso = 'SSO 사용'; $lang->about_use_sso = '한 번만 로그인하면 모든 도메인에 로그인되도록 합니다.'; $lang->about_arrange_session = '세션을 정리하시겠습니까?';