2019-05-18 21:23:12 +02:00
|
|
|
<?php
|
2024-08-24 15:27:00 +02:00
|
|
|
|
|
|
|
// Copyright (C) 2010-2024, the Friendica project
|
|
|
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-05-18 21:23:12 +02:00
|
|
|
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
2022-05-18 02:13:54 +00:00
|
|
|
use Friendica\Core\System;
|
2019-05-18 21:23:12 +02:00
|
|
|
use Friendica\Util\Strings;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* load view/theme/$current_theme/style.php with friendica context
|
|
|
|
*/
|
|
|
|
class Theme extends BaseModule
|
|
|
|
{
|
2021-11-20 15:38:03 +01:00
|
|
|
protected function rawContent(array $request = [])
|
2019-05-18 21:23:12 +02:00
|
|
|
{
|
2020-08-19 22:54:12 -04:00
|
|
|
header('Content-Type: text/css');
|
2019-05-18 21:23:12 +02:00
|
|
|
|
2021-11-14 23:19:25 +01:00
|
|
|
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
|
2019-05-18 21:23:12 +02:00
|
|
|
|
2020-08-19 22:54:12 -04:00
|
|
|
if (file_exists("view/theme/$theme/theme.php")) {
|
|
|
|
require_once "view/theme/$theme/theme.php";
|
|
|
|
}
|
2019-05-18 21:23:12 +02:00
|
|
|
|
2020-08-19 22:54:12 -04:00
|
|
|
// set the path for later use in the theme styles
|
2020-08-21 06:57:54 +02:00
|
|
|
$THEMEPATH = "view/theme/$theme";
|
2020-08-19 22:54:12 -04:00
|
|
|
if (file_exists("view/theme/$theme/style.php")) {
|
|
|
|
require_once "view/theme/$theme/style.php";
|
2019-05-18 21:23:12 +02:00
|
|
|
}
|
2022-05-18 02:13:54 +00:00
|
|
|
System::exit();
|
2019-05-18 21:23:12 +02:00
|
|
|
}
|
|
|
|
}
|