diff --git a/libraries/classes/BrowseForeigners.php b/libraries/classes/BrowseForeigners.php
index 59d31ad7a7..7a96550292 100644
--- a/libraries/classes/BrowseForeigners.php
+++ b/libraries/classes/BrowseForeigners.php
@@ -69,7 +69,7 @@ class BrowseForeigners
int $indexByDescription,
string $currentValue
): array {
- global $PMA_Theme;
+ global $theme;
$horizontalCount++;
$output = '';
@@ -124,7 +124,7 @@ class BrowseForeigners
]);
$output .= '
 : '')
+ . ($theme instanceof Theme ? $theme->getImgPath('spacer.png') : '')
. ') | ';
$output .= $this->template->render('table/browse_foreigners/column_element', [
diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php
index 8ee06c8c17..cb9b8794bc 100644
--- a/libraries/classes/Config.php
+++ b/libraries/classes/Config.php
@@ -893,14 +893,14 @@ class Config
*/
public function getThemeUniqueValue(): int
{
- global $PMA_Theme;
+ global $theme;
return (int) (
$this->sourceMtime +
$this->defaultSourceMtime +
$this->get('user_preferences_mtime') +
- ($PMA_Theme->mtimeInfo ?? 0) +
- ($PMA_Theme->filesizeInfo ?? 0)
+ ($theme->mtimeInfo ?? 0) +
+ ($theme->filesizeInfo ?? 0)
);
}
diff --git a/libraries/classes/Controllers/JavaScriptMessagesController.php b/libraries/classes/Controllers/JavaScriptMessagesController.php
index 254ef867f9..48e6dbe130 100644
--- a/libraries/classes/Controllers/JavaScriptMessagesController.php
+++ b/libraries/classes/Controllers/JavaScriptMessagesController.php
@@ -28,9 +28,9 @@ final class JavaScriptMessagesController
private function setMessages(): void
{
- global $cfg, $PMA_Theme;
+ global $cfg, $theme;
- $ajaxClockSmallGifPath = $PMA_Theme instanceof Theme ? $PMA_Theme->getImgPath('ajax_clock_small.gif') : '';
+ $ajaxClockSmallGifPath = $theme instanceof Theme ? $theme->getImgPath('ajax_clock_small.gif') : '';
$this->messages = [
/* For confirmations */
diff --git a/libraries/classes/Display/Results.php b/libraries/classes/Display/Results.php
index 8820e01c6f..47b6ec3682 100644
--- a/libraries/classes/Display/Results.php
+++ b/libraries/classes/Display/Results.php
@@ -1545,7 +1545,7 @@ class Results
*/
private function getFullOrPartialTextButtonOrLink()
{
- global $PMA_Theme;
+ global $theme;
$urlParamsFullText = [
'db' => $this->properties['db'],
@@ -1567,7 +1567,7 @@ class Results
}
$tmpImage = '
';
$tmpUrl = Url::getFromRoute('/sql', $urlParamsFullText);
diff --git a/libraries/classes/Header.php b/libraries/classes/Header.php
index ead1dd570f..1c72e0c7f6 100644
--- a/libraries/classes/Header.php
+++ b/libraries/classes/Header.php
@@ -380,7 +380,7 @@ class Header
*/
public function getDisplay(): string
{
- global $db, $table, $PMA_Theme, $dbi;
+ global $db, $table, $theme, $dbi;
if ($this->headerIsSent || ! $this->isEnabled) {
return '';
@@ -399,7 +399,7 @@ class Header
$baseDir = defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : '';
$uniqueValue = $GLOBALS['PMA_Config']->getThemeUniqueValue();
- $themePath = $PMA_Theme instanceof Theme ? $PMA_Theme->getPath() : '';
+ $themePath = $theme instanceof Theme ? $theme->getPath() : '';
$version = self::getVersionParameter();
// The user preferences have been merged at this point
diff --git a/libraries/classes/Navigation/Navigation.php b/libraries/classes/Navigation/Navigation.php
index 06cbb3386c..2e46340a26 100644
--- a/libraries/classes/Navigation/Navigation.php
+++ b/libraries/classes/Navigation/Navigation.php
@@ -277,15 +277,15 @@ class Navigation
*/
private function getLogoSource(): string
{
- global $PMA_Theme;
+ global $theme;
- if ($PMA_Theme instanceof Theme) {
- if (@file_exists($PMA_Theme->getFsPath() . 'img/logo_left.png')) {
- return $PMA_Theme->getPath() . '/img/logo_left.png';
+ if ($theme instanceof Theme) {
+ if (@file_exists($theme->getFsPath() . 'img/logo_left.png')) {
+ return $theme->getPath() . '/img/logo_left.png';
}
- if (@file_exists($PMA_Theme->getFsPath() . 'img/pma_logo2.png')) {
- return $PMA_Theme->getPath() . '/img/pma_logo2.png';
+ if (@file_exists($theme->getFsPath() . 'img/pma_logo2.png')) {
+ return $theme->getPath() . '/img/pma_logo2.png';
}
}
diff --git a/libraries/classes/Twig/AssetExtension.php b/libraries/classes/Twig/AssetExtension.php
index 6c5690d7ff..5f6bbd9eb3 100644
--- a/libraries/classes/Twig/AssetExtension.php
+++ b/libraries/classes/Twig/AssetExtension.php
@@ -22,12 +22,12 @@ final class AssetExtension extends AbstractExtension
public function getImagePath(?string $filename = null, ?string $fallback = null): string
{
- global $PMA_Theme;
+ global $theme;
- if (! $PMA_Theme instanceof Theme) {
+ if (! $theme instanceof Theme) {
return '';
}
- return $PMA_Theme->getImgPath($filename, $fallback);
+ return $theme->getImgPath($filename, $fallback);
}
}
diff --git a/libraries/common.inc.php b/libraries/common.inc.php
index d05087a8b4..ccad8ea2a7 100644
--- a/libraries/common.inc.php
+++ b/libraries/common.inc.php
@@ -48,7 +48,7 @@ use PhpMyAdmin\ThemeManager;
use PhpMyAdmin\Tracker;
global $containerBuilder, $error_handler, $PMA_Config, $server, $dbi;
-global $lang, $cfg, $isConfigLoading, $auth_plugin, $route, $PMA_Theme;
+global $lang, $cfg, $isConfigLoading, $auth_plugin, $route, $theme;
global $url_params, $goto, $back, $db, $table, $sql_query, $token_mismatch;
/**
@@ -226,7 +226,7 @@ $PMA_Config->enableBc();
/* setup themes LABEL_theme_setup */
-$PMA_Theme = ThemeManager::initializeTheme();
+$theme = ThemeManager::initializeTheme();
/** @var DatabaseInterface $dbi */
$dbi = null;
diff --git a/test/classes/AbstractTestCase.php b/test/classes/AbstractTestCase.php
index 40f0b4bd1f..33580426e7 100644
--- a/test/classes/AbstractTestCase.php
+++ b/test/classes/AbstractTestCase.php
@@ -133,8 +133,8 @@ abstract class AbstractTestCase extends TestCase
protected function setTheme(): void
{
- global $PMA_Theme;
- $PMA_Theme = Theme::load('pmahomme');
+ global $theme;
+ $theme = Theme::load('pmahomme');
}
protected function setLanguage(string $code = 'en'): void
diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php
index fe74a08c6d..00e9336c64 100644
--- a/test/classes/ConfigTest.php
+++ b/test/classes/ConfigTest.php
@@ -951,11 +951,13 @@ class ConfigTest extends AbstractTestCase
*/
public function testGetThemeUniqueValue(): void
{
+ global $theme;
+
$partial_sum = $this->object->sourceMtime +
$this->object->defaultSourceMtime +
$this->object->get('user_preferences_mtime') +
- $GLOBALS['PMA_Theme']->mtimeInfo +
- $GLOBALS['PMA_Theme']->filesizeInfo;
+ $theme->mtimeInfo +
+ $theme->filesizeInfo;
$this->assertEquals($partial_sum, $this->object->getThemeUniqueValue());
}
diff --git a/test/classes/ThemeTest.php b/test/classes/ThemeTest.php
index 1aeb251480..a83c065693 100644
--- a/test/classes/ThemeTest.php
+++ b/test/classes/ThemeTest.php
@@ -22,12 +22,14 @@ class ThemeTest extends AbstractTestCase
*/
protected function setUp(): void
{
+ global $theme;
+
parent::setUp();
parent::defineVersionConstants();
parent::setTheme();
$this->object = new Theme();
- $this->backup = $GLOBALS['PMA_Theme'];
- $GLOBALS['PMA_Theme'] = $this->object;
+ $this->backup = $theme;
+ $theme = $this->object;
parent::setGlobalConfig();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['text_dir'] = 'ltr';
@@ -40,8 +42,10 @@ class ThemeTest extends AbstractTestCase
*/
protected function tearDown(): void
{
+ global $theme;
+
parent::tearDown();
- $GLOBALS['PMA_Theme'] = $this->backup;
+ $theme = $this->backup;
}
/**