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 "<br />test Option:&nbsp;<select size='1' name='options[0]'><option value='1'";
    if ( 
$xoopsModuleConfig['something'] == ) {
        
$form .= " selected";
    }
    
$form .= " />Yes</option><option value='0'";
    if ( 
$xoopsModuleConfig['something'] == ) {
        
$form .= " selected";
    }
    
$form .= " />No</option></select>";
    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

232 user(s) are online (125 user(s) are browsing Support Forums)


Members: 0


Guests: 232


more...

Donat-O-Meter

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

Latest GitHub Commits