56 if (!headers_sent()) {
58 header(
'Expires: Mon, 26 Jul 1997 05:00:00 GMT');
59 header(
"Last-Modified: " . gmdate(
"D, d M Y H:i:s") .
" GMT");
60 header(
'Cache-Control: no-store, no-cache, must-revalidate');
61 header(
"Cache-Control: post-check=0, pre-check=0",
false);
62 header(
"Pragma: no-cache");
65 require_once XOOPS_ROOT_PATH .
'/class/template.php';
66 require_once XOOPS_ROOT_PATH .
'/class/theme.php';
68 if (@$xoopsOption[
'template_main']) {
69 if (
false === strpos($xoopsOption[
'template_main'],
':')) {
70 $xoopsOption[
'template_main'] =
'db:' . $xoopsOption[
'template_main'];
75 $this->xoTheme =& $adminThemeFactory->createInstance(array(
76 'folderName' => $this->foldername,
77 'themesPath' =>
'modules/system/themes',
78 'contentTemplate' => @$xoopsOption[
'template_main']));
80 $this->xoTheme->loadLocalization(
'admin');
81 $this->
template =& $this->xoTheme->template;
84 $GLOBALS[
'adminTpl'] =& $this->xoTheme->template;
92 if ( isset($xoopsModule) && $xoopsModule->getVar(
'dirname') ==
'system' ) {
93 $xoopsModule->loadAdminMenu();
95 foreach (array_keys($xoopsModule->adminmenu) as $item) {
96 $sys_menu[$item][
'link'] = XOOPS_URL .
'/modules/'.$xoopsModule->getVar(
'dirname').
'/' . $xoopsModule->adminmenu[$item][
'link'];
97 $GLOBALS[
'xoopsTpl']->append_by_ref(
'sys_menu', $sys_menu );
102 if (isset($xoopsModule) && $xoopsModule->getVar(
'dirname') !=
'system') {
104 if ($xoopsModule->getInfo(
'system_menu')) {
105 $GLOBALS[
'xoTheme']->addStylesheet(XOOPS_URL .
'/modules/system/css/menu.css');
107 $xoopsModule->loadAdminMenu();
111 $menu_handler->addMenuTop(XOOPS_URL .
"/modules/system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar(
'mid',
'e'),
_AM_SYSTEM_PREF);
112 $menu_handler->addMenuTop(XOOPS_URL .
"/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar(
'dirname',
'e'),
_AM_SYSTEM_UPDATE);
113 $menu_handler->addMenuTop(XOOPS_URL .
"/modules/system/admin.php?fct=blocksadmin&op=list&filter=1&selgen=" . $xoopsModule->getVar(
'mid',
'e') .
"&selmod=-2&selgrp=-1&selvis=-1",
_AM_SYSTEM_BLOCKS);
114 $menu_handler->addMenuTop(XOOPS_URL .
"/modules/system/admin.php?fct=tplsets&op=listtpl&tplset=default&moddir=" . $xoopsModule->getVar(
'dirname',
'e'),
_AM_SYSTEM_TPLSETS);
115 $menu_handler->addMenuTop(XOOPS_URL .
"/modules/system/admin.php?module=" . $xoopsModule->getVar(
'mid',
'e').
'&status=0&limit=10&fct=comments',
_AM_SYSTEM_COMMENTS);
116 $menu_handler->addMenuTop(XOOPS_URL .
"/modules/system/admin.php?fct=modulesadmin&op=uninstall&module=" . $xoopsModule->getVar(
'dirname',
'e'),
_AM_SYSTEM_UNINSTALL);
118 $menu_handler->addMenuTop(XOOPS_URL .
"/modules/" . $xoopsModule->getVar(
'dirname',
'e') .
"/",
_AM_SYSTEM_GOTOMODULE);
122 foreach ($xoopsModule->adminmenu as
$menu) {
123 if ( stripos(
$_SERVER[
'REQUEST_URI'], $menu[
'link'] ) !==
false ) $current =
$i;
124 $menu_handler->addMenuTabs( $menu[
'link'], $menu[
'title']);
127 if ($xoopsModule->getInfo(
'help')) {
128 if ( stripos(
$_SERVER[
'REQUEST_URI'],
'admin/' . $xoopsModule->getInfo(
'help') ) !==
false ) $current =
$i;
129 $menu_handler->addMenuTabs(
'../system/help.php?mid=' . $xoopsModule->getVar(
'mid',
's') .
'&' . $xoopsModule->getInfo(
'help'),
_AM_SYSTEM_HELP);
133 $GLOBALS[
'xoopsTpl']->assign(
'xo_system_menu', $menu_handler->render($current,
false));
145 if (!headers_sent()) {
147 header(
'Expires: Mon, 26 Jul 1997 05:00:00 GMT');
148 header(
'Cache-Control: private, no-cache');
149 header(
'Pragma: no-cache');
153 if (!isset($xoTheme)) $xoTheme =&
$GLOBALS[
'xoTheme'];
155 if (isset($xoopsOption[
'template_main']) && $xoopsOption[
'template_main'] != $xoTheme->contentTemplate) {
156 trigger_error(
"xoopsOption[template_main] should be defined before call xoops_cp_header function", E_USER_WARNING);
157 if (
false === strpos($xoopsOption[
'template_main'],
':')) {
158 $xoTheme->contentTemplate =
'db:' . $xoopsOption[
'template_main'];
160 $xoTheme->contentTemplate = $xoopsOption[
'template_main'];
175 if (!isset($instance)) {
177 $instance =
new $class();