XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
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
24
function
mod_loadConfig
(
$dirname
=
""
)
25
{
26
if
(empty(
$dirname
) && empty(
$GLOBALS
[
"xoopsModule"
])) {
27
return
null;
28
}
29
$dirname
= !empty(
$dirname
) ?
$dirname
:
$GLOBALS
[
"xoopsModule"
]->getVar(
"dirname"
);
30
31
if
(isset(
$GLOBALS
[
"xoopsModule"
]) && is_object(
$GLOBALS
[
"xoopsModule"
]) &&
$GLOBALS
[
"xoopsModule"
]->getVar(
"dirname"
,
"n"
) ==
$dirname
){
32
if
(isset(
$GLOBALS
[
"xoopsModuleConfig"
])) {
33
$moduleConfig =&
$GLOBALS
[
"xoopsModuleConfig"
];
34
}
else
{
35
return
null;
36
}
37
}
else
{
38
xoops_load
(
'XoopsCache'
);
39
if
(!$moduleConfig =
XoopsCache::read
(
"{$dirname}_config"
)) {
40
$moduleConfig =
mod_fetchConfig
(
$dirname
);
41
XoopsCache::write
(
"{$dirname}_config"
, $moduleConfig);
42
}
43
}
44
if
($customConfig = @include XOOPS_ROOT_PATH .
"/modules/{$dirname}/include/plugin.php"
) {
45
$moduleConfig = array_merge($moduleConfig, $customConfig);
46
}
47
return
$moduleConfig;
48
}
49
50
function
mod_loadConfg
(
$dirname
=
""
)
51
{
52
return
mod_loadConfig
(
$dirname
);
53
}
54
62
function
mod_fetchConfig
(
$dirname
=
""
)
63
{
64
if
(empty(
$dirname
)) {
65
return
null;
66
}
67
68
$module_handler
=&
xoops_gethandler
(
'module'
);
69
if
(!
$module
=
$module_handler
->getByDirname(
$dirname
)) {
70
trigger_error(
"Module '{$dirname}' does not exist"
, E_USER_WARNING);
71
return
null;
72
}
73
74
$config_handler
=&
xoops_gethandler
(
'config'
);
75
$criteria
=
new
CriteriaCompo
(
new
Criteria
(
'conf_modid'
,
$module
->getVar(
'mid'
)));
76
$configs
=
$config_handler
->getConfigs(
$criteria
);
77
foreach
(array_keys(
$configs
) as
$i
) {
78
$moduleConfig[
$configs
[
$i
]->getVar(
'conf_name'
)] = $configs[
$i
]->getConfValueForOutput();
79
}
80
unset(
$module
,
$configs
);
81
82
return
$moduleConfig;
83
}
84
85
function
mod_fetchConfg
(
$dirname
=
""
)
86
{
87
return
mod_fetchConfig
(
$dirname
);
88
}
89
97
function
mod_clearConfig
(
$dirname
=
""
)
98
{
99
if
(empty(
$dirname
)) {
100
return
false
;
101
}
102
103
xoops_load
(
'XoopsCache'
);
104
return
XoopsCache::delete
(
"{$dirname}_config"
);
105
}
106
107
function
mod_clearConfg
(
$dirname
=
""
)
108
{
109
return
mod_clearConfig
(
$dirname
);
110
}
111
112
endif
;
113
?>
L:
0xoops
xoops-2.5.6
htdocs
Frameworks
art
functions.config.php
Generated on Fri May 10 2013 01:04:25 for XOOPS 2.5.6 by
1.8.3.1