]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Theme.php
Merge pull request #11360 from annando/announce-notification
[friendica.git] / src / Module / Theme.php
index c904f1defd1848e8fd8f08a7ac45c016393f349e..66c9d06f076bad857b4a3279bb16e708cd961478 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -30,21 +30,20 @@ use Friendica\Util\Strings;
  */
 class Theme extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
-               header("Content-Type: text/css");
+               header('Content-Type: text/css');
 
-               $a = DI::app();
+               $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
 
-               if ($a->argc == 4) {
-                       $theme = $a->argv[2];
-                       $theme = Strings::sanitizeFilePathItem($theme);
+               if (file_exists("view/theme/$theme/theme.php")) {
+                       require_once "view/theme/$theme/theme.php";
+               }
 
-                       // set the path for later use in the theme styles
-                       $THEMEPATH = "view/theme/$theme";
-                       if (file_exists("view/theme/$theme/style.php")) {
-                               require_once("view/theme/$theme/style.php");
-                       }
+               // set the path for later use in the theme styles
+               $THEMEPATH = "view/theme/$theme";
+               if (file_exists("view/theme/$theme/style.php")) {
+                       require_once "view/theme/$theme/style.php";
                }
 
                exit();