Index: branches/XPressMU/xpressme_integration_kit/blocks/block_common.php
===================================================================
--- branches/XPressMU/xpressme_integration_kit/blocks/block_common.php	(revision 407)
+++ branches/XPressMU/xpressme_integration_kit/blocks/block_common.php	(revision 451)
@@ -18,6 +18,6 @@
 endif;
 
-if(!function_exists("dropdown_cats_options")):
-function dropdown_cats_options($sort_column = 'ID', $sort_order = 'asc', $selected=array()) 
+if(!function_exists("categorie_select")):
+function categorie_select($option_name = '',$value='',$row_num=0 ,$sort_column = 'ID', $sort_order = 'asc')
 {
     $mydirpath = dirname(dirname(__FILE__));
@@ -30,6 +30,8 @@
 	$xoopsDB =& Database::getInstance();
 	$myts =& MyTextSanitizer::getInstance();
-    $selected = is_array($selected)?$selected:array($selected);
+    $selected = explode(',' , $value);
+	$isAll = (count($selected)==0||empty($selected[0]))?true:false;
     $sort_column = 'cat_'.$sort_column;
+    if (empty($row_num)) $size = ''; else $size = 'size="' . $row_num . '"';
 	include $mydirpath.'/wp-includes/version.php';
 	if ($wp_db_version < 6124) {
@@ -53,21 +55,95 @@
     }
 	$res =  $xoopsDB->query($query, 0, 0);
+	$option = "\t<option value=\"0\" ";
+	if ($isAll) $option .= " selected=\"selected\"";
+	$option .= ">"._MB_XP2_ALL ."</option>\n";
+
     if ($res !== false){
  		while($row = $xoopsDB->fetchArray($res)){
             $cat_name = $row['cat_name'];
             $cat_ID = $row['cat_ID'];
-            echo "\t<option value=\"".$cat_ID."\"";
+            $option .= "\t<option value=\"".$cat_ID."\"";
             if (in_array($cat_ID, $selected))
-                echo ' selected="selected"';
-            echo '>';
-            echo $myts->htmlspecialchars($cat_name);
-            echo "</option>\n";
+                $option .= ' selected="selected"';
+            $option .= '>';
+            $option .= $myts->htmlspecialchars($cat_name);
+            $option .= "</option>\n";
         }
     }
-    return;
+    $output = _MB_XP2_CATS_SELECT ."<br />\n";
+    $output .= 	"<input type='hidden' name='$option_name' value='$value' />\n";
+    $output .= '&nbsp;&nbsp;<select name="categorie" '.$size.' multiple="multiple" onclick="CatSelect()">' ."\n";
+    $output .= $option;
+    $output .= '</select><br />';
+    $output .= '
+<script type="text/javascript">
+    function CatSelect(){
+        var idx=new Array();
+        var sel=document.forms["blockform"].elements["categorie"].options;
+        for(var i=0, n=0; i<sel.length; i++){
+            if(sel[i].selected){ idx[n++]=sel[i].value; }
+        }
+        if(idx.length>0){
+        	document.forms["blockform"].elements["' .$option_name . '"].value = idx;
+		}
+    }
+</script>
+';
+    
+    return $output;
+
+}
+endif;
+
+if(!function_exists("comment_type_select")):
+function comment_type_select($option_name = '',$value='')
+{
+    $selected = explode(',' , $value);
+	$isAll = (count($selected)==0||empty($selected[0]))?true:false;
+
+    $option = "<option value=\"0\" ";
+    if ($isAll) $form .= " selected=\"selected\"";
+    $option .= ">"._MB_XP2_ALL ."</option>";
+
+    $option .= "<option value=\"1\" ";
+    if (in_array(1, $selected))
+		$option .= " selected=\"selected\"";
+    $option .= ">"._MB_XP2_COMMENT ."</option>";
+
+    $option .= "<option value=\"2\" ";
+    if (in_array(2, $selected))
+		$option .= " selected=\"selected\"";
+    $option .= ">"._MB_XP2_TRUCKBACK ."</option>";
+
+    $option .= "<option value=\"3\" ";
+    if (in_array(3, $selected))
+		$option .= " selected=\"selected\"";
+    $option .= ">"._MB_XP2_PINGBACK ."</option>";
+
+    $output = _MB_XP2_COM_TYPE . "<br />\n";
+    $output .= 	"<input type='hidden' name='$option_name' value='$value' />\n";
+    $output .= '&nbsp;&nbsp;<select name="com_type" multiple="multiple" onclick="ComTypeSelect()">' ."\n";
+    $output .= $option;
+    $output .= '</select><br />';
+    $output .= '
+<script type="text/javascript">
+    function ComTypeSelect(){
+        var idx=new Array();
+        var sel=document.forms["blockform"].elements["com_type"].options;
+        for(var i=0, n=0; i<sel.length; i++){
+            if(sel[i].selected){ idx[n++]=sel[i].value; }
+        }
+        if(idx.length>0){
+        	document.forms["blockform"].elements["' .$option_name . '"].value = idx;
+		}
+    }
+</script>
+';
+    
+    return $output;
+
 }
 endif;
 
 
-
 ?>
