mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
관리자가 모든 모듈의 다크모드 설정을 제어하도록 합니다. (#1558)
* 관리자가 다크모드 작동 여부를 선택할 수 있도록 수정
This commit is contained in:
parent
b7856e5683
commit
899fe00dda
9 changed files with 75 additions and 9 deletions
|
|
@ -223,6 +223,7 @@ class ModuleHandler extends Handler
|
|||
$this->mid = $module_info->mid;
|
||||
$this->module_info = $module_info;
|
||||
$this->_setModuleSEOInfo($module_info, $site_module_info);
|
||||
$this->_setModuleColorScheme($site_module_info);
|
||||
|
||||
// Check if the current request is from a mobile device.
|
||||
$this->is_mobile = Mobile::isFromMobilePhone();
|
||||
|
|
@ -753,6 +754,29 @@ class ModuleHandler extends Handler
|
|||
return $module_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set color scheme.
|
||||
*
|
||||
* @param object $site_module_info
|
||||
*/
|
||||
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]))
|
||||
{
|
||||
Rhymix\Framework\UA::setColorScheme('auto');
|
||||
$color_scheme = $color_scheme_array[$site_module_info->settings->color_scheme];
|
||||
Context::addBodyClass('color_scheme_' . $color_scheme);
|
||||
}
|
||||
elseif (($color_scheme = Rhymix\Framework\UA::getColorScheme()) !== 'auto')
|
||||
{
|
||||
Context::addBodyClass('color_scheme_' . $color_scheme);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set SEO information to Context.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue