4session_cache_limiter(
'private_no_expire');
6define(
'_LEGACY_ALLOW_ACCESS_FROM_ANY_ADMINS_',
true);
8require_once
'../../../mainfile.php';
9$root =& XCube_Root::getSingleton();
10unset($root->mContext->mXoopsModule);
16function Legacy_modifier_css_theme($string)
18 $infoArr = Legacy_get_override_file($string,
null,
true);
21 if (!empty($infoArr[
'theme']) && !empty($infoArr[
'dirname'])) {
22 return XOOPS_THEME_URL .
'/' . $infoArr[
'theme'] .
'/templates/' . $infoArr[
'dirname'] .
'/' . $string;
25 if (!empty($infoArr[
'theme']) && !empty($infoArr[
'dirname'])) {
26 return XOOPS_THEME_URL .
'/' . $infoArr[
'theme'] .
'/modules/' . $infoArr[
'dirname'] .
'/' . $string;
29 if (!empty($infoArr[
'theme'])) {
30 return XOOPS_THEME_URL .
'/' . $infoArr[
'theme'] .
'/' . $string;
33 if (!empty($infoArr[
'dirname'])) {
34 return XOOPS_MODULE_URL .
'/' . $infoArr[
'dirname'] .
'/admin/templates/' . $string;
37 return LEGACY_ADMIN_RENDER_FALLBACK_URL .
'/' . $string;
40$theme = isset($_GET[
'theme']) ? trim($_GET[
'theme']) : null;
41$dirname = isset($_GET[
'dirname']) ? trim($_GET[
'dirname']) : null;
42$_GET[
'file'] ??=
'style.css';
43$file =
'stylesheets/' . trim(@$_GET[
'file']);
46if (strpos($theme,
'..') !==
false || strpos($dirname,
'..') !==
false || strpos($file,
'..') !==
false) {
49require_once XOOPS_ROOT_PATH.
'/modules/legacyRender/kernel/Legacy_AdminRenderSystem.class.php';
52$smarty->register_modifier(
'theme',
'Legacy_modifier_css_theme');
53$smarty->register_function(
'stylesheet',
'Legacy_function_stylesheet');
58 $smarty->force_compile =
true;
60 if (
null !== $theme &&
null !== $dirname) {
64 $path = XOOPS_THEME_PATH .
"/{$theme}/templates/{$dirname}";
65 } elseif (
null !== $theme) {
66 $path = XOOPS_THEME_PATH .
'/' . $theme;
67 } elseif (
null !== $dirname) {
68 $path = XOOPS_MODULE_PATH .
"/{$dirname}/admin/templates";
70 $path = LEGACY_ADMIN_RENDER_FALLBACK_PATH;
73 $smarty->template_dir = $path;
74 $smarty->setModulePrefix(
'_css_' . $theme);
77 if (is_file($path .
'/' . $file)) {
78 $result = $smarty->fetch(
'file:' . $file);
81header(
'Content-Type:text/css; charset='._CHARSET);