diff --git a/mod/view.php b/mod/view.php deleted file mode 100644 index 6f23d84dc4..0000000000 --- a/mod/view.php +++ /dev/null @@ -1,27 +0,0 @@ -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"); - } - } - - exit(); -} diff --git a/src/App/Router.php b/src/App/Router.php index 133544c819..af9ed0f481 100644 --- a/src/App/Router.php +++ b/src/App/Router.php @@ -209,6 +209,7 @@ class Router $this->routeCollector->addRoute(['GET'], '/statistics.json', Module\Statistics::class); $this->routeCollector->addRoute(['GET'], '/toggle_mobile', Module\ToggleMobile::class); $this->routeCollector->addRoute(['GET'], '/tos', Module\Tos::class); + $this->routeCollector->addRoute(['GET'], '/view/theme/{theme}/style.pcss', Module\Theme::class); $this->routeCollector->addRoute(['GET'], '/viewsrc/{item:\d+}', Module\ItemBody::class); $this->routeCollector->addRoute(['GET'], '/webfinger', Module\WebFinger::class); $this->routeCollector->addRoute(['GET'], '/xrd', Module\Xrd::class); diff --git a/src/Module/Theme.php b/src/Module/Theme.php new file mode 100644 index 0000000000..0540267af7 --- /dev/null +++ b/src/Module/Theme.php @@ -0,0 +1,32 @@ +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"); + } + } + + exit(); + } +}