aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/TemplateLayout.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/TemplateLayout.php')
-rw-r--r--lib/private/TemplateLayout.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index b109d023ca3..cfc387d2164 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -80,12 +80,6 @@ class TemplateLayout {
} else {
Util::addScript('core', 'unified-search', 'core');
}
- // Set body data-theme
- $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());
- }
// Set logo link target
$logoUrl = $this->config->getSystemValueString('logo_url', '');
@@ -149,6 +143,7 @@ class TemplateLayout {
if ($user) {
$userDisplayName = $user->getDisplayName();
}
+
$page->assign('user_displayname', $userDisplayName);
$page->assign('user_uid', \OC_User::getUser());
break;
@@ -157,13 +152,6 @@ class TemplateLayout {
$page->assign('appid', $appId);
$page->assign('bodyid', 'body-public');
- // Set body data-theme
- $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());
- }
-
// Set logo link target
$logoUrl = $this->config->getSystemValueString('logo_url', '');
$page->assign('logoUrl', $logoUrl);
@@ -203,9 +191,17 @@ class TemplateLayout {
$page->assign('locale', $locale);
$page->assign('direction', $direction);
+ // Set body data-theme
+ try {
+ $themesService = Server::get(\OCA\Theming\Service\ThemesService::class);
+ } catch (\Exception) {
+ $themesService = null;
+ }
+ $page->assign('enabledThemes', $themesService?->getEnabledThemes() ?? []);
+
if ($this->config->getSystemValueBool('installed', false)) {
if (empty(self::$versionHash)) {
- $v = $this->appManager->getAppInstalledVersions();
+ $v = $this->appManager->getAppInstalledVersions(true);
$v['core'] = implode('.', $this->serverVersion->getVersion());
self::$versionHash = substr(md5(implode(',', $v)), 0, 8);
}