[BS5] remove ui theme selector - add darkmode toggler

This commit is contained in:
FreddleSpl0it
2022-06-23 16:34:58 +02:00
parent 560df58bb4
commit 052959f435
38 changed files with 233 additions and 286379 deletions

View File

@@ -117,20 +117,6 @@ function customize($_action, $_item, $_data = null) {
$ui_announcement_type = (in_array($_data['ui_announcement_type'], array('info', 'warning', 'danger'))) ? $_data['ui_announcement_type'] : false;
$ui_announcement_active = (!empty($_data['ui_announcement_active']) ? 1 : 0);
// check theme
$theme = strtolower($_data['ui_theme']);
$themes = array_diff(scandir('/web/css/themes'), array('..', '.'));
$themes = array_filter((str_replace("-bootstrap.css", "", $themes)));
if (!in_array($theme, $themes)){
// err, theme not found
$_SESSION['return'][] = array(
'type' => 'danger',
'log' => array(__FUNCTION__, $_action, $_item, $_data),
'msg' => "Theme not found"
);
return false;
}
try {
$redis->set('TITLE_NAME', htmlspecialchars($title_name));
$redis->set('MAIN_NAME', htmlspecialchars($main_name));
@@ -140,7 +126,6 @@ function customize($_action, $_item, $_data = null) {
$redis->set('UI_ANNOUNCEMENT_TEXT', $ui_announcement_text);
$redis->set('UI_ANNOUNCEMENT_TYPE', $ui_announcement_type);
$redis->set('UI_ANNOUNCEMENT_ACTIVE', $ui_announcement_active);
$redis->set('UI_THEME', $theme);
}
catch (RedisException $e) {
$_SESSION['return'][] = array(
@@ -244,19 +229,6 @@ function customize($_action, $_item, $_data = null) {
return false;
}
break;
case 'ui_theme':
try {
return $redis->get('UI_THEME');
}
catch (RedisException $e) {
$_SESSION['return'][] = array(
'type' => 'danger',
'log' => array(__FUNCTION__, $_action, $_item, $_data),
'msg' => array('redis_error', $e)
);
return false;
}
break;
case 'main_logo_specs':
try {
$image = new Imagick();