refactor: unify theme HTML class handling across multiple files for consistency

This commit is contained in:
Zack Spear
2025-04-07 15:11:59 -07:00
parent e131c2f0c7
commit ffdf4c0293
4 changed files with 4 additions and 6 deletions

View File

@@ -243,7 +243,7 @@ $isDarkTheme = $themeHelper->isDarkTheme();
?>
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="<?= $themeHelper->getThemeHtmlClass() ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

View File

@@ -45,7 +45,7 @@ $themeHelper = new ThemeHelper($display['theme']);
$isDarkTheme = $themeHelper->isDarkTheme();
?>
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="<?= $themeHelper->getThemeHtmlClass() ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

View File

@@ -27,10 +27,9 @@ $var = parse_ini_file("/var/local/emhttp/var.ini");
require_once "$docroot/plugins/dynamix/include/ThemeHelper.php";
$themeHelper = new ThemeHelper($display['theme']);
$themeName = $themeHelper->getThemeName();
$themeHtmlClass = $themeHelper->getThemeHtmlClass();
?>
<!DOCTYPE HTML>
<html <?=$display['rtl']?>lang="<?=strtok($locale,'_')?:'en'?>" class="<?= $themeHtmlClass ?>">
<html <?=$display['rtl']?>lang="<?=strtok($locale,'_')?:'en'?>" class="<?= $themeHelper->getThemeHtmlClass() ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

View File

@@ -16,7 +16,6 @@ $themeHelper = new ThemeHelper($display['theme'], $display['width']);
$theme = $themeHelper->getThemeName(); // keep $theme, $themes1, $themes2 vars for plugin backwards compatibility for the time being
$themes1 = $themeHelper->isTopNavTheme();
$themes2 = $themeHelper->isSidebarTheme();
$themeHtmlClass = $themeHelper->getThemeHtmlClass();
$themeHelper->updateDockerLogColor($docroot);
$display['font'] = filter_var($_COOKIE['fontSize'] ?? $display['font'] ?? '',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
@@ -43,7 +42,7 @@ $buttonPages = find_pages('Buttons');
function annotate($text) {echo "\n<!--\n",str_repeat("#",strlen($text)),"\n$text\n",str_repeat("#",strlen($text)),"\n-->\n";}
?>
<!DOCTYPE html>
<html <?=$display['rtl']?>lang="<?=strtok($locale,'_')?:'en'?>" class="<?= $themeHtmlClass ?>">
<html <?=$display['rtl']?>lang="<?=strtok($locale,'_')?:'en'?>" class="<?= $themeHelper->getThemeHtmlClass() ?>">
<head>
<title><?=_var($var,'NAME')?>/<?=_var($myPage,'name')?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">