XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
page_extensioninstaller.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
20
$xoopsOption
[
'checkadmin'
] =
true
;
21
$xoopsOption
[
'hascommon'
] =
true
;
22
23
require_once __DIR__ .
'/include/common.inc.php'
;
24
25
$xoops
=
Xoops::getInstance
();
26
27
/* @var $wizard XoopsInstallWizard */
28
$wizard
=
$_SESSION
[
'wizard'
];
29
$pageHasForm
=
true
;
30
31
if
(
$_SERVER
[
'REQUEST_METHOD'
] ==
'POST'
) {
32
$xoops
->loadLocale(
'system'
);
33
include_once XOOPS_ROOT_PATH .
"/modules/system/class/module.php"
;
34
include_once XOOPS_ROOT_PATH .
"/modules/system/class/system.php"
;
35
36
$system
=
System::getInstance
();
37
38
$system_module
=
new
SystemModule
();
39
40
$msgs = array();
41
foreach
($_REQUEST[
'modules'
] as
$dirname
=> $installmod) {
42
if
($installmod) {
43
$msgs[] =
$system_module
->install(
$dirname
);
44
}
45
}
46
47
$pageHasForm
=
false
;
48
49
if
(count($msgs) > 0) {
50
$content
=
"<div class='x2-note successMsg'>"
.
INSTALLED_EXTENSION
.
"</div><ul class='log'>"
;
51
foreach
($msgs as
$msg
) {
52
if
($msg instanceof
XoopsModule
) {
53
$tempvar
= $msg->modinfo[
'name'
];
54
$content
.=
"<dt>{$tempvar}</dt>"
;
55
}
56
}
57
$content
.=
"</ul>"
;
58
}
else
{
59
$content
=
"<div class='x2-note confirmMsg'>"
.
NO_INSTALLED_EXTENSION
.
"</div>"
;
60
}
61
62
//Reset module lists in cache folder
63
$xoops
->cache()->delete(
'system/modules'
);
64
$xoops
->setActiveModules();
65
}
else
{
66
if
(!
$xoops
->getConfig(
'locale'
)) {
67
$xoops
->setConfig(
'locale'
, $_COOKIE[
'xo_install_lang'
]);
68
}
69
$xoops
->loadLocale(
'system'
);
70
include_once XOOPS_ROOT_PATH .
"/modules/system/class/module.php"
;
71
include_once XOOPS_ROOT_PATH .
"/modules/system/class/extension.php"
;
72
include_once XOOPS_ROOT_PATH .
"/modules/system/class/system.php"
;
73
74
$system
=
System::getInstance
();
75
76
// Get installed modules
77
$system_module
=
new
SystemExtension
();
78
79
$dirlist
=
$system_module
->getInstalledExtensions();
80
$toinstal
= 0;
81
82
$javascript
=
""
;
83
$content
=
"<ul class='log'><li style='background: none;'>"
;
84
$content
.=
"<table class='module'>\n"
;
85
/* @var $ext XoopsModule */
86
foreach
(
$dirlist
as
$ext
) {
87
clearstatcache();
88
$value = 0;
89
$style =
""
;
90
91
if
(in_array($ext->getInfo(
'dirname'
),
$wizard
->configs[
'ext'
])) {
92
$value = 1;
93
$style =
" style='background-color:#E6EFC2;'"
;
94
}
95
96
$form
=
new
Xoops\Form\ThemeForm
(
''
,
'modules'
,
'index.php'
,
'post'
);
97
$moduleYN =
new
Xoops\Form\RadioYesNo
(
''
,
'modules['
. $ext->getInfo(
'dirname'
) .
']'
, $value,
XoopsLocale::YES
,
XoopsLocale::NO
);
98
$moduleYN->
setExtra
(
"onclick='selectModule(\""
. $ext->getInfo(
'dirname'
) .
"\", this)'"
);
99
$form
->addElement($moduleYN);
100
101
$content
.=
"<tr id='"
. $ext->getInfo(
'dirname'
) .
"'"
. $style .
">\n"
;
102
$content
.=
" <td class='img' ><img src='"
. XOOPS_URL .
"/modules/"
. $ext->getInfo(
'dirname'
) .
"/"
. $ext->getInfo(
'image'
) .
"' alt='"
. $ext->getInfo(
'name'
) .
"'/></td>\n"
;
103
$content
.=
" <td>"
;
104
$content
.=
" "
. $ext->getInfo(
'name'
) .
" "
. number_format(round($ext->getInfo(
'version'
), 2), 2) .
" ("
. $ext->getInfo(
'dirname'
) .
")"
;
105
$content
.=
" <br />"
. $ext->getInfo(
'description'
);
106
$content
.=
" </td>\n"
;
107
$content
.=
" <td class='yesno'>"
;
108
$content
.= $moduleYN->render();
109
$content
.=
" </td></tr>\n"
;
110
++
$toinstal
;
111
}
112
$content
.=
"</table>"
;
113
$content
.=
"</li></ul><script type='text/javascript'>"
.
$javascript
.
"</script>"
;
114
if
(
$toinstal
== 0) {
115
$pageHasForm
=
false
;
116
$content
=
"<div class='x2-note confirmMsg'>"
.
NO_EXTENSION_FOUND
.
"</div>"
;
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
$system
$system
Definition:
page_extensioninstaller.php:74
$pageHasForm
$pageHasForm
Definition:
page_extensioninstaller.php:29
System\getInstance
static getInstance()
Definition:
system.php:46
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
$wizard
$wizard
Definition:
page_extensioninstaller.php:28
SystemExtension
$_SERVER
$_SERVER['REQUEST_URI']
Definition:
comment_delete.php:23
INSTALLED_EXTENSION
const INSTALLED_EXTENSION
Definition:
install.php:202
Xoops\Form\RadioYesNo
Definition:
RadioYesNo.php:27
$form
$form
Definition:
xoops_code.php:21
$dirlist
$dirlist
Definition:
page_extensioninstaller.php:79
Xoops\Form\ThemeForm
Definition:
ThemeForm.php:27
SystemModule
XOOPS_INSTALL_PATH
const XOOPS_INSTALL_PATH
Definition:
common.inc.php:33
XoopsModule
Definition:
module.php:31
NO_EXTENSION_FOUND
const NO_EXTENSION_FOUND
Definition:
install.php:203
$ext
$ext
Definition:
browse.php:87
$content
$content
Definition:
page_extensioninstaller.php:83
include
$xoops
$xoops
Definition:
page_extensioninstaller.php:25
$system_module
$system_module
Definition:
page_extensioninstaller.php:77
$msg
if(!is_object($module)||!$module->getVar('isactive')) $msg
Definition:
groupperm.php:38
$dirname
$dirname
Definition:
backend.php:38
$javascript
$javascript
Definition:
page_extensioninstaller.php:82
Xoops\Form\Element\setExtra
setExtra($extra, $replace=false)
Definition:
Element.php:522
XoopsLocaleEn_US\YES
const YES
Definition:
en_US.php:1106
$_SESSION
if($toinstal==0) $_SESSION['pageHasHelp']
Definition:
page_extensioninstaller.php:119
$toinstal
$toinstal
Definition:
page_extensioninstaller.php:80
NO_INSTALLED_EXTENSION
const NO_INSTALLED_EXTENSION
Definition:
install.php:204
$xoopsOption
$xoopsOption['checkadmin']
Definition:
page_extensioninstaller.php:20
XoopsLocaleEn_US\NO
const NO
Definition:
en_US.php:857
usr64
htdocs
install
page_extensioninstaller.php
Generated on Fri May 22 2015 03:07:02 for XOOPS by
1.8.9.1