Index: trunk/admin/block_check.php
===================================================================
--- trunk/admin/block_check.php	(revision 169)
+++ trunk/admin/block_check.php	(revision 170)
@@ -30,6 +30,32 @@
 //include_once 'cp_functions.php';
 $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
-include_once('./../../../include/cp_header.php');
+require_once '../../../include/cp_header.php' ;
+//require_once '../include/gtickets.php' ;
+//define( '_MYMENU_CONSTANT_IN_MODINFO' , '_MI_TELLAFRIEND_MODNAME' ) ;
+
+// branch for altsys
+if( defined( 'XOOPS_TRUST_PATH' ) && ! empty( $_GET['lib'] ) ) {
+	$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+	$mydirpath = dirname( dirname( __FILE__ ) ) ;
+
+	// common libs (eg. altsys)
+	$lib = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , $_GET['lib'] ) ;
+	$page = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , @$_GET['page'] ) ;
+	
+	if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ) ) {
+		include XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ;
+	} else if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ) ) {
+		include XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ;
+	} else {
+		die( 'wrong request' ) ;
+	}
+	exit ;
+}
+
+//include_once('./menu.php');
+//include_once('./../../../include/cp_header.php');
 xoops_cp_header();
+include( './mymenu.php' ) ;
+
 include_once(dirname(__FILE__) . '/../class/check_blocks_class.php');
 
Index: trunk/admin/index.php
===================================================================
--- trunk/admin/index.php	(revision 169)
+++ trunk/admin/index.php	(revision 170)
@@ -104,5 +104,5 @@
 	if ($is_report) {
 		echo "******** "  . _AM_XPRESS_PLUGIN . "********" . "<br />\n";
-		echo get_xpress_active_plugin_list('') . "<br />\n";
+		echo get_xpress_active_plugin_list('&emsp;') . "<br />\n";
 	} else {
 		echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XPRESS_PLUGIN . "</legend>";
@@ -121,61 +121,61 @@
 	if ($is_report) {
 		echo "******** "  . _AM_SYSTEM_INFO . "********" . "<br />\n";
-		echo  "SERVER:  ". $_SERVER['SERVER_SOFTWARE']. "<br />\n";
-		echo  "PHP Version:   " . phpversion() . "<br />\n";
-		echo  "MySQL Version:   " . mysql_get_server_info() . "</text><br />";
-		echo  "XOOPS Version:   " . XOOPS_VERSION . "</text><br />";
-		echo  "XPressME Version:   " . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "<br />\n";
-		echo  "WordPress Version:   " . $wp_version . "<br />\n";
-		echo  "WP DB Version:   " . $wp_db_version . "<br />\n";
-		echo "<br />\n";
-		echo  "safemode:   " ;
+		echo '&emsp;' . "SERVER:  ". $_SERVER['SERVER_SOFTWARE']. "<br />\n";
+		echo '&emsp;' . "PHP Version:   " . phpversion() . "<br />\n";
+		echo '&emsp;' . "MySQL Version:   " . mysql_get_server_info() . "</text><br />";
+		echo '&emsp;' . "XOOPS Version:   " . XOOPS_VERSION . "</text><br />";
+		echo '&emsp;' . "XPressME Version:   " . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "<br />\n";
+		echo '&emsp;' . "WordPress Version:   " . $wp_version . "<br />\n";
+		echo '&emsp;' . "WP DB Version:   " . $wp_db_version . "<br />\n";
+		echo "<br />\n";
+		echo '&emsp;' . "safemode:   " ;
 		echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF";
 		echo "<br />\n";
-		echo  "register_globals:   " ;
+		echo '&emsp;' . "register_globals:   " ;
 		echo ( ini_get( 'register_globals' )) ? "ON" : "OFF" ;
 		echo "<br />\n";
-		echo  "magic_quotes_gpc:   " ;
+		echo '&emsp;' . "magic_quotes_gpc:   " ;
 		echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF";
 		echo "<br />\n";
-		echo  "XML extension:   " ;
+		echo '&emsp;' . "XML extension:   " ;
 		echo ( extension_loaded( 'xml' )) ? "ON" : "OFF";
 		echo "<br />\n";
-		echo  "memory_limit:   " ;
+		echo '&emsp;' . "memory_limit:   " ;
 		echo  ini_get( 'memory_limit' );
 		echo "<br />\n";
-		echo  "post_max_size:   " ;
+		echo '&emsp;' . "post_max_size:   " ;
 		echo  ini_get( 'post_max_size' );
 		echo "<br />\n";
-		echo  "upload_max_filesize:   " ;
+		echo '&emsp;' . "upload_max_filesize:   " ;
 		echo  ini_get( 'upload_max_filesize' );
 		echo "<br />\n";
-		echo  "display_errors:   " ;
+		echo '&emsp;' . "display_errors:   " ;
 		echo ( ini_get( 'display_errors' )) ? "ON" : "OFF";
 		echo "<br />\n";
-		echo  "MB extension:   " ;
+		echo '&emsp;' . "MB extension:   " ;
 		echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF";
 		echo "<br />\n";
-		echo  "mbstring.language:   " ;
+		echo '&emsp;' . "mbstring.language:   " ;
 		echo  ini_get( 'mbstring.language' );
 		echo "<br />\n";
-		echo  "mbstring.encoding_translation:   " ;
+		echo '&emsp;' . "mbstring.encoding_translation:   " ;
 		echo  ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF";
 		echo "<br />\n";
-		echo  "mbstring.internal_encoding:   " ;
+		echo '&emsp;' . "mbstring.internal_encoding:   " ;
 		echo  ini_get( 'mbstring.internal_encoding' );
 		echo "<br />\n";
-		echo  "mbstring.http_input:   " ;
+		echo '&emsp;' . "mbstring.http_input:   " ;
 		echo  ini_get( 'mbstring.http_input' );
 		echo "<br />\n";
-		echo  "mbstring.http_output:   " ;
+		echo '&emsp;' . "mbstring.http_output:   " ;
 		echo  ini_get( 'mbstring.http_output' );
 		echo "<br />\n";
-		echo  "mbstring.detect_order:   " ;
+		echo '&emsp;' . "mbstring.detect_order:   " ;
 		echo  ini_get( 'mbstring.detect_order' );
 		echo "<br />\n";
-		echo  "mbstring.substitute_character:   " ;
+		echo '&emsp;' . "mbstring.substitute_character:   " ;
 		echo  ini_get( 'mbstring.substitute_character' );
 		echo "<br />\n";
-		echo  "mbstring.func_overload:   " ;
+		echo '&emsp;' . "mbstring.func_overload:   " ;
 		echo  ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF";
 		echo "<br />\n";
@@ -256,5 +256,5 @@
 	if ($is_report) {
 		echo "******** "  . _AM_XOOPS_CONFIG_INFO . "********" . "<br />\n";
-		echo  'XOOPS_ROOT_PATH:  ' ; 
+		echo '&emsp;' . 'XOOPS_ROOT_PATH:  ' ; 
 		if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)
 			echo 'ERROR ';
@@ -263,5 +263,5 @@
 		echo "<br />\n";
 
-		echo  'XOOPS_TRUST_PATH:  ' ; 
+		echo '&emsp;' . 'XOOPS_TRUST_PATH:  ' ; 
 		if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)
 			echo 'ERROR ';
@@ -270,5 +270,5 @@
 		echo "<br />\n";
 
-		echo  'XOOPS_URL:  ' ; 
+		echo '&emsp;' . 'XOOPS_URL:  ' ; 
 		if(XOOPS_URL !== $xoops_config->xoops_url)
 			echo 'ERROR ';
@@ -278,5 +278,5 @@
 
 		if (defined('XOOPS_SALT')){
-			echo  'XOOPS_SALT:  ' ; 
+			echo '&emsp;' . 'XOOPS_SALT:  ' ; 
 			if(XOOPS_SALT !== $xoops_config->xoops_salt)
 				echo 'ERROR ';
@@ -287,5 +287,5 @@
 
 		if (defined('XOOPS_DB_SALT')){
-			echo  'XOOPS_DB_SALT:  ' ; 
+			echo '&emsp;' . 'XOOPS_DB_SALT:  ' ; 
 			if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)
 				echo 'ERROR ';
@@ -295,5 +295,5 @@
 		}
 
-		echo  'XOOPS_DB_HOST:  ' ; 
+		echo '&emsp;' . 'XOOPS_DB_HOST:  ' ; 
 		if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)
 			echo 'ERROR ';
@@ -302,5 +302,5 @@
 		echo "<br />\n";
 
-		echo  'XOOPS_DB_USER:  ' ; 
+		echo '&emsp;' . 'XOOPS_DB_USER:  ' ; 
 		if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)
 			echo 'ERROR ';
@@ -309,5 +309,5 @@
 		echo "<br />\n";
 
-		echo  'XOOPS_DB_PASS:  ' ; 
+		echo '&emsp;' . 'XOOPS_DB_PASS:  ' ; 
 		if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)
 			echo 'ERROR ';
@@ -316,5 +316,5 @@
 		echo "<br />\n";
 
-		echo  'XOOPS_DB_NAME:  ' ; 
+		echo '&emsp;' . 'XOOPS_DB_NAME:  ' ; 
 		if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)
 			echo 'ERROR ';
@@ -323,5 +323,5 @@
 		echo "<br />\n";
 
-		echo  'XOOPS_DB_PREFIX:  ' ; 
+		echo '&emsp;' . 'XOOPS_DB_PREFIX:  ' ; 
 		if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)
 			echo 'ERROR ';
@@ -473,7 +473,7 @@
 	if ($is_report){
 		echo "******** " . _AM_XPRESS_STATS . "********" . "<br />\n";
-		echo  _AM_XPRESS_CATEGORIES .":  ".@$count_category. "<br />\n";
-		echo  _AM_XPRESS_ARTICLES .":  ". $count_article. "<br />\n";
-		echo  _AM_XPRESS_AUTHORS .":  ". $count_author. "<br />\n";
+		echo '&emsp;' . _AM_XPRESS_CATEGORIES .":  ".@$count_category. "<br />\n";
+		echo '&emsp;' . _AM_XPRESS_ARTICLES .":  ". $count_article. "<br />\n";
+		echo '&emsp;' . _AM_XPRESS_AUTHORS .":  ". $count_author. "<br />\n";
 		
 	} else {
@@ -490,8 +490,31 @@
 	}
 }
-
-include_once('./../../../include/cp_header.php');
+require_once '../../../include/cp_header.php' ;
+//require_once '../include/gtickets.php' ;
+//define( '_MYMENU_CONSTANT_IN_MODINFO' , '_MI_TELLAFRIEND_MODNAME' ) ;
+
+// branch for altsys
+if( defined( 'XOOPS_TRUST_PATH' ) && ! empty( $_GET['lib'] ) ) {
+	$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+	$mydirpath = dirname( dirname( __FILE__ ) ) ;
+
+	// common libs (eg. altsys)
+	$lib = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , $_GET['lib'] ) ;
+	$page = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , @$_GET['page'] ) ;
+	
+	if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ) ) {
+		include XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ;
+	} else if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ) ) {
+		include XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ;
+	} else {
+		die( 'wrong request' ) ;
+	}
+	exit ;
+}
+
+//include_once('./menu.php');
+//include_once('./../../../include/cp_header.php');
 xoops_cp_header();
-
+include( './mymenu.php' ) ;
 echo "
 	<style type=\"text/css\">
Index: trunk/admin/menu.php
===================================================================
--- trunk/admin/menu.php	(revision 169)
+++ trunk/admin/menu.php	(revision 170)
@@ -46,6 +46,6 @@
 $adminmenu[$i++]['link'] = "admin/index.php";
 
-$adminmenu[$i]['title'] = _MI_MENU_BLOCK_ADMIN ;
-$adminmenu[$i++]['link'] = "admin/admin_blocks.php";
+//$adminmenu[$i]['title'] = _MI_MENU_BLOCK_ADMIN ;
+//$adminmenu[$i++]['link'] = "admin/admin_blocks.php";
 
 $adminmenu[$i]['title'] = _MI_MENU_BLOCK_CHECK ;
Index: trunk/admin/mymenu.php
===================================================================
--- trunk/admin/mymenu.php	(revision 170)
+++ trunk/admin/mymenu.php	(revision 170)
@@ -0,0 +1,112 @@
+<?php
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+if( empty( $mydirname ) ) $mydirname = basename(dirname(dirname(__FILE__))) ;
+
+if( ! defined( 'XOOPS_ORETEKI' ) ) {
+	// Skip for ORETEKI XOOPS
+
+	if( ! isset( $module ) || ! is_object( $module ) ) $module = $xoopsModule ;
+	else if( ! is_object( $xoopsModule ) ) die( '$xoopsModule is not set' )  ;
+
+	// load modinfo.php if necessary (judged by a specific constant is defined)
+	if( ! defined( '_MYMENU_CONSTANT_IN_MODINFO' ) || ! defined( _MYMENU_CONSTANT_IN_MODINFO ) ) {
+		if( file_exists("../language/".$xoopsConfig['language']."/modinfo.php") ) {
+			include_once("../language/".$xoopsConfig['language']."/modinfo.php");
+		} else {
+			include_once("../language/english/modinfo.php");
+		}
+	}
+
+	include( './menu.php' ) ;
+
+//	array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => '../system/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ;
+	$menuitem_dirname = $module->getvar('dirname') ;
+
+	if( defined( 'XOOPS_TRUST_PATH' ) ) {
+
+		// with XOOPS_TRUST_PATH and altsys
+
+		if( file_exists( XOOPS_TRUST_PATH.'/libs/altsys/mytplsadmin.php' ) ) {
+			// mytplsadmin (TODO check if this module has tplfile)
+			$title = defined( '_MD_A_MYMENU_MYTPLSADMIN' ) ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin' ;
+			array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mytplsadmin' ) ) ;
+		}
+
+		if( file_exists( XOOPS_TRUST_PATH.'/libs/altsys/myblocksadmin.php' ) ) {
+			// myblocksadmin
+			$title = defined( '_MD_A_MYMENU_MYBLOCKSADMIN' ) ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin' ;
+			array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin' ) ) ;
+		}
+
+		if( file_exists( XOOPS_TRUST_PATH.'/libs/altsys/mylangadmin.php' ) ) {
+			// mylangadmin
+			$title = defined( '_MD_A_MYMENU_MYLANGADMIN' ) ? _MD_A_MYMENU_MYLANGADMIN : 'langadmin' ;
+			array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mylangadmin' ) ) ;
+		}
+
+		// preferences
+		$config_handler =& xoops_gethandler('config');
+		if( count( $config_handler->getConfigs( new Criteria( 'conf_modid' , $module->mid() ) ) ) > 0 ) {
+			if( file_exists( XOOPS_TRUST_PATH.'/libs/altsys/mypreferences.php' ) ) {
+				// mypreferences
+				$title = defined( '_MD_A_MYMENU_MYPREFERENCES' ) ? _MD_A_MYMENU_MYPREFERENCES : _PREFERENCES ;
+				array_push( $adminmenu , array( 'title' => $title , 'link' => 'admin/index.php?mode=admin&lib=altsys&page=mypreferences' ) ) ;
+			} else if( defined( 'XOOPS_CUBE_LEGACY' ) ) {
+				// Cube Legacy without altsys
+				array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $module->getvar('mid') ) ) ;
+			} else {
+				// system->preferences
+				array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$module->mid() ) ) ;
+			}
+		}
+
+	} else if( defined( 'XOOPS_CUBE_LEGACY' ) ) {
+		// Cube Legacy without altsys
+		if( $module->getvar('hasconfig') ) array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $module->getvar('mid') ) ) ;
+	} else {
+		// conventinal X2
+		if( $module->getvar('hasconfig') ) array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ;
+	}
+
+	$mymenu_uri = empty( $mymenu_fake_uri ) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri ;
+	$mymenu_link = substr( strstr( $mymenu_uri , '/admin/' ) , 1 ) ;
+
+	// hilight
+	foreach( array_keys( $adminmenu ) as $i ) {
+		if( $mymenu_link == $adminmenu[$i]['link'] ) {
+			$adminmenu[$i]['color'] = '#FFCCCC' ;
+			$adminmenu_hilighted = true ;
+			$GLOBALS['altsysAdminPageTitle'] = $adminmenu[$i]['title'] ;
+		} else {
+			$adminmenu[$i]['color'] = '#DDDDDD' ;
+		}
+	}
+	if( empty( $adminmenu_hilighted ) ) {
+		foreach( array_keys( $adminmenu ) as $i ) {
+			if( stristr( $mymenu_uri , $adminmenu[$i]['link'] ) ) {
+				$adminmenu[$i]['color'] = '#FFCCCC' ;
+				$GLOBALS['altsysAdminPageTitle'] = $adminmenu[$i]['title'] ;
+				break ;
+			}
+		}
+	}
+
+	// link conversion from relative to absolute
+	foreach( array_keys( $adminmenu ) as $i ) {
+		if( stristr( $adminmenu[$i]['link'] , XOOPS_URL ) === false ) {
+			$adminmenu[$i]['link'] = XOOPS_URL."/modules/$mydirname/" . $adminmenu[$i]['link'] ;
+		}
+	}
+
+	// display
+	echo "<div style='text-align:left;width:98%;'>" ;
+	foreach( $adminmenu as $menuitem ) {
+		echo "<div style='float:left;height:1.5em;'><nobr><a href='".htmlspecialchars($menuitem['link'],ENT_QUOTES)."' style='background-color:{$menuitem['color']};font:normal normal bold 9pt/12pt;'>".htmlspecialchars($menuitem['title'],ENT_QUOTES)."</a> | </nobr></div>\n" ;
+	}
+	echo "</div>\n<hr style='clear:left;display:block;' />\n" ;
+
+}
+
+?>
Index: trunk/language/ja_utf8/admin.php
===================================================================
--- trunk/language/ja_utf8/admin.php	(revision 169)
+++ trunk/language/ja_utf8/admin.php	(revision 170)
@@ -3,4 +3,10 @@
 	define( 'XPRESS_ADMIN_LANG_INCLUDED' , 1 ) ;
 	
+// altsys
+	define('_MD_A_MYMENU_MYTPLSADMIN','テンプレート管理');
+	define('_MD_A_MYMENU_MYBLOCKSADMIN','アクセス権限');
+	define('_MD_A_MYMENU_MYLANGADMIN','言語定数管理');
+	define('_MD_A_MYMENU_MYPREFERENCES','一般設定');
+
 	define("_AM_SYSTEM_INFO","システム情報");
 	define("_AM_XOOPS_CONFIG_INFO","XPressMEがXOOPSより取得した設定値");
Index: trunk/xoops_version.php
===================================================================
--- trunk/xoops_version.php	(revision 169)
+++ trunk/xoops_version.php	(revision 170)
@@ -31,5 +31,5 @@
 $modversion['name'] = ucfirst($mydirname) . ' ' . constant('_MI_XPRESS_NAME') ;
 $modversion['description'] = constant( '_MI_XPRESS_DESC');
-$modversion['version'] = "0.29";
+$modversion['version'] = "0.30";
 $modversion['credits'] = "Wordpress DEV (http://wordpress.org/) XPressME DEV Toemon) (http://www.toemon.com) ;";
 $modversion['author'] = "toemon (http://www.toemon.com)";
@@ -40,5 +40,5 @@
 
 // status
-$modversion['codename'] = "r167";
+$modversion['codename'] = "r170";
 
 // onInstall, onUpdate, onUninstall
