]> git.mxchange.org Git - friendica.git/blob - src/Module/Theme.php
Merge pull request #8227 from annando/daemon-checks
[friendica.git] / src / Module / Theme.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\BaseModule;
6 use Friendica\DI;
7 use Friendica\Util\Strings;
8
9 /**
10  * load view/theme/$current_theme/style.php with friendica context
11  */
12 class Theme extends BaseModule
13 {
14         public static function rawContent(array $parameters = [])
15         {
16                 header("Content-Type: text/css");
17
18                 $a = DI::app();
19
20                 if ($a->argc == 4) {
21                         $theme = $a->argv[2];
22                         $theme = Strings::sanitizeFilePathItem($theme);
23
24                         // set the path for later use in the theme styles
25                         $THEMEPATH = "view/theme/$theme";
26                         if (file_exists("view/theme/$theme/style.php")) {
27                                 require_once("view/theme/$theme/style.php");
28                         }
29                 }
30
31                 exit();
32         }
33 }