| @@ 845-876 (lines=32) @@ | ||
| 842 | * @param string $repmodule |
|
| 843 | * @return bool |
|
| 844 | */ |
|
| 845 | public static function getModuleOption($option, $repmodule = 'lexikon') |
|
| 846 | { |
|
| 847 | global $xoopsModuleConfig, $xoopsModule; |
|
| 848 | static $tbloptions = array(); |
|
| 849 | if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) { |
|
| 850 | return $tbloptions[$option]; |
|
| 851 | } |
|
| 852 | ||
| 853 | $retval = false; |
|
| 854 | if (isset($xoopsModuleConfig) |
|
| 855 | && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule |
|
| 856 | && $xoopsModule->getVar('isactive')) |
|
| 857 | ) { |
|
| 858 | if (isset($xoopsModuleConfig[$option])) { |
|
| 859 | $retval = $xoopsModuleConfig[$option]; |
|
| 860 | } |
|
| 861 | } else { |
|
| 862 | /** @var XoopsModuleHandler $moduleHandler */ |
|
| 863 | $moduleHandler = xoops_getHandler('module'); |
|
| 864 | $module = $moduleHandler->getByDirname($repmodule); |
|
| 865 | $configHandler = xoops_getHandler('config'); |
|
| 866 | if ($module) { |
|
| 867 | $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
|
| 868 | if (isset($moduleConfig[$option])) { |
|
| 869 | $retval = $moduleConfig[$option]; |
|
| 870 | } |
|
| 871 | } |
|
| 872 | } |
|
| 873 | $tbloptions[$option] = $retval; |
|
| 874 | ||
| 875 | return $retval; |
|
| 876 | } |
|
| 877 | ||
| 878 | /** |
|
| 879 | * Is Xoops 2.3.x ? |
|
| @@ 440-466 (lines=27) @@ | ||
| 437 | } |
|
| 438 | ||
| 439 | //Retrieve moduleoptions equivalent to $Xoopsmoduleconfig |
|
| 440 | function lx_getmoduleoption($option, $repmodule='lexikon') { |
|
| 441 | global $xoopsModuleConfig, $xoopsModule; |
|
| 442 | static $tbloptions= Array(); |
|
| 443 | if (is_array($tbloptions) && array_key_exists($option,$tbloptions)) { |
|
| 444 | return $tbloptions[$option]; |
|
| 445 | } |
|
| 446 | ||
| 447 | $retval=false; |
|
| 448 | if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) { |
|
| 449 | if (isset($xoopsModuleConfig[$option])) { |
|
| 450 | $retval= $xoopsModuleConfig[$option]; |
|
| 451 | } |
|
| 452 | } else { |
|
| 453 | $module_handler = xoops_gethandler('module'); |
|
| 454 | $module = $module_handler->getByDirname($repmodule); |
|
| 455 | $config_handler = xoops_gethandler('config'); |
|
| 456 | if ($module) { |
|
| 457 | $moduleConfig = $config_handler->getConfigsByCat(0, $module->getVar('mid')); |
|
| 458 | if (isset($moduleConfig[$option])) { |
|
| 459 | $retval= $moduleConfig[$option]; |
|
| 460 | } |
|
| 461 | } |
|
| 462 | } |
|
| 463 | $tbloptions[$option]=$retval; |
|
| 464 | ||
| 465 | return $retval; |
|
| 466 | } |
|
| 467 | ||
| 468 | /** |
|
| 469 | * Is Xoops 2.3.x ? |
|