Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(theming): enforce theme also for login
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Apr 2, 2025
commit 088e5e6e7b2ab66490073fe66f7adb2aa6a642fe
4 changes: 3 additions & 1 deletion core/templates/layout.guest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
<?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">
Expand Down
7 changes: 7 additions & 0 deletions lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ public function getPageTemplate(string $renderAs, string $appId): ITemplate {
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;
Expand Down
Loading