| @@ 841-872 (lines=32) @@ | ||
| 838 | * @param string $repmodule |
|
| 839 | * @return bool |
|
| 840 | */ |
|
| 841 | public static function getModuleOption($option, $repmodule = 'lexikon') |
|
| 842 | { |
|
| 843 | global $xoopsModuleConfig, $xoopsModule; |
|
| 844 | static $tbloptions = array(); |
|
| 845 | if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) { |
|
| 846 | return $tbloptions[$option]; |
|
| 847 | } |
|
| 848 | ||
| 849 | $retval = false; |
|
| 850 | if (isset($xoopsModuleConfig) |
|
| 851 | && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule |
|
| 852 | && $xoopsModule->getVar('isactive')) |
|
| 853 | ) { |
|
| 854 | if (isset($xoopsModuleConfig[$option])) { |
|
| 855 | $retval = $xoopsModuleConfig[$option]; |
|
| 856 | } |
|
| 857 | } else { |
|
| 858 | /** @var XoopsModuleHandler $moduleHandler */ |
|
| 859 | $moduleHandler = xoops_getHandler('module'); |
|
| 860 | $module = $moduleHandler->getByDirname($repmodule); |
|
| 861 | $configHandler = xoops_getHandler('config'); |
|
| 862 | if ($module) { |
|
| 863 | $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
|
| 864 | if (isset($moduleConfig[$option])) { |
|
| 865 | $retval = $moduleConfig[$option]; |
|
| 866 | } |
|
| 867 | } |
|
| 868 | } |
|
| 869 | $tbloptions[$option] = $retval; |
|
| 870 | ||
| 871 | return $retval; |
|
| 872 | } |
|
| 873 | ||
| 874 | /** |
|
| 875 | * Is Xoops 2.3.x ? |
|
| @@ 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 ? |
|