diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-04-07 09:07:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-07 09:07:45 +0200 |
commit | d8ff05649194d55861d5706e88da56aca4bc62ff (patch) | |
tree | 5f21d22f42305510d493928575affac53e8d4ee7 | |
parent | 554dfbbdda8bbaff1901c1bee850fd035622ed65 (diff) | |
parent | 088e5e6e7b2ab66490073fe66f7adb2aa6a642fe (diff) | |
download | nextcloud-server-d8ff05649194d55861d5706e88da56aca4bc62ff.tar.gz nextcloud-server-d8ff05649194d55861d5706e88da56aca4bc62ff.zip |
Merge pull request #51752 from nextcloud/backport/50121/master
fix(theming): enforce theme also for login
-rw-r--r-- | core/templates/layout.guest.php | 4 | ||||
-rw-r--r-- | lib/private/TemplateLayout.php | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 64bec6de9be..0723e90173b 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -35,7 +35,9 @@ p($theme->getTitle()); <?php emit_script_loading_tags($_); ?> <?php print_unescaped($_['headers']); ?> </head> - <body id="<?php p($_['bodyid']);?>"> + <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) { + p("data-theme-$themeId "); + }?> data-themes="<?php p(join(',', $_['enabledThemes'])) ?>"> <?php include 'layout.noscript.warning.php'; ?> <?php include 'layout.initial-state.php'; ?> <div class="wrapper"> diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index b109d023ca3..2fc1f1a3791 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -149,6 +149,13 @@ class TemplateLayout { if ($user) { $userDisplayName = $user->getDisplayName(); } + + $page->assign('enabledThemes', []); + if ($this->appManager->isEnabledForUser('theming') && class_exists('\OCA\Theming\Service\ThemesService')) { + $themesService = Server::get(\OCA\Theming\Service\ThemesService::class); + $page->assign('enabledThemes', $themesService->getEnabledThemes()); + } + $page->assign('user_displayname', $userDisplayName); $page->assign('user_uid', \OC_User::getUser()); break; |