diff --git a/src/App.php b/src/App.php index 962e50794c..12b1cb1356 100644 --- a/src/App.php +++ b/src/App.php @@ -51,13 +51,6 @@ class App const CODENAME = 'Yellow Archangel'; const VERSION = '2024.09-dev'; - // Allow themes to control internal parameters - // by changing App values in theme.php - private $theme_info = [ - 'videowidth' => 425, - 'videoheight' => 350, - ]; - /** * @var Mode The Mode of the Application */ @@ -220,19 +213,28 @@ class App return $this->appHelper->getQueueValue($index); } + /** + * @deprecated 2024.12 Use AppHelper::setThemeInfoValue() instead + */ public function setThemeInfoValue(string $index, $value) { - $this->theme_info[$index] = $value; + $this->appHelper->setThemeInfoValue($index, $value); } + /** + * @deprecated 2024.12 Use AppHelper::getThemeInfo() instead + */ public function getThemeInfo() { - return $this->theme_info; + return $this->appHelper->getThemeInfo(); } + /** + * @deprecated 2024.12 Use AppHelper::getThemeInfoValue() instead + */ public function getThemeInfoValue(string $index, $default = null) { - return $this->theme_info[$index] ?? $default; + return $this->appHelper->getThemeInfoValue($index, $default); } /** diff --git a/src/AppHelper.php b/src/AppHelper.php index d44c2f3a31..e9cf6c9167 100644 --- a/src/AppHelper.php +++ b/src/AppHelper.php @@ -45,6 +45,13 @@ final class AppHelper /** @var string The name of the current mobile theme */ private $currentMobileTheme; + // Allow themes to control internal parameters + // by changing App values in theme.php + private $theme_info = [ + 'videowidth' => 425, + 'videoheight' => 350, + ]; + /** * @var Database The Friendica database connection */ @@ -228,7 +235,7 @@ final class AppHelper * * @param string $theme Name of current theme */ - public function setCurrentTheme(string $theme) + public function setCurrentTheme(string $theme): void { $this->currentTheme = $theme; } @@ -238,11 +245,26 @@ final class AppHelper * * @param string $theme Name of current mobile theme */ - public function setCurrentMobileTheme(string $theme) + public function setCurrentMobileTheme(string $theme): void { $this->currentMobileTheme = $theme; } + public function setThemeInfoValue(string $index, $value): void + { + $this->theme_info[$index] = $value; + } + + public function getThemeInfo(): array + { + return $this->theme_info; + } + + public function getThemeInfoValue(string $index, $default = null) + { + return $this->theme_info[$index] ?? $default; + } + /** * Computes the current theme name based on the node settings, the page owner settings and the user settings *