-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.php
96 lines (93 loc) · 2.12 KB
/
root.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
include("config.php");
function callback($buffer, $mode)
{
$load = pluginManager::getPM()->loadedPlugins();
$CSS = "";
$FOOT = "";
foreach($load as $loaded)
{
$loaded=$loaded."Plugin";
$Stylesheets = $loaded::getPlugin()->getCSS();
foreach($Stylesheets as $stylesheet)
{
if($stylesheet != "")
$CSS .= <<<EOF
{$stylesheet}
EOF;
}
/*$footer = $loaded::getPlugin()->getFooter();
foreach($Stylesheets as $stylesheet)
{
if($stylesheet != "")
$CSS .= <<<EOF
{$stylesheet}
EOF;
}*/
}
$output = str_ireplace("<plugins content=\"headers\" />", $CSS, $buffer);
$output = str_ireplace("<plugins content=\"footers\" />", $FOOT, $output);
return ob_gzhandler($output, $mode);
}
function callback2($buffer, $mode)
{
$load = pluginManager::getPM()->loadedPlugins();
$CSS = "";
foreach($load as $loaded)
{
$loaded=$loaded."Plugin";
$Stylesheets = $loaded::getPlugin()->getCSS();
foreach($Stylesheets as $stylesheet)
{
if($stylesheet != "")
$CSS .= <<<EOF
{$stylesheet}
EOF;
}
}
$output = str_ireplace("<plugins />", $CSS, $buffer);
return $output;
}
$content = file($this->ic());
//First line: $content[0];
$content[0] = $content[0]."\n";
$string = "";
if(preg_match("/^{([- a-z0-9]*)}\r?\n+\s*/mi", $content[0]))
$string = preg_replace("/^{([a-z0-9 -]*)}\r?\n+\s*/mi", "$1", $content[0]);
$templateExists = preg_match("/(no-template)/i",$string);
$compressionExists = preg_match("/(compression)/i",$string);
if(in_array("Menu", pluginManager::getPM()->loadedPlugins()))
{
MenuPlugin::s()->SetPage($this, $content);
}
if(preg_match("/^{([- a-z0-9]*)}\r?\n+\s*/mi", $content[0]))
unset($content[0]);
if($Compression)
$compressionExists = !$compressionExists;
if($templateExists)
{
if($compressionExists)
{
ob_start('callback');
//echo "Compressing";
}
else
{
ob_start('callback2');
}
eval("?>".implode("", $content));
ob_end_flush();
}
else
{
if($compressionExists)
{
ob_start('callback');
}
else
{
ob_start('callback2');
}
$this->ThemeParser(implode("", $content));
ob_end_flush();
}