mirror of
https://github.com/friendica/friendica
synced 2024-11-18 08:23:53 +00:00
Merge pull request #7162 from nupplaphil/task/mod_view
Move mod/view to src/Module/Theme
This commit is contained in:
commit
d3a4ed0111
3 changed files with 33 additions and 27 deletions
27
mod/view.php
27
mod/view.php
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
* load view/theme/$current_theme/style.php with friendica context
|
||||
*
|
||||
* @param App $a
|
||||
*/
|
||||
function view_init(App $a)
|
||||
{
|
||||
header("Content-Type: text/css");
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
}
|
|
@ -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);
|
||||
|
|
32
src/Module/Theme.php
Normal file
32
src/Module/Theme.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
* load view/theme/$current_theme/style.php with friendica context
|
||||
*/
|
||||
class Theme extends BaseModule
|
||||
{
|
||||
public static function rawContent()
|
||||
{
|
||||
header("Content-Type: text/css");
|
||||
|
||||
$a = self::getApp();
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue