Language constants overriding system for D3 modules

Date 2007-05-08 03:54:37 | Category: XOOPS

in englishin japanese
I had written language constants of D3 modules can be override by putting files under XOOPS_ROOT_PATH/modules/(dirname)/langauge/ from XOOPS_TRUST_PATH/modules/(trustdirname)/language/

But I found it is hard to use. (eg. Newly appended constants can be displayed its name instead of its value)

And I think CMS should be change its language constants not only via FTP but also "control panel".

Then, I've just implemented Language constants overriding system into altsys-0.5.

- mylangadmin
A controller called by each module's admin area. (like myblocksadmin or mytplsadmin)
This controller saves user values into DB(altsys_language_constants), then makes a cache file under XOOPS_ROOT_PATH/cache/

- D3LanguageManager
A singleton class for module/core on including language constants.
This class can be used like...

require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php' ;
$langman =& D3LanguageManager::getInstance() ;
$langman->read( 'main.php' , $mydirname , $mytrustdirname ) ;


At first, I've just added this feature into pico-1.31.
Let's try this. (Both altsys-0.5 and pico-1.31)

When the module increase its language constants, just update the cache via mylangadmin, again.

Perhaps, this overriding system can be used for almost modules running with XoopsCube Legacy 2.1 just by making a preload. (also, altsys should be modified a little)




You can read more news at PEAK XOOPS.
http://xoops.peak.ne.jp

The URL for this story is:
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=427