X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FTheme.php;h=c64ed08d3babdd315dd570c041878c89b8ea644d;hb=493314a0677d852d2f8ce46888f4e9283494c1be;hp=16eb7939c5224fe9f9585dee9c09fb3255b29839;hpb=acbc733dce0ed4bcdbea6a0ce88da7a18e2dffa0;p=friendica.git diff --git a/src/Core/Theme.php b/src/Core/Theme.php index 16eb7939c5..c64ed08d3b 100644 --- a/src/Core/Theme.php +++ b/src/Core/Theme.php @@ -162,7 +162,7 @@ class Theme } else { $parent = 'NOPATH'; } - $theme = current_theme(); + $theme = get_app()->getCurrentTheme(); $thname = $theme; $ext = substr($file, strrpos($file, '.') + 1); $paths = [ @@ -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'; + } }