]> git.mxchange.org Git - friendica.git/commitdiff
extract ThemeInfo methods into AppHelper
authorArt4 <art4@wlabs.de>
Fri, 8 Nov 2024 11:05:02 +0000 (11:05 +0000)
committerArt4 <art4@wlabs.de>
Fri, 8 Nov 2024 11:05:02 +0000 (11:05 +0000)
src/App.php
src/AppHelper.php

index 962e50794c5c689c9fa72632b3caf415737dd2cb..12b1cb13562776522a542b86f13d41fe0b3c0a2b 100644 (file)
@@ -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);
        }
 
        /**
index d44c2f3a31b4827c56cd2ddb58b517eb66e166fb..e9cf6c9167ab7b77eb0e70a2ebffa826087bb2a4 100644 (file)
@@ -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
         *