1
xsell
How to us $xoopsModuleConfig inside a block Function
  • 2010/3/1 22:40

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


Hello

i want to use the Value of $xoopsModuleConfig['something']

inside a block function .. how so?

for example.

function b_something_blocks_show($options) {
global 
$xoopsDB$xoopsModuleConfig;
         
$block['test'] = $xoopsModuleConfig['something'];
         return 
$block;
 }
function 
b_something_blocks_edit($options) {

    
$form "test Option: ;
    if ( 
$xoopsModuleConfig['something'] == ) {
        
$form .= " selected";
    }
    
$form .= " />Yes;
    if ( 
$xoopsModuleConfig['something'] == ) {
        
$form .= " selected";
    }
    
$form .= " />No";
    return 
$form;
     }

2
andrey3761
Re: How to us $xoopsModuleConfig inside a block Function

$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('MyModule');
$config_handler =& xoops_gethandler('config');
if (
$module) {
    
$moduleConfig =& $config_handler->getConfigsByCat(0$module->getVar('mid'));
}
$block['test'] = $moduleConfig['something'];


Or for XOOPS 2.4.x

$block['test'] = xoops_getModuleOption('something''MyModule');

3
xsell
Re: How to us $xoopsModuleConfig inside a block Function
  • 2010/3/2 0:20

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


thx ..

WORKED VERY CHARM..

Login

Who's Online

369 user(s) are online (281 user(s) are browsing Support Forums)


Members: 0


Guests: 369


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits