Code Duplication    Length = 8-9 lines in 2 locations

include/functions.php 2 locations

@@ 20-28 (lines=9) @@
17
function sf_getModuleInfo()
18
{
19
    static $smartModule;
20
    if (!isset($smartModule)) {
21
        global $xoopsModule;
22
        if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') === 'smartfaq') {
23
            $smartModule = $xoopsModule;
24
        } else {
25
            $hModule     = xoops_getHandler('module');
26
            $smartModule = $hModule->getByDirname('smartfaq');
27
        }
28
    }
29
30
    return $smartModule;
31
}
@@ 41-48 (lines=8) @@
38
    static $smartConfig;
39
    if (!$smartConfig) {
40
        global $xoopsModule;
41
        if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') === 'smartfaq') {
42
            global $xoopsModuleConfig;
43
            $smartConfig = $xoopsModuleConfig;
44
        } else {
45
            $smartModule = sf_getModuleInfo();
46
            $hModConfig  = xoops_getHandler('config');
47
            $smartConfig = $hModConfig->getConfigsByCat(0, $smartModule->getVar('mid'));
48
        }
49
    }
50
51
    return $smartConfig;