Index: modules/tinymce/tinymce.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tinymce/tinymce.module,v
retrieving revision 1.77
diff -u -r1.77 tinymce.module
--- modules/tinymce/tinymce.module	7 Mar 2006 00:53:04 -0000	1.77
+++ modules/tinymce/tinymce.module	7 Mar 2006 01:52:51 -0000
@@ -156,8 +156,33 @@
 $tinymce_invoke = <<<EOD
 <script type="text/javascript">
   tinyMCE.init({
-    $tinymce_settings
+    $tinymce_settings,
+    file_browser_callback : "fileBrowserCallBack"
   });
+  
+  function fileBrowserCallBack(field_name, url, type, win) {
+  	var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
+  	var enableAutoTypeSelection = true;
+  	var cType;
+  	tinyfck_field = field_name;
+  	tinyfck = win;	
+  	switch (type) {
+  		case "image":
+  			cType = "Image";
+  			break;
+  		case "flash":
+  			cType = "Flash";
+  			break;
+  		case "file":
+  			cType = "File";
+  			break;
+  	}
+  	if (enableAutoTypeSelection && cType) {
+  		connector += "?Type=" + cType;
+  	}
+  	window.open(connector, "tinyfck", "modal,width=600,height=400");
+  }
+  
 </script>
 EOD;
 
