1
0
Fork 0
friendica_2020-09-1_sharedH.../src/Module/Theme.php
nupplaPhil 1de3f186d7
Introduce new DI container
- Adding Friendica\DI class for getting dynamic classes
- Replacing BaseObject::getApp() with this class
2019-12-29 20:16:55 +01:00

33 lines
652 B
PHP

<?php
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\DI;
use Friendica\Util\Strings;
/**
* load view/theme/$current_theme/style.php with friendica context
*/
class Theme extends BaseModule
{
public static function rawContent(array $parameters = [])
{
header("Content-Type: text/css");
$a = DI::app();
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();
}
}