1010use PhpMyAdmin \ConfigStorage \Relation ;
1111use PhpMyAdmin \Html \Generator ;
1212use PhpMyAdmin \Navigation \Navigation ;
13- use PhpMyAdmin \Theme \Theme ;
13+ use PhpMyAdmin \Theme \ThemeManager ;
1414
1515use function array_merge ;
1616use function defined ;
@@ -255,8 +255,6 @@ public function disableWarnings(): void
255255 */
256256 public function getDisplay (): string
257257 {
258- $ GLOBALS ['theme ' ] ??= null ;
259-
260258 if ($ this ->headerIsSent || ! $ this ->isEnabled ) {
261259 return '' ;
262260 }
@@ -273,10 +271,11 @@ public function getDisplay(): string
273271 $ this ->sendHttpHeaders ();
274272
275273 $ baseDir = defined ('PMA_PATH_TO_BASEDIR ' ) ? PMA_PATH_TO_BASEDIR : '' ;
276- $ themePath = $ GLOBALS ['theme ' ] instanceof Theme ? $ GLOBALS ['theme ' ]->getPath () : '' ;
277- $ themeColorMode = $ GLOBALS ['theme ' ] instanceof Theme ? $ GLOBALS ['theme ' ]->getColorMode () : 'light ' ;
278- $ themeColorModes = $ GLOBALS ['theme ' ] instanceof Theme ? $ GLOBALS ['theme ' ]->getColorModes () : [];
279- $ themeId = $ GLOBALS ['theme ' ] instanceof Theme ? $ GLOBALS ['theme ' ]->getId () : '' ;
274+
275+ /** @var ThemeManager $themeManager */
276+ $ themeManager = Core::getContainerBuilder ()->get (ThemeManager::class);
277+ $ theme = $ themeManager ->theme ;
278+
280279 $ version = self ::getVersionParameter ();
281280
282281 // The user preferences have been merged at this point
@@ -349,7 +348,7 @@ public function getDisplay(): string
349348 'lang ' => $ GLOBALS ['lang ' ],
350349 'allow_third_party_framing ' => $ config ->settings ['AllowThirdPartyFraming ' ],
351350 'base_dir ' => $ baseDir ,
352- 'theme_path ' => $ themePath ,
351+ 'theme_path ' => $ theme -> getPath () ,
353352 'version ' => $ version ,
354353 'text_dir ' => $ GLOBALS ['text_dir ' ],
355354 'server ' => $ GLOBALS ['server ' ] ?? null ,
@@ -367,9 +366,9 @@ public function getDisplay(): string
367366 'console ' => $ console ,
368367 'messages ' => $ messages ,
369368 'recent_table ' => $ recentTable ,
370- 'theme_color_mode ' => $ themeColorMode ,
371- 'theme_color_modes ' => $ themeColorModes ,
372- 'theme_id ' => $ themeId ,
369+ 'theme_color_mode ' => $ theme -> getColorMode () ,
370+ 'theme_color_modes ' => $ theme -> getColorModes () ,
371+ 'theme_id ' => $ theme -> getId () ,
373372 ]);
374373 }
375374
0 commit comments