]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Theme.php
Add new methods to src
[friendica.git] / src / Core / Theme.php
index 16eb7939c5224fe9f9585dee9c09fb3255b29839..fe38d09ede3ea0bbd06a6c4f518ce75c6d99b348 100644 (file)
@@ -180,4 +180,25 @@ class Theme
                }
                return '';
        }
+
+       /**
+        * @brief Return relative path to theme stylesheet file
+        *
+        * Provide a sane default if nothing is chosen or the specified theme does not exist.
+        *
+        * @param string $theme Theme name
+        *
+        * @return string
+        */
+       public static function getStylesheetPath($theme)
+       {
+               $a = get_app();
+
+               $opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
+               if (file_exists('view/theme/' . $theme . '/style.php')) {
+                       return 'view/theme/' . $theme . '/style.pcss' . $opts;
+               }
+
+               return 'view/theme/' . $theme . '/style.css';
+       }
 }