/
index.php
61 lines (46 loc) · 1.91 KB
/
index.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
<?php
require_once("../../mainfile.php");
require_once(XOOPS_ROOT_PATH . "/header.php");
ob_start();
// define("RUN_BASE", dirname(realpath(".")));
define("RUN_BASE", dirname(__FILE__));
//require ("Sabel" . DIRECTORY_SEPARATOR . "Sabel.php");
require (RUN_BASE . DIRECTORY_SEPARATOR . "Sabel" . DIRECTORY_SEPARATOR . "Sabel.php");
require (RUN_BASE . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "INIT.php");
require (RUN_BASE . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "environment.php");
if (!defined("ENVIRONMENT")) {
echo "SABEL FATAL ERROR: must define ENVIRONMENT in config/environment.php";
exit;
}
if ((ENVIRONMENT & PRODUCTION) > 0) {
Sabel::init();
$out = Sabel_Bus::create()->run(new Config_Bus());
Sabel::shutdown();
} else {
$out = Sabel_Bus::create()->run(new Config_Bus());
}
if (Sabel_Context::getContext()->getBus()->get("AJAX_REQUEST")) {
echo $out;
exit;
}
$root =& XCube_Root::getSingleton();
$target =& $root->mContext->mModule->getRenderTarget();
$target->setResult($out);
$target->setAttribute('legacy_buffertype', null);
$theme =& $root->mController->_mStrategy->getMainThemeObject();
$renderSystem =& $root->getRenderSystem($theme->get('render_system'));
$renderSystem->_commonPrepareRender();
if (isset($GLOBALS['xoopsUserIsAdmin'])) {
$renderSystem->mXoopsTpl->assign('xoops_isadmin', $GLOBALS['xoopsUserIsAdmin']);
}
$renderSystem->mXoopsTpl->assign('xoops_block_header', '');
$renderSystem->mXoopsTpl->assign('xoops_module_header', '');
$theme =& $root->mController->_mStrategy->getMainThemeObject();
$renderSystem =& $root->getRenderSystem($theme->get('render_system'));
$renderSystem->_commonPrepareRender();
if (isset($GLOBALS['xoopsUserIsAdmin'])) {
$renderSystem->mXoopsTpl->assign('xoops_isadmin', $GLOBALS['xoopsUserIsAdmin']);
}
$renderSystem->mXoopsTpl->assign('xoops_block_header', '');
require_once(XOOPS_ROOT_PATH . "/footer.php");
ob_flush();