Index: branches/Ver3.0/xpressme_integration_kit/module_icon.php
===================================================================
--- branches/Ver3.0/xpressme_integration_kit/module_icon.php	(revision 740)
+++ branches/Ver3.0/xpressme_integration_kit/module_icon.php	(revision 741)
@@ -1,5 +1,7 @@
 <?php
+$xoopsOption['nocommon'] = true ;
+require '../../mainfile.php' ;
 $mydirpath = dirname(__FILE__);
-$mydirname = basename($mydirpath);
+$mydirname = basename(dirname(__FILE__));
 $icon_cache_limit = 3600 ; // default 3600sec == 1hour
 
@@ -10,13 +12,48 @@
 header("Content-type: image/png");
 
-$icon_fullpath = $mydirpath.'/module_icon.png' ;
+// file name
+if( ! empty( $_GET['file'] ) ) {
+	$file_base = preg_replace( '/[^0-9a-z_]/' , '' , $_GET['file'] ) ;
+} else {
+	$file_base = 'module_icon' ;
+}
 
-if(function_exists( 'imagecreatefrompng' ) && function_exists( 'imagecolorallocate' ) && function_exists( 'imagestring' ) && function_exists( 'imagepng' ) ) {
+// branches by cores
+if( defined( 'ICMS_TRUST_PATH' ) ) {
+	$draw_dirname = false ;
+	$file_base .= '_icms' ;
+} else if( defined( 'XOOPS_CUBE_LEGACY' ) ) {
+	$draw_dirname = true ;
+	$file_base .= '_xcl' ;
+	$title = '('.$mydirname.')';
+	$px = ( 112 - 6 * strlen( $title ) ) ;
+	$py = 14;
+	$font = 3;
+
+} else {
+	$draw_dirname = true ;
+	$title = $mydirname;
+	$px = ( 92 - 6 * strlen( $title ) ) / 2 ;
+	$py = 36;
+	$font = 3;
+}
+
+// icon files must be PNG
+$file = $file_base . '.png' ;
+
+// custom icon
+if( file_exists( $mydirpath.'/'.$file ) ) {
+	$draw_dirname = false ;
+	$icon_fullpath = $mydirpath.'/module_icon.png' ;
+} else {
+	$icon_fullpath = dirname(__FILE__).'/images/'.$file ;
+}
+
+if( $draw_dirname && function_exists( 'imagecreatefrompng' ) && function_exists( 'imagecolorallocate' ) && function_exists( 'imagestring' ) && function_exists( 'imagepng' ) ) {
 
 	$im = imagecreatefrompng( $icon_fullpath ) ;
 
 	$color = imagecolorallocate( $im , 0 , 0 , 0 ) ; // black
-	$px = ( 92 - 6 * strlen( $mydirname ) ) / 2 ;
-	imagestring( $im , 3 , $px , 34 , $mydirname , $color ) ;
+	imagestring( $im , $font , $px , $py , $title , $color ) ;
 	imagepng( $im ) ;
 	imagedestroy( $im ) ;
Index: branches/Ver3.0/xpressme_integration_kit/xoops_version.php
===================================================================
--- branches/Ver3.0/xpressme_integration_kit/xoops_version.php	(revision 740)
+++ branches/Ver3.0/xpressme_integration_kit/xoops_version.php	(revision 741)
@@ -88,5 +88,7 @@
 $modversion['license'] = "GPL see LICENSE";
 $modversion['official'] = 0 ;
-$modversion['image'] =  'module_icon.php' ;
+$modversion['image'] = file_exists( $mydirpath.'/module_icon.png' ) ? 'module_icon.png' : 'module_icon.php' ;
+$modversion['iconbig'] = 'module_icon.php?file=iconbig' ;
+$modversion['iconsmall'] = 'module_icon.php?file=iconsmall' ;
 $modversion['dirname'] = $mydirname;
 
