@@ -112,13 +112,6 @@ public function __construct($renderAs, $appId = '') {
112112 } else {
113113 Util::addScript ('core ' , 'unified-search ' , 'core ' );
114114 }
115- // Set body data-theme
116- $ this ->assign ('enabledThemes ' , []);
117- if ($ this ->appManager ->isEnabledForUser ('theming ' ) && class_exists ('\OCA\Theming\Service\ThemesService ' )) {
118- /** @var \OCA\Theming\Service\ThemesService */
119- $ themesService = \OC ::$ server ->get (\OCA \Theming \Service \ThemesService::class);
120- $ this ->assign ('enabledThemes ' , $ themesService ->getEnabledThemes ());
121- }
122115
123116 // Set logo link target
124117 $ logoUrl = $ this ->config ->getSystemValueString ('logo_url ' , '' );
@@ -183,23 +176,13 @@ public function __construct($renderAs, $appId = '') {
183176 if ($ user ) {
184177 $ userDisplayName = $ user ->getDisplayName ();
185178 }
186- $ theme = $ this ->config ->getSystemValueString ('enforce_theme ' , '' );
187- $ this ->assign ('enabledThemes ' , $ theme === '' ? [] : [$ theme ]);
188179 $ this ->assign ('user_displayname ' , $ userDisplayName );
189180 $ this ->assign ('user_uid ' , \OC_User::getUser ());
190181 } elseif ($ renderAs === TemplateResponse::RENDER_AS_PUBLIC ) {
191182 parent ::__construct ('core ' , 'layout.public ' );
192183 $ this ->assign ('appid ' , $ appId );
193184 $ this ->assign ('bodyid ' , 'body-public ' );
194185
195- // Set body data-theme
196- $ this ->assign ('enabledThemes ' , []);
197- if ($ this ->appManager ->isEnabledForUser ('theming ' ) && class_exists ('\OCA\Theming\Service\ThemesService ' )) {
198- /** @var \OCA\Theming\Service\ThemesService $themesService */
199- $ themesService = \OC ::$ server ->get (\OCA \Theming \Service \ThemesService::class);
200- $ this ->assign ('enabledThemes ' , $ themesService ->getEnabledThemes ());
201- }
202-
203186 // Set logo link target
204187 $ logoUrl = $ this ->config ->getSystemValueString ('logo_url ' , '' );
205188 $ this ->assign ('logoUrl ' , $ logoUrl );
@@ -227,9 +210,14 @@ public function __construct($renderAs, $appId = '') {
227210 } else {
228211 parent ::__construct ('core ' , 'layout.base ' );
229212 }
230- // Send the language and the locale to our layouts
231- $ lang = \OC ::$ server ->getL10NFactory ()->findLanguage ();
232- $ locale = \OC ::$ server ->getL10NFactory ()->findLocale ($ lang );
213+
214+ // Set body data-theme
215+ $ themesService = \OCP \Server::get (\OCA \Theming \Service \ThemesService::class);
216+ $ this ->assign ('enabledThemes ' , $ themesService ->getEnabledThemes ());
217+
218+ // Send the language, locale, and direction to our layouts
219+ $ lang = \OC ::$ server ->get (IFactory::class)->findLanguage ();
220+ $ locale = \OC ::$ server ->get (IFactory::class)->findLocale ($ lang );
233221
234222 $ lang = str_replace ('_ ' , '- ' , $ lang );
235223 $ this ->assign ('language ' , $ lang );
0 commit comments