From: Philipp Holzer Date: Sat, 18 May 2019 19:23:12 +0000 (+0200) Subject: Move mod/view to src/Module/View X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d1d7fa394af30c62a853c375ba4614ba9afe4a24;p=friendica.git Move mod/view to src/Module/View --- 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 cd59c3dd90..7e4c35ff01 100644 --- a/src/App/Router.php +++ b/src/App/Router.php @@ -202,6 +202,7 @@ class Router $this->routeCollector->addRoute(['GET'], '/smilies[/json]', Module\Smilies::class); $this->routeCollector->addRoute(['GET'], '/statistics.json', Module\Statistics::class); $this->routeCollector->addRoute(['GET'], '/tos', Module\Tos::class); + $this->routeCollector->addRoute(['GET'], '/view/theme/{theme:.+}', 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(); + } +}