We know D3 modules have a difficulty about Notification.
The NotificationHandler of X2 read the mail template only from
ROOT/modules/(dirname)/language/(lang)/mail_template/(mail_template).tpl
If there are no appropriate file, the event will be ignored.
We have to make custom function named (foo)_trigger_event like d3forum or pico.
This is not a good idea.
Then, I've writtein a common method to notify them from D3 modules, into altsys.
How to use:
Just change the code from
$notification_handler =& xoops_gethandler( 'notification' ) ;
$notification_handler->triggerEvent($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id);
require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3NotificationHandler.class.php' ;
$notification_handler =& D3NotificationHandler::getInstance();
$notification_handler->triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, $extra_tags, $user_list, $omit_user_id);
ROOT/modules/(mydirname)/language/$language/mail_template/
TRUST/modules/(mydirname)/language/$language/mail_template/
ROOT/modules/(mydirname)/language/english/mail_template/
TRUST/modules/(mydirname)/language/english/mail_template/
http://www.xugj.org/ is down now.
Wait till the server is reset by hardware level on Monday morning (JST).
(2008/9/1 XUGJ is recovered)
There are an important misunderstandings about D3 especially in Japan.
I made "Duplicatable" architecture for X2 system.
Then, a module only for XoopsCube Legacy cannot be called a D3 module, even if the module can be cloned easily.
D3 modules can work with XoopsCube Legacy2.1, XOOPS2-JP, ImpressCMS, and XOOPS from xoops.org (a bug patch needed).
This compatibility is quite important for me and you.
In XOOPS, there are some forked core.
It looks sad.
But they can be brother/friend each other if many modules can work with any cores.
I made/maintained my modules for whole XOOPS world, not for some specific forked cores. (Of course, XOOPS from xoops.org is just one of X2 forked cores)
Here is the definition of D3.
* Requirements
(1) X2 compatible
(2) dirname can be /^[0-9a-zA-Z_-]+$/
(3) Almost logics placed inside XOOPS_TRUST_PATH
(4) can be duplicated just by copy into ROOT/modules/. (No rewriting the source code)
(5) No logics in XOOPS_TRUST_PATH are duplicated.
* Recommendation
- Place ROOT/modules/(dirname)/mytrustdirname.php
- All tables are created as (prefix)_(dirname)_(table)
- All templates are created as (dirname)_(tplfile) into DB
- All Blocks are rendered by 'module' templates not by 'block' templates
- Almost blocks can be cloned (just set 'can_clone')
- can use D3Language Manager
- can use D3Comment Integration
You can read a great documentation "Creating a D3 module" by kentaro.
Original:
http://xoops.iko-ze.net/modules/pukiwiki/
Translated version by google:
http://translate.google.com/translate?u=http%3A%2F%2Fxoops.iko-ze.net%2Fmodules%2Fpukiwiki%2F&hl=...
I've just made a preload that makes cubeUtils can use the feature of form separation as EMLH-1.30
preload/MultiLanguagePostMerger.class.php
<?php
if (!defined('XOOPS_ROOT_PATH')) exit();
@include_once XOOPS_ROOT_PATH . '/modules/cubeUtils/class/MultiLanguage.class.php';
class MultiLanguagePostMerger extends XCube_ActionFilter
{
function preFilter()
{
if ( ! empty( $_POST ) && file_exists(XOOPS_ROOT_PATH.'/modules/cubeUtils/class/MultiLanguage.class.php')) {
// just after MultiLanguagePreLoad
$this->mController->mGetLanguageName->add(array(&$this, 'postMerger'),XCUBE_DELEGATE_PRIORITY_FINAL+1);
}
}
function postMerger()
{
global $cubeUtilMlang ;
if( is_object( $cubeUtilMlang ) ) $this->mergeRecursive( $_POST ) ;
}
function mergeRecursive( &$data )
{
global $cubeUtilMlang ;
$merged_string = '' ;
$langs_counter = 0 ;
foreach( array_keys( $data ) as $index ) {
if( is_array( $data[ $index ] ) ) {
$this->mergeRecursive( $data[ $index ] ) ;
} else if( in_array( $index , $cubeUtilMlang->mLanguages ) ) {
$merged_string .= '['.$index.']'.$data[ $index ].'[/'.$index.']' ;
$langs_counter ++ ;
}
}
if( $langs_counter == sizeof( $cubeUtilMlang->mLanguages ) ) {
$data = $merged_string ;
}
}
}
Novices cannot input language tags skillfully.
[en]English[/en][ja]Japanese[/ja]
<input type="text" name="subject" id="subject" size="80" maxlength="255" value="<{$content.subject}>" />
English:
<input type="text" name="subject[en]" id="subject[en]" size="80" maxlength="255" value="<{$content.subject|easiestml:"en"}>" />
Japanese:
<input type="text" name="subject[ja]" id="subject[ja]" size="80" maxlength="255" value="<{$content.subject|easiestml:"ja"}>" />