20 require_once
'./include/common.inc.php';
21 defined(
'XOOPS_INSTALL') or die('XOOPS Installation wizard die');
23 if (!@include_once "../language/{
$wizard->language}/global.php
") {
24 include_once "../language/english/global.php
";
26 if (!@include_once "../modules/system/language/{
$wizard->language}/admin/modulesadmin.php
") {
27 include_once "../modules/system/language/english/admin/modulesadmin.php
";
29 require_once '../class/xoopsformloader.php';
30 require_once '../class/xoopslists.php';
35 if ($_SERVER['REQUEST_METHOD'] == 'POST') {
36 include_once '../class/xoopsblock.php';
37 include_once '../kernel/module.php';
38 include_once '../include/cp_functions.php';
39 include_once '../include/version.php';
40 include_once './include/modulesadmin.php';
42 $config_handler =& xoops_gethandler('config');
43 $xoopsConfig =& $config_handler->getConfigsByCat(XOOPS_CONF);
46 foreach ($_REQUEST['modules'] as $dirname => $installmod) {
48 $msgs[] =& xoops_module_install($dirname);
54 if (count($msgs) > 0) {
55 $content = "<div
class=
'x2-note successMsg'>
" . INSTALLED_MODULES . "</div><ul
class=
'log'>
";
56 foreach ($msgs as $msg) {
57 $content .= "<dt>{
$msg}</dt>
";
61 $content = "<div
class=
'x2-note confirmMsg'>
" . NO_INSTALLED_MODULES . "</div>
";
64 // Flush cache files for cpanel GUIs
65 xoops_load("cpanel
", "system
");
66 XoopsSystemCpanel::flush();
68 //Set active modules in cache folder
69 xoops_setActiveModules();
71 if (!isset($GLOBALS['xoopsConfig']['language'])) {
72 $GLOBALS['xoopsConfig']['language'] = $_COOKIE['xo_install_lang'];
75 // Get installed modules
76 $module_handler =& xoops_gethandler('module');
77 $installed_mods =& $module_handler->getObjects();
78 $listed_mods = array();
79 foreach ($installed_mods as $module) {
80 $listed_mods[] = $module->getVar('dirname');
83 include_once '../class/xoopslists.php';
84 $dirlist = XoopsLists::getModulesList();
88 $content = "<ul
class=
'log'><li>
";
89 $content .= "<table
class=
'module'>\n
";
90 foreach ($dirlist as $file) {
92 if (!in_array($file, $listed_mods)) {
95 if (in_array($file, $wizard->configs['modules'])) {
97 $style = " style=
'background-color:#E6EFC2;'";
101 $module =& $module_handler->create();
102 if (!$module->loadInfo($file, false)) {
106 $form = new XoopsThemeForm('', 'modules', 'index.php', 'post');
107 $moduleYN = new XoopsFormRadioYN('', 'modules['. $module->getInfo('dirname') . ']', $value, _YES, _NO);
108 $moduleYN->setExtra( "onclick=
'selectModule(\"" . $file . "\", this)'" );
109 $form->addElement($moduleYN);
111 $content .= "<tr
id=
'" . $file . "'" . $style . ">\n
";
112 $content .= " <td
class=
'img' ><img src=
'" . XOOPS_URL . "/modules/" . $module->getInfo('dirname
') . "/" . $module->getInfo('image
') . "' alt=
'" . $module->getInfo('name
') . "'/></td>\n
";
114 $content .= " " . $module->getInfo('name') . "
" . number_format( round($module->getInfo('version'), 2), 2) . " (
" . $module->getInfo('dirname') . ")
";
115 $content .= " <br />
" . $module->getInfo('description');
116 $content .= " </td>\
n";
117 $content .= " <td
class=
'yesno'>
";
118 $content .= $moduleYN->render() ;
119 $content .= " </td></tr>\
n";
123 $content .= "</table>
";
124 $content .= "</li></ul><script type=
'text/javascript'>
" . $javascript . "</script>
";
125 if ($toinstal == 0) {
126 $pageHasForm = false;
127 $content = "<div
class=
'x2-note confirmMsg'>
" . NO_MODULES_FOUND . "</div>
";
131 include './include/install_tpl.php';