XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
update.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
22
function
xoops_module_update_search
(
XoopsModule
&
$module
)
23
{
24
$xoops
=
Xoops::getInstance
();
25
// Copy old configs in new configs and delete old configs
26
$config_handler
=
$xoops
->getHandlerConfig();
27
$criteria
=
new
CriteriaCompo
();
28
$criteria
->add(
new
Criteria
(
'conf_modid'
, 0));
29
$criteria
->add(
new
Criteria
(
'conf_catid'
, 5));
30
$configs
=
$config_handler
->getConfigs(
$criteria
);
31
$confcount = count(
$configs
);
32
if
($confcount > 0) {
33
for
(
$i
= 0;
$i
< $confcount; ++
$i
) {
34
$criteria
=
new
CriteriaCompo
();
35
$criteria
->add(
new
Criteria
(
'conf_modid'
, $module->
getVar
(
'mid'
)));
36
$criteria
->add(
new
Criteria
(
'conf_name'
,
$configs
[
$i
]->getvar(
'conf_name'
)));
37
$new_configs =
$config_handler
->getConfigs(
$criteria
);
38
$new_confcount = count($new_configs);
39
if
($new_confcount > 0) {
40
for
(
$j
= 0;
$j
< $new_confcount; ++
$j
) {
41
$obj =
$config_handler
->getConfig($new_configs[
$j
]->getvar(
'conf_id'
));
42
}
43
$obj->setVar(
"conf_value"
,
$configs
[
$i
]->getvar(
'conf_value'
));
44
$config_handler
->insertConfig($obj);
45
$config_handler
->deleteConfig(
$configs
[
$i
]);
46
}
47
48
}
49
50
}
51
return
true
;
52
53
}
$i
$i
Definition:
dialog.php:68
xoops_module_update_search
xoops_module_update_search(XoopsModule &$module)
Definition:
update.php:22
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
Xoops\Core\Kernel\XoopsObject\getVar
getVar($key, $format= 's')
Definition:
XoopsObject.php:342
$module
$module
Definition:
update.php:55
XoopsModule
Definition:
module.php:31
$config_handler
if($_SERVER['REQUEST_METHOD']== 'POST') $config_handler
Definition:
page_configsite.php:51
$configs
$configs
Definition:
config.php:27
$criteria
$criteria
Definition:
page_configsite.php:52
CriteriaCompo
Definition:
criteria.php:22
Criteria
Definition:
criteria.php:29
$j
$j
Definition:
help.php:169
$xoops
$xoops
Definition:
update.php:23
usr64
htdocs
modules
search
include
update.php
Generated on Fri May 22 2015 03:07:04 for XOOPS by
1.8.9.1