예제 #1
0
 $ret = array();
 $write = false;
 $module = empty($_POST['module']) ? array() : $_POST['module'];
 foreach ($module as $mid) {
     if (isset($newstatus[$mid]) && $newstatus[$mid] == 1) {
         if ($oldstatus[$mid] == 0) {
             $ret[] = xoops_module_activate($mid);
         }
     } else {
         if ($oldstatus[$mid] == 1) {
             $ret[] = xoops_module_deactivate($mid);
         }
     }
     $newname[$mid] = trim($newname[$mid]);
     if ($oldname[$mid] != $newname[$mid]) {
         $ret[] = xoops_module_change($mid, $newname[$mid]);
         $write = true;
     }
 }
 if ($write) {
     // Flush cache files for cpanel GUIs
     xoops_load('cpanel', 'system');
     XoopsSystemCpanel::flush();
 }
 //Set active modules in cache folder
 xoops_setActiveModules();
 // Define main template
 $xoopsOption['template_main'] = 'system_modules_confirm.html';
 // Call Header
 xoops_cp_header();
 // Define Stylesheet
예제 #2
0
파일: main.php 프로젝트: koki-h/xoops_utf8
 }
 $ret = array();
 $write = false;
 foreach ($_POST['module'] as $mid) {
     if (isset($_POST['newstatus'][$mid]) && $_POST['newstatus'][$mid] == 1) {
         if ($_POST['oldstatus'][$mid] == 0) {
             $ret[] = xoops_module_activate($mid);
         }
     } else {
         if ($_POST['oldstatus'][$mid] == 1) {
             $ret[] = xoops_module_deactivate($mid);
         }
     }
     $newname[$mid] = trim($_POST['newname'][$mid]);
     if ($_POST['oldname'][$mid] != $_POST['newname'][$mid] || $_POST['oldweight'][$mid] != $_POST['weight'][$mid]) {
         $ret[] = xoops_module_change($mid, $_POST['weight'][$mid], $_POST['newname'][$mid]);
         $write = true;
     }
     flush();
 }
 if ($write) {
     $contents = xoops_module_get_admin_menu();
     if (!xoops_module_write_admin_menu($contents)) {
         $ret[] = "<p>" . _MD_AM_FAILWRITE . "</p>";
     }
 }
 xoops_cp_header();
 if (count($ret) > 0) {
     foreach ($ret as $msg) {
         if ($msg != '') {
             echo $msg;