mirror of
https://github.com/friendica/friendica
synced 2025-04-26 13:50:11 +00:00
Add new methods to src
- Add App::getCurrentTheme() - Add App::getCurrentThemeStylesheetPath() - Add Theme::getStylesheetPath()
This commit is contained in:
parent
acbc733dce
commit
964bf3f3cc
2 changed files with 102 additions and 0 deletions
|
@ -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';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue