XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
functions.config.php
Go to the documentation of this file.
1
<?php
14
if
(!defined(
"FRAMEWORKS_ART_FUNCTIONS_CONFIG"
)):
15
define(
"FRAMEWORKS_ART_FUNCTIONS_CONFIG"
,
true
);
16
23
function
mod_loadConfig
(
$dirname
=
""
)
24
{
25
$xoops
=
Xoops::getInstance
();
26
if
(empty(
$dirname
) && !
$xoops
->isModule()) {
27
return
null;
28
}
29
$dirname
= !empty(
$dirname
) ?
$dirname
:
$xoops
->module->getVar(
"dirname"
);
30
31
if
(
$xoops
->isModule() &&
$xoops
->module->getVar(
"dirname"
,
"n"
) ==
$dirname
) {
32
if
(!empty(
$xoops
->moduleConfig)) {
33
$moduleConfig =
$xoops
->moduleConfig;
34
}
else
{
35
return
null;
36
}
37
}
else
{
38
39
if
(!$moduleConfig =
Xoops_Cache::read
(
"{$dirname}_config"
)) {
40
$moduleConfig =
mod_fetchConfig
(
$dirname
);
41
Xoops_Cache::write
(
"{$dirname}_config"
, $moduleConfig);
42
}
43
}
44
if
($customConfig = @
include
\
XoopsBaseConfig::get
(
'root-path'
) .
"/modules/{$dirname}/include/plugin.php"
) {
45
$moduleConfig = array_merge($moduleConfig, $customConfig);
46
}
47
return
$moduleConfig;
48
}
49
54
function
mod_loadConfg
(
$dirname
=
""
)
55
{
56
return
mod_loadConfig
(
$dirname
);
57
}
58
65
function
mod_fetchConfig
(
$dirname
=
""
)
66
{
67
if
(empty(
$dirname
)) {
68
return
null;
69
}
70
71
$xoops
=
Xoops::getInstance
();
72
if
(!
$module
=
$xoops
->getModuleByDirname(
$dirname
)) {
73
trigger_error(
"Module '{$dirname}' does not exist"
, E_USER_WARNING);
74
return
null;
75
}
76
$config_handler
=
$xoops
->getHandlerConfig();
77
$criteria
=
new
CriteriaCompo
(
new
Criteria
(
'conf_modid'
,
$module
->getVar(
'mid'
)));
78
$configs
=
$config_handler
->getConfigs(
$criteria
);
79
$moduleConfig = array();
80
foreach
(array_keys(
$configs
) as
$i
) {
81
$moduleConfig[
$configs
[
$i
]->getVar(
'conf_name'
)] = $configs[
$i
]->getConfValueForOutput();
82
}
83
unset(
$module
,
$configs
);
84
85
return
$moduleConfig;
86
}
87
88
function
mod_fetchConfg
(
$dirname
=
""
)
89
{
90
return
mod_fetchConfig
(
$dirname
);
91
}
92
100
function
mod_clearConfig
(
$dirname
=
""
)
101
{
102
if
(empty(
$dirname
)) {
103
return
false
;
104
}
105
106
107
return
Xoops_Cache::delete
(
"{$dirname}_config"
);
108
}
109
110
function
mod_clearConfg
(
$dirname
=
""
)
111
{
112
return
mod_clearConfig
(
$dirname
);
113
}
114
115
endif
;
mod_clearConfig
mod_clearConfig($dirname="")
Definition:
functions.config.php:100
$i
$i
Definition:
dialog.php:68
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
mod_clearConfg
mod_clearConfg($dirname="")
Definition:
functions.config.php:110
Xoops\Core\Cache\Legacy\read
static read($key)
Definition:
Legacy.php:94
$xoops
$xoops
Definition:
admin.php:25
mod_loadConfig
mod_loadConfig($dirname="")
Definition:
functions.config.php:23
$config_handler
if($_SERVER['REQUEST_METHOD']== 'POST') $config_handler
Definition:
page_configsite.php:51
XoopsBaseConfig\get
static get($name)
Definition:
XoopsBaseConfig.php:117
mod_loadConfg
mod_loadConfg($dirname="")
Definition:
functions.config.php:54
$module
$module
Definition:
main.php:52
$configs
$configs
Definition:
config.php:27
include
Xoops\Core\Cache\Legacy\write
static write($key, $value, $duration=0)
Definition:
Legacy.php:76
$criteria
$criteria
Definition:
page_configsite.php:52
$dirname
$dirname
Definition:
backend.php:38
endif
endif
Definition:
functions.config.php:115
CriteriaCompo
Definition:
criteria.php:22
Criteria
Definition:
criteria.php:29
Xoops\Core\Cache\Legacy\delete
static delete($key)
Definition:
Legacy.php:108
mod_fetchConfg
mod_fetchConfg($dirname="")
Definition:
functions.config.php:88
mod_fetchConfig
mod_fetchConfig($dirname="")
Definition:
functions.config.php:65
usr64
htdocs
Frameworks
art
functions.config.php
Generated on Fri May 22 2015 03:07:01 for XOOPS by
1.8.9.1