| @@ 564-590 (lines=27) @@ | ||
| 561 | } |
|
| 562 | ||
| 563 | //Retrieve moduleoptions equivalent to $Xoopsmoduleconfig |
|
| 564 | function lx_getmoduleoption($option, $repmodule='lexikon') { |
|
| 565 | global $xoopsModuleConfig, $xoopsModule; |
|
| 566 | static $tbloptions= []; |
|
| 567 | if (is_array($tbloptions) && array_key_exists($option,$tbloptions)) { |
|
| 568 | return $tbloptions[$option]; |
|
| 569 | } |
|
| 570 | ||
| 571 | $retval=false; |
|
| 572 | if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) { |
|
| 573 | if (isset($xoopsModuleConfig[$option])) { |
|
| 574 | $retval= $xoopsModuleConfig[$option]; |
|
| 575 | } |
|
| 576 | } else { |
|
| 577 | $module_handler = xoops_gethandler('module'); |
|
| 578 | $module = $module_handler->getByDirname($repmodule); |
|
| 579 | $config_handler = xoops_gethandler('config'); |
|
| 580 | if ($module) { |
|
| 581 | $moduleConfig = $config_handler->getConfigsByCat(0, $module->getVar('mid')); |
|
| 582 | if (isset($moduleConfig[$option])) { |
|
| 583 | $retval= $moduleConfig[$option]; |
|
| 584 | } |
|
| 585 | } |
|
| 586 | } |
|
| 587 | $tbloptions[$option]=$retval; |
|
| 588 | ||
| 589 | return $retval; |
|
| 590 | } |
|
| 591 | ||
| 592 | /** |
|
| 593 | * Is Xoops 2.3.x ? |
|
| @@ 857-888 (lines=32) @@ | ||
| 854 | * @param string $repmodule |
|
| 855 | * @return bool |
|
| 856 | */ |
|
| 857 | public static function getModuleOption($option, $repmodule = 'lexikon') |
|
| 858 | { |
|
| 859 | global $xoopsModuleConfig, $xoopsModule; |
|
| 860 | static $tbloptions = []; |
|
| 861 | if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) { |
|
| 862 | return $tbloptions[$option]; |
|
| 863 | } |
|
| 864 | ||
| 865 | $retval = false; |
|
| 866 | if (isset($xoopsModuleConfig) |
|
| 867 | && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule |
|
| 868 | && $xoopsModule->getVar('isactive')) |
|
| 869 | ) { |
|
| 870 | if (isset($xoopsModuleConfig[$option])) { |
|
| 871 | $retval = $xoopsModuleConfig[$option]; |
|
| 872 | } |
|
| 873 | } else { |
|
| 874 | /** @var XoopsModuleHandler $moduleHandler */ |
|
| 875 | $moduleHandler = xoops_getHandler('module'); |
|
| 876 | $module = $moduleHandler->getByDirname($repmodule); |
|
| 877 | $configHandler = xoops_getHandler('config'); |
|
| 878 | if ($module) { |
|
| 879 | $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
|
| 880 | if (isset($moduleConfig[$option])) { |
|
| 881 | $retval = $moduleConfig[$option]; |
|
| 882 | } |
|
| 883 | } |
|
| 884 | } |
|
| 885 | $tbloptions[$option] = $retval; |
|
| 886 | ||
| 887 | return $retval; |
|
| 888 | } |
|
| 889 | ||
| 890 | /** |
|
| 891 | * Is Xoops 2.3.x ? |
|