]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Theme.php
Decouple conversation creation from rendering
[friendica.git] / src / Module / Theme.php
index c904f1defd1848e8fd8f08a7ac45c016393f349e..5161725d5e7f64c0639c35384bf1ad0cf062f84b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,7 +22,7 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
-use Friendica\DI;
+use Friendica\Core\System;
 use Friendica\Util\Strings;
 
 /**
@@ -30,23 +30,21 @@ 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);
-
-                       // 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");
-                       }
+               if (file_exists("view/theme/$theme/theme.php")) {
+                       require_once "view/theme/$theme/theme.php";
                }
 
-               exit();
+               // 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";
+               }
+               System::exit();
        }
 }