Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/archives_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/archives_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/archives_block.php	(revision 504)
@@ -27,6 +27,7 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
 		$a_month = _MB_XP2_ARC_MONTH ;
@@ -62,5 +63,5 @@
 		$form .=  "</select><br/>";
 		
-		$form .= "<br />" . _MB_XP2_COUNT_ZERO_ALL . "  <input type='text' name='options[3]' value='" . $limit . "' />";
+		$form .= "<br />" . _MB_XP2_COUNT_ZERO_ALL . "  <input type='text' size='3' name='options[3]' value='" . $limit . "' />";
 		$form .= "<br />" . yes_no_radio_option('options[4]', _MB_XP2_SHOW_NUM_OF_POST , $show_post_count);
 		$form .= "<br />" . yes_no_radio_option('options[5]', _MB_XP2_SHOW_DROP_DOWN , $drop_down);
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/authors_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/authors_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/authors_block.php	(revision 504)
@@ -27,6 +27,7 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 			
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
 		$form .= yes_no_radio_option('options[2]', _MB_XP2_SHOW_NUM_OF_POST , $optioncount);
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/block_common.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/block_common.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/block_common.php	(revision 504)
@@ -103,5 +103,5 @@
 
     $option = "<option value=\"0\" ";
-    if ($isAll) $form .= " selected=\"selected\"";
+    if ($isAll) $option .= " selected=\"selected\"";
     $option .= ">"._MB_XP2_ALL ."</option>";
 
@@ -146,4 +146,64 @@
 endif;
 
+if(!function_exists("block_template_setting")):
+function block_template_setting($mydirname,$option_name = '',$value='')
+{
+	$temp_parm = explode(':' , $value);
+	if (empty($temp_parm[1])) {
+		$filename=$temp_parm[0];
+		$temp_type = 'db';
+	} else  {
+		$filename=$temp_parm[1];
+		$temp_type = $temp_parm[0];
+	}
+
+	$none_prefix_filename = '';
+	$pattern = '^' . $mydirname . '_(.*).html';
+	if (preg_match('/' . $pattern . '/' , $filename, $match)){ // file prefix check
+		$none_prefix_filename = $match[1];
+	}
+	
+	$output = _MB_XP2_THISTEMPLATE . "\n";
+	$output .= 	'<input type="hidden" size="50" name="' . $option_name . '" value="' . $value .'"/>' . "\n";
+    $output .= '&nbsp;<select name="template_type" onclick="Template_Make()">' ."\n";
+	switch ($temp_type){
+		case 'db':
+		case 'DB':
+			$output .=  '<option value="0" selected="selected">db</option>';
+			$output .=  '<option value="1">file</option>';
+			break;
+		default:
+			$output .=  '<option value="0">db</option>';
+			$output .=  '<option value="1" selected="selected">file</option>';
+	}
+	$output .= '</select>';
+	$output .= '<b>:'.$mydirname . '_</b>';
+	$output .= '<input type="text" size="30" name="none_prefix_file" value="'. $none_prefix_filename. '"  onChange="Template_Make()"/><b>.html</b><br />';
+    $output .= '
+<script type="text/javascript">
+	function Template_Make(){
+		var type_element = document.getElementsByName("template_type").item(0);
+		var name_element = document.getElementsByName("none_prefix_file").item(0);
+		var real_element = document.getElementsByName("' .$option_name . '").item(0);
+
+		var file_name = "' . $mydirname . '_" + name_element.value + ".html";
+		if (type_element.value ==0) var tmp_type = "db:"; else var tmp_type = "file:";
+		real_element.value = tmp_type + file_name;
+	}
+</script>
+';
+    
+    return $output;
+
+}
+endif;
+if(!function_exists("javascript_check")):
+function javascript_check()
+{
+	$out  = '<div id="JSNG"><p style="color: red"><b>' . _MB_XP2_NO_JSCRIPT . '</b></p><br /></div>';
+	$out .= '<script>  document.getElementById("JSNG").style.display = "none";</script>';
+	return $out;
+}
+endif;
 
 ?>
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/calender_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/calender_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/calender_block.php	(revision 504)
@@ -25,6 +25,7 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
 		$form .= _MB_XP2_SUN_COLOR .": <input type='text' name='options[2]' value='" . $sun_color . "' /><br />\n";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/category_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/category_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/category_block.php	(revision 504)
@@ -34,6 +34,7 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');	
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
 		$form .= _MB_XP2_CAT_ALL_STR . "  <input type='text' name='options[2]' value='" . $show_option_all . "' /><br />";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/enhanced_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/enhanced_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/enhanced_block.php	(revision 504)
@@ -19,12 +19,15 @@
 		$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
 		$this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_enhanced_block.html' : trim( $options[1] );
+	    $form .= _MB_XP2_THISTEMPLATE . "<input type='text' size='50' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
 		$include_file = empty( $options[2] ) ? '' : $options[2] ;
 		
+		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
 		$form .= _MB_XP2_ENHACED_FILE .":<br />\n";
-		$form .= '&emsp;' . _MB_XP2_FILE_NAME . ": my_<input type='text' name='options[2]' value='" . $include_file . "' />_block.php<br>\n";
+		$form .= '&emsp;' . _MB_XP2_FILE_NAME . ": <b>my_</b><input type='text' name='options[2]' value='" . $include_file . "' /><b>_block.php</b><br>\n";
 		$form .= '&emsp;' . _MB_XP2_MAKE_ENHACED_FILE . "<br>\n";
 		return $form;
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/meta_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/meta_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/meta_block.php	(revision 504)
@@ -30,6 +30,7 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');	
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
 		$form .= yes_no_radio_option('options[2]', _MB_XP2_META_WP_LINK , $wp_link) . "<br />\n";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/page_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/page_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/page_block.php	(revision 504)
@@ -34,6 +34,7 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
 		$form .= _MB_XP2_PAGE_ORDERBY .": ";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/popular_posts_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/popular_posts_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/popular_posts_block.php	(revision 504)
@@ -28,7 +28,7 @@
 		
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
-
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />\n";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />\n";
 		$form .= _MB_XP2_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/recent_comments_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/recent_comments_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/recent_comments_block.php	(revision 504)
@@ -29,9 +29,10 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 		
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />\n";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
-		$form .= _MB_XP2_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
-		$form .= _MB_XP2_LENGTH .": <input type='text' name='options[3]' value='" . $disp_length . "' /><br />\n";
+		$form .= _MB_XP2_COUNT .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />\n";
+		$form .= _MB_XP2_LENGTH .": <input type='text' size='3' name='options[3]' value='" . $disp_length . "' /><br />\n";
 		$form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[4]' value='" . $date_format . "' /><br />\n";
 		$form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[5]' value='" . $time_format . "' /><br />\n";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/recent_posts_content_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/recent_posts_content_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/recent_posts_content_block.php	(revision 504)
@@ -33,7 +33,9 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 		
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
-		$form .= _MB_XP2_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
+		$form .= "<br />";
+		$form .= _MB_XP2_COUNT .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />\n";
 		$form .= yes_no_radio_option('options[3]', _MB_XP2_P_EXCERPT , $excerpt) . "<br />\n";
 		$form .= _MB_XP2_P_EXCERPT_SIZE .": <input type='text' name='options[4]' value='" . $excerpt_size . "' /><br />\n";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/recent_posts_list_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/recent_posts_list_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/recent_posts_list_block.php	(revision 504)
@@ -30,10 +30,11 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />\n";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />\n";	
-		$form .= _MB_XP2_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
-		$form .= _MB_XP2_REDNEW_DAYS .": <input type='text' name='options[3]' value='" . $disp_red . "' /><br />\n";
-		$form .= _MB_XP2_GREENNEW_DAYS .": <input type='text' name='options[4]' value='" . $disp_green . "' /><br />\n";
+		$form .= _MB_XP2_COUNT .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />\n";
+		$form .= _MB_XP2_REDNEW_DAYS .": <input type='text' size='3' name='options[3]' value='" . $disp_red . "' /><br />\n";
+		$form .= _MB_XP2_GREENNEW_DAYS .": <input type='text' size='3' name='options[4]' value='" . $disp_green . "' /><br />\n";
 		$form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[5]' value='" . $date_format . "' /><br />\n";
 		$form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[6]' value='" . $time_format . "' /><br />\n";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/search_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/search_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/search_block.php	(revision 504)
@@ -24,8 +24,9 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php') ;
 		
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";		
-		$form .= _MB_XP2_SEARCH_LENGTH .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />";
+		$form .= _MB_XP2_SEARCH_LENGTH .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />";
 //	    $form .="<br /><input type='text' size='60' name='options[2]' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
 
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/tag_cloud_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/tag_cloud_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/tag_cloud_block.php	(revision 504)
@@ -31,6 +31,7 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');	
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />";
 		$form .= _MB_XP2_CLOUD_SMALLEST .": <input type='text' size='4' name='options[2]' value='" . $smallest . "' /><br />";
Index: tags/Ver2.2.2/xpressme_integration_kit/blocks/widget_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/widget_block.php	(revision 447)
+++ tags/Ver2.2.2/xpressme_integration_kit/blocks/widget_block.php	(revision 504)
@@ -45,6 +45,7 @@
 		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
 
-		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
-	    $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
 		$form .= "<br />" . yes_no_radio_option('options[2]', _MB_XP2_WIDGET_TITLE_SHOW , $title_show);
 		$form .= "<br />";
