98 $root=&XCube_Root::getSingleton();
102 $root->mDelegateManager->add(
"Legacypage.Admin.SystemCheck",
"Legacy_AdminDashboard::AdminDashboardSystem", XCUBE_DELEGATE_PRIORITY_1);
109 if ($root->mController->_mStrategy && get_class($root->mController->_mStrategy) ===
'Legacy_AdminControllerStrategy') {
111 $this->mController->_mStrategy->mSetupBlock->add( [$this,
'AdminSetupBlock'] );
120 $root =& XCube_Root::getSingleton();
122 if(XC_ADMINDASHBOARD_INFO) {
132 if ( $uitype == 0 ) {
133 $uiadmin =
'<b>Welcome to XOOPSCube Admin!</b><br>Have a nice time!';
138 elseif ( $uitype == 1 ) {
139 $uiadminhtml =
'<b>Welcome to XOOPSCube !</b>
140 <br>Have a nice and happy time!
141 <br><b>Output with template "legacy_dummy.html"</b>!';
143 $attributes[
'dummy_content'] = $uiadminhtml;
144 $template = XOOPS_LEGACY_PATH.
'/templates/legacy_dummy.html';
149 elseif ( $uitype == 2 ) {
151 if ( file_exists(XOOPS_LEGACY_PATH .
'/admin/templates/dashboard.html') ) {
153 $title1 =
'XCL Documentation';
154 $content1=
'XCL provides out-of-the-box a search function to find admin features.'
155 .
'And documentation is available from menu Help for each module.';
161 $attributes[
'title'] = $title1;
162 $attributes[
'content'] = $content1;
164 $template = XOOPS_LEGACY_PATH.
'/admin/templates/dashboard.html';
177 if (XC_ADMINDASHBOARD_PHPINFO) {
180 phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
181 $phpinfo = ob_get_clean();
183 preg_match_all(
'#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
184 $output = preg_replace(
'#<table#',
'<table class="outer""', $output[1][0]);
185 $output = preg_replace(
'#(\w),(\w)#',
'\1, \2', $output);
186 $output = preg_replace(
'#<h2([^>]*)>(.*)</h2>#m',
'<h3$1>$2</h3>', $output);
187 $output = preg_replace(
'#<h1([^>]*)>(.*)</h1>#m',
'<h2$1>$2</h2>', $output);
188 $output = preg_replace(
'#border="0" width="600"#',
'', $output);
189 $output = preg_replace(
'#<hr>#',
'', $output);
190 $output = preg_replace(
'#class="e"#',
'class="even"', $output);
191 $output = preg_replace(
'#class="h"#',
'class="odd"', $output);
192 $output = preg_replace(
'#class="v"#',
'class="even"', $output);
193 $output = preg_replace(
'#class="p"#',
'class="odd"', $output);
194 $output = str_replace([
'<div class="center">',
'</div>'],
'', $output);
197 $attributes[
'dummy_content'] = $output;
199 $template = XOOPS_LEGACY_PATH.
'/templates/legacy_dummy.html';
208 public function AdminSetupBlock() {
210 if ( XC_ADMIN_BLOCK_ACTIONSEARCH) {
211 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminActionSearch.class.php';
215 if (XC_ADMIN_BLOCK_COMMENTS) {
216 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockComments.class.php';
217 $this->mController->_mBlockChain[] =
new Legacy_AdminBlockComments();
220 if(XC_ADMIN_BLOCK_LOGINFO && file_exists(XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockLogInfo.class.php')) {
221 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockLogInfo.class.php';
222 $this->mController->_mBlockChain[] =
new Legacy_AdminBlockLogInfo();
225 if (XC_ADMIN_BLOCK_MENU && file_exists(XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockMenu.class.php')) {
226 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockMenu.class.php';
227 $this->mController->_mBlockChain[] =
new Legacy_AdminBlockMenu();
230 if (XC_ADMIN_BLOCK_ONLINE && file_exists(XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockOnline.class.php')) {
231 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockOnline.class.php';
232 $this->mController->_mBlockChain[] =
new Legacy_AdminBlockOnline();
234 if (XC_ADMIN_BLOCK_OVERVIEW) {
235 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockOverview.class.php';
236 $this->mController->_mBlockChain[] =
new Legacy_AdminBlockOverview();
238 if (XC_ADMIN_BLOCK_PHP) {
239 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockPhp.class.php';
240 $this->mController->_mBlockChain[] =
new Legacy_AdminBlockPhp();
243 if (XC_ADMIN_BLOCK_SERVER) {
244 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockServer.class.php';
245 $this->mController->_mBlockChain[] =
new Legacy_AdminBlockServer();
248 if (XC_ADMIN_BLOCK_WAITING) {
249 require_once XOOPS_LEGACY_PATH .
'/admin/blocks/AdminBlockWaiting.class.php';
250 $this->mController->_mBlockChain[] =
new Legacy_AdminBlockWaiting();
271 public static function display_message(
bool $return, array $attributes = [],
string $template=
'')
273 $root =& XCube_Root::getSingleton();
275 $renderSystem =& $root->getRenderSystem($root->mContext->mBaseRenderSystemName);
280 $renderTarget =& $renderSystem->createRenderTarget(
'main');
286 $renderTarget->setAttribute(
'legacy_module',
'legacy');
288 $renderTarget->setTemplateName($template);
290 foreach (array_keys($attributes) as $attribute) {
291 $renderTarget->setAttribute($attribute, $attributes[$attribute]);
294 $renderSystem->render($renderTarget);
295 if ($return ==
true) {
296 return $renderTarget->getResult();
299 print $renderTarget->getResult();
308 private static function getTemplate($file, $prefix =
null)
310 $infoArr = Legacy_get_override_file($file, $prefix);
312 $file = $prefix . $file;
315 if ($infoArr[
'theme'] !==
null && $infoArr[
'dirname'] !==
null) {
318 return XOOPS_THEME_PATH .
'/' . $infoArr[
'theme'] .
'/templates/' . $infoArr[
'dirname'] .
'/' . $file;
322 if ($infoArr[
'theme'] !==
null) {
323 return XOOPS_THEME_PATH .
'/' . $infoArr[
'theme'] .
'/' . $file;
330 if ($infoArr[
'dirname'] !==
null) {
331 return XOOPS_MODULE_PATH .
'/' . $infoArr[
'dirname'] .
'/admin/templates/' . $file;
334 return LEGACY_ADMIN_RENDER_FALLBACK_PATH .
'/' . $file;