19 require_once XOOPS_ROOT_PATH.
'/modules/system/class/maintenance.php';
33 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
35 $xoTheme->addScript(
'browse.php?Frameworks/jquery/jquery.js');
36 $xoTheme->addScript(
'modules/system/js/admin.js');
52 $cache->setDescription( XOOPS_VAR_PATH .
"/cache/smarty_cache/<br />".XOOPS_VAR_PATH .
"/cache/smarty_compile/<br />".XOOPS_VAR_PATH .
"/cache/xoops_cache/" );
53 $cache_arr = array(1 =>
'smarty_cache',
54 2 =>
'smarty_compile',
56 $cache->addOptionArray($cache_arr);
57 $form_maintenance->addElement($cache);
64 $select_tables->addOptionArray($maintenance->displayTables(
true));
65 $tables_tray->addElement($select_tables,
false);
67 $choice =
new XoopsFormSelect(
' ',
"maintenance",
'', 4,
true);
70 $tables_tray->addElement($choice,
false);
71 $form_maintenance->addElement($tables_tray);
73 $form_maintenance->addElement(
new XoopsFormHidden(
"op",
"maintenance_save"));
81 $select_tables1->addOptionArray($maintenance->displayTables(
true));
82 $dump_tray->addElement($select_tables1,
false);
85 $ele =
new XoopsFormSelect(
' ',
'dump_modules',
'', 7,
true);
90 $ele->addOptionArray($moduleslist);
91 $dump_tray->addElement($ele);
92 $form_dump->addElement($dump_tray);
100 $xoopsTpl->assign(
'form_maintenance', $form_maintenance->render());
101 $xoopsTpl->assign(
'form_dump', $form_dump->render());
104 case 'maintenance_save':
106 if ( !
$GLOBALS[
'xoopsSecurity']->check() ) {
119 $verif_cache =
false;
120 $verif_session =
false;
121 $verif_maintenance =
false;
122 $result_cache =
false;
123 $result_session =
false;
124 $result_maintenance =
false;
130 if($maintenance->CleanCache(
$_REQUEST[
'cache'])) {
131 $result_cache =
true;
137 if ( $session == 1 ) {
138 $verif_session =
true;
139 if($maintenance->CleanSession()) {
140 $result_session =
true;
145 $verif_maintenance =
true;
146 if(!empty($tables_op)) {
147 $result_maintenance = $maintenance->CheckRepairAnalyzeOptimizeQueries(
$tables, $tables_op);
151 if( $result_cache ==
false && $result_session ==
false && $result_maintenance ==
false ) {
155 $xoopsTpl->assign(
'verif_cache', $verif_cache);
156 $xoopsTpl->assign(
'verif_session', $verif_session);
157 $xoopsTpl->assign(
'verif_maintenance', $verif_maintenance);
158 $xoopsTpl->assign(
'result_cache', $result_cache);
159 $xoopsTpl->assign(
'result_session', $result_session);
160 $xoopsTpl->assign(
'result_maintenance', $result_maintenance);
166 if ( !
$GLOBALS[
'xoopsSecurity']->check() ) {
180 if( ( $dump_tables ==
true && $dump_modules ==
true ) || ( $dump_tables ==
false && $dump_modules ==
false ) ) {
184 if( $dump_tables !=
false ) {
185 $result = $dump->dump_tables($dump_tables, $drop);
186 }
else if ( $dump_modules !=
false ) {
187 $result = $dump->dump_modules($dump_modules, $drop);