1
I found an error in the function xoops_getModuleOption().
The module
MYMODULE1 configuration is
IMGDIR.
The module
MYMODULE2 configuration is
IMGDIR.
The names of the modules are the same configurations.
If both call functions
$conf1 = xoops_getModuleOption( '
IMGDIR', '
MYMODULE1' );
$conf2 = xoops_getModuleOption( '
IMGDIR', '
MYMODULE2' );
then the last call will return the configuration of the first module
I corrected this error. The code below:
function xoops_getModuleOption($option, $dirname = '')
{
static $modOptions = array();
if (is_array($modOptions) && isset($modOptions[$dirname][$option])) {
return $modOptions[$dirname][$option];
}
$ret = false;
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname($dirname);
$config_handler =& xoops_gethandler('config');
if (is_object($module)) {
$moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
if (isset($moduleConfig[$option])) {
$ret = $moduleConfig[$option];
}
}
$modOptions[$dirname][$option] = $ret;
return $ret;
}