friendica/src/Module/Theme.php

33 lines
628 B
PHP
Raw Normal View History

2019-05-18 15:23:12 -04:00
<?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
{
2019-11-05 14:16:26 -05:00
public static function rawContent($parameters)
2019-05-18 15:23:12 -04:00
{
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();
}
}