<?php
/**
 * @version $Id: main.php 679 2012-08-20 12:41:35Z hodaka $
 * @author  Takeshi Kuriyama <kuri@keynext.co.jp>
 */

$mytrustdirpath = dirname( __FILE__ ) ;

$page = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , @$_GET['page'] );

// Let's initiate module base
require $mytrustdirpath.'/include/prepend.inc.php';

require_once $mytrustdirpath.'/include/header.inc.php';

// language files
$langmanpath = XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php' ;
if( ! file_exists( $langmanpath ) ) die( 'install the latest altsys' ) ;
require_once( $langmanpath ) ;
$langman = D3LanguageManager::getInstance() ;
$langman->read( 'main.php' , $mydirname , $mytrustdirname ) ;

// fork to each pages
if( file_exists( "$mytrustdirpath/main/$page.php" ) ) {
    include "$mytrustdirpath/main/$page.php" ;
} else {
    include "$mytrustdirpath/main/index.php" ;
}


?>