1
SMEDrieben
How are the modifo.php files loaded ?
  • 2015/2/7 12:43

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


I wonder how the modinfo.php language files are loaded. If I switch off the main menu block, the modinfo.php from the simplenewsletter module isn't loaded any more; if I switch on the main menu block, it again is. I can repair this problem by adding

require_once XOOPS_ROOT_PATH.'/modules/simplenewsletter/language/'.$xoopsConfig['language'].'/modinfo.php';


to several php-files of simplenewsletter, but I expect there is an easier way. E.g. the other modules don't have this problem after switching off the main menu. Are not all modinfo.php files loaded by function loadInfo in kernel/module.php ??

What is the appropriate way to load modinfo.php in the simplenewsletter module ?

Kind regards !

SMEDrieben

2
iHackCode
Re: How are the modifo.php files loaded ?

When the main menu loads the links it also loads the modinfo.php of each module in that menu *1.

Constants used in a block should be defined in \<yourmodule>\language<thelanguage>\blocks.php. That is loaded when the buildblocks() function is run on each module *2.

Within each module, the main.php language file is loaded automatically by the common.php *3. That is where these constants should be defined instead.

XOOPS 2.5.7.1
*1. the sublinks() function .http://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsCore/releases/2.5.7.1/htdocs/modules/system/blocks/system_blocks.php#l135

defined in:http://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsCore/releases/2.5.7.1/htdocs/kernel/module.php#l182

*2.http://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsCore/releases/2.5.7.1/htdocs/class/xoopsblock.php#l198

the xoops_loadLanguage() function loads the blocks language files automatically.

*3http://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsCore/releases/2.5.7.1/htdocs/include/common.php#l334
Hope that helps.

I dont know what is the best way. maybe add this to the header file in the module. $xoopsModule->loadInfo('simplenewsletter');

Login

Who's Online

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


Members: 0


Guests: 210


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