fix(theming): enforce theme also for login

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/51752/head
Ferdinand Thiessen 1 year ago
parent 09e200dde4
commit 088e5e6e7b
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400
  1. 4
      core/templates/layout.guest.php
  2. 7
      lib/private/TemplateLayout.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">

@ -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;

Loading…
Cancel
Save