PEAK XOOPS - News in englishin japanese

Archive | RSS |
  
Poster : GIJOE on 2008-09-06 06:02:40 (8864 reads)

in englishin japanese
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);

to

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);


This code can work with X2, XCL2.1, ImpressCMS, and perhaps XOOPS 2.3 from xoops.org

Perhaps, almost all D3 modules use the handler.
This means that altsys >= 0.61 is required.

Appendix:
This D3NotificationHandler searches the "mail_template" from following paths.

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/

0 comments

Poster : GIJOE on 2008-08-30 18:39:38 (8257 reads)

in englishin japanese
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)


Poster : GIJOE on 2008-08-30 06:31:19 (21775 reads)

in englishin japanese
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=...


Poster : GIJOE on 2008-06-22 17:39:28 (12909 reads)

in englishin japanese
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 ;
        }
    }
}

Of course, this preload is only for XCL2.1
And the XCL2.1 must have all of three preloads in the folder of preload.

MultiLanguageCompatibleEMLH.class.php
MultiLanguagePostMerger.class.php
MultiLanguagePreLoad.class.php

Then, all you have to do is just editing the template of the form.

This feature might be an innovation of the multilanguage functions in XOOPS.
Because it provides the same interfaces as native M17Ned applications like osCommerce.


Poster : GIJOE on 2008-06-20 11:49:48 (10697 reads)

in englishin japanese
Novices cannot input language tags skillfully.


[en]English[/en][ja]Japanese[/ja]


EMLH 1.30 supports such users to be able to input multilanguage strings easily.
http://xoops.peak.ne.jp/md/mydownloads/singlefile.php?lid=50&cid=2

eg) with pico module, edit the template of *_main_content_form.html

<input type="text" name="subject" id="subject" size="80" maxlength="255" value="<{$content.subject}>" />

will be divided two <input>s like this:

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"}>" />


Note the filter easiestml|"(langtag)" in value.

Next time, I'll release a preload version of this feature for XCL2.1 with cubeUtils.

0 comments

« 1 2 3 (4) 5 6 7 ... 37 »
Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!