XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
page_moduleinstaller.php
Go to the documentation of this file.
1
<?php
2
/*
3
You may not change or alter any portion of this comment or credits
4
of supporting developers from this source code or any supporting source code
5
which is considered copyrighted (c) material of the original comment or credit authors.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
25
$xoopsOption
[
'checkadmin'
] =
true
;
26
$xoopsOption
[
'hascommon'
] =
true
;
27
28
require_once __DIR__ .
'/include/common.inc.php'
;
29
30
$xoops
=
Xoops::getInstance
();
31
32
/* @var $wizard XoopsInstallWizard */
33
$wizard
=
$_SESSION
[
'wizard'
];
34
$pageHasForm
=
true
;
35
36
if
(
$_SERVER
[
'REQUEST_METHOD'
] ==
'POST'
) {
37
$xoops
->loadLocale(
'system'
);
38
include_once XOOPS_ROOT_PATH .
"/modules/system/class/module.php"
;
39
include_once XOOPS_ROOT_PATH .
"/modules/system/class/system.php"
;
40
41
$system_module
=
new
SystemModule
();
42
$system
=
System::getInstance
();
43
44
$msgs = array();
45
foreach
($_REQUEST[
'modules'
] as
$dirname
=> $installmod) {
46
if
($installmod) {
47
$msgs[] =
$system_module
->install(
$dirname
);
48
}
49
}
50
51
$pageHasForm
=
false
;
52
53
if
(count($msgs) > 0) {
54
$content
=
"<div class='x2-note successMsg'>"
.
INSTALLED_MODULES
.
"</div><ul class='log'>"
;
55
foreach
($msgs as
$msg
) {
56
$tempvar
= $msg->modinfo[
'name'
];
57
$content
.=
"<dt>{$tempvar}</dt>"
;
58
}
59
$content
.=
"</ul>"
;
60
}
else
{
61
$content
=
"<div class='x2-note confirmMsg'>"
.
NO_INSTALLED_MODULES
.
"</div>"
;
62
}
63
64
//Reset module lists in cache folder
65
$xoops
->cache()->delete(
'system/modules'
);
66
$xoops
->setActiveModules();
67
}
else
{
68
if
(!
$xoops
->getConfig(
'locale'
)) {
69
$xoops
->setConfig(
'locale'
, $_COOKIE[
'xo_install_lang'
]);
70
}
71
$xoops
->loadLocale(
'system'
);
72
73
include_once XOOPS_ROOT_PATH .
"/modules/system/class/module.php"
;
74
include_once XOOPS_ROOT_PATH .
"/modules/system/class/system.php"
;
75
76
$system
=
System::getInstance
();
77
// Get installed modules
78
$system_module
=
new
SystemModule
();
79
80
$dirlist
=
$system_module
->getInstalledModules();
81
$toinstal
= 0;
82
83
$javascript
=
""
;
84
$content
=
"<ul class='log'><li style='background: none;'>"
;
85
$content
.=
"<table class='module'>\n"
;
86
/* @var $module XoopsModule */
87
foreach
(
$dirlist
as
$module
) {
88
clearstatcache();
89
$value = 0;
90
$style =
""
;
91
if
(in_array($module->getInfo(
'dirname'
),
$wizard
->configs[
'modules'
])) {
92
$value = 1;
93
$style =
" style='background-color:#E6EFC2;'"
;
94
}
95
$form
=
new
Xoops\Form\ThemeForm
(
''
,
'modules'
,
'index.php'
,
'post'
);
96
$moduleYN =
new
Xoops\Form\RadioYesNo
(
''
,
'modules['
. $module->getInfo(
'dirname'
) .
']'
, $value,
XoopsLocale::YES
,
XoopsLocale::NO
);
97
$moduleYN->
setExtra
(
"onclick='selectModule(\""
. $module->getInfo(
'dirname'
) .
"\", this)'"
);
98
$form
->addElement($moduleYN);
99
100
$content
.=
"<tr id='"
. $module->getInfo(
'dirname'
) .
"'"
. $style .
">\n"
;
101
$content
.=
" <td class='img' ><img src='"
. XOOPS_URL .
"/modules/"
. $module->getInfo(
'dirname'
) .
"/"
. $module->getInfo(
'image'
) .
"' alt='"
. $module->getInfo(
'name'
) .
"'/></td>\n"
;
102
$content
.=
" <td>"
;
103
$content
.=
" "
. $module->getInfo(
'name'
) .
" "
. number_format(round($module->getInfo(
'version'
), 2), 2) .
" ("
. $module->getInfo(
'dirname'
) .
")"
;
104
$content
.=
" <br />"
. $module->getInfo(
'description'
);
105
$content
.=
" </td>\n"
;
106
$content
.=
" <td class='yesno'>"
;
107
$content
.= $moduleYN->render();
108
$content
.=
" </td></tr>\n"
;
109
++
$toinstal
;
110
}
111
$content
.=
"</table>"
;
112
$content
.=
"</li></ul><script type='text/javascript'>"
.
$javascript
.
"</script>"
;
113
if
(
$toinstal
== 0) {
114
$pageHasForm
=
false
;
115
$content
=
"<div class='x2-note confirmMsg'>"
.
NO_MODULES_FOUND
.
"</div>"
;
116
}
117
}
118
119
$_SESSION
[
'pageHasHelp'
] =
false
;
120
$_SESSION
[
'pageHasForm'
] =
$pageHasForm
;
121
$_SESSION
[
'content'
] =
$content
;
122
include
XOOPS_INSTALL_PATH
.
'/include/install_tpl.php'
;
$tempvar
$tempvar
Definition:
page_theme.php:58
$toinstal
$toinstal
Definition:
page_moduleinstaller.php:81
NO_MODULES_FOUND
const NO_MODULES_FOUND
Definition:
install.php:199
INSTALLED_MODULES
const INSTALLED_MODULES
Definition:
install.php:198
System\getInstance
static getInstance()
Definition:
system.php:46
$_SESSION
if($toinstal==0) $_SESSION['pageHasHelp']
Definition:
page_moduleinstaller.php:119
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
$pageHasForm
$pageHasForm
Definition:
page_moduleinstaller.php:34
$_SERVER
$_SERVER['REQUEST_URI']
Definition:
comment_delete.php:23
$dirlist
$dirlist
Definition:
page_moduleinstaller.php:80
Xoops\Form\RadioYesNo
Definition:
RadioYesNo.php:27
$form
$form
Definition:
xoops_code.php:21
Xoops\Form\ThemeForm
Definition:
ThemeForm.php:27
$wizard
$wizard
Definition:
page_moduleinstaller.php:33
SystemModule
$xoopsOption
$xoopsOption['checkadmin']
Definition:
page_moduleinstaller.php:25
$system
$system
Definition:
page_moduleinstaller.php:76
XOOPS_INSTALL_PATH
const XOOPS_INSTALL_PATH
Definition:
common.inc.php:33
$module
$module
Definition:
main.php:52
include
$content
$content
Definition:
page_moduleinstaller.php:84
$msg
if(!is_object($module)||!$module->getVar('isactive')) $msg
Definition:
groupperm.php:38
$dirname
$dirname
Definition:
backend.php:38
Xoops\Form\Element\setExtra
setExtra($extra, $replace=false)
Definition:
Element.php:522
XoopsLocaleEn_US\YES
const YES
Definition:
en_US.php:1106
$javascript
$javascript
Definition:
page_moduleinstaller.php:83
$xoops
$xoops
Definition:
page_moduleinstaller.php:30
XoopsLocaleEn_US\NO
const NO
Definition:
en_US.php:857
NO_INSTALLED_MODULES
const NO_INSTALLED_MODULES
Definition:
install.php:200
$system_module
$system_module
Definition:
page_moduleinstaller.php:78
usr64
htdocs
install
page_moduleinstaller.php
Generated on Fri May 22 2015 03:07:02 for XOOPS by
1.8.9.1