Index: imce_wysiwyg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imce_wysiwyg/imce_wysiwyg.module,v
retrieving revision 1.4
diff -u -p -r1.4 imce_wysiwyg.module
--- imce_wysiwyg.module	4 Mar 2009 15:52:16 -0000	1.4
+++ imce_wysiwyg.module	2 Dec 2009 05:51:37 -0000
@@ -47,7 +47,23 @@ function imce_wysiwyg_plugin($editor, $v
           'load' => FALSE,
         ),
       );
-
+   case 'ckeditor':
+      $integrated[$editor] = TRUE;
+      return array(
+        'imce' => array(
+          'extensions' => array('imce' => t('IMCE')),
+          'url' => 'http://drupal.org/project/imce',
+          'options' => array(
+            'ImageBrowser' => TRUE,
+            'filebrowserImageBrowseUrl' => url('imce', array('query' => array('app' => $editor . '|sendto@imceCkeditSendTo|params@'))),
+            'FlashBrowser' => TRUE,
+            'filebrowserFlashBrowseUrl' => url('imce', array('query' => array('app' => $editor . '|sendto@imceCkeditSendTo|params@'))),
+            'LinkBrowser' => TRUE,
+            'filebrowserBrowseUrl' => url('imce', array('query' => array('app' => $editor . '|sendto@imceCkeditSendTo|params@'))),
+          ),
+          'load' => FALSE,
+        ),
+      );
     case 'fckeditor':
       $integrated[$editor] = TRUE;
       return array(
@@ -67,4 +83,3 @@ function imce_wysiwyg_plugin($editor, $v
       );
   }
 }
-
Index: js/imce_wysiwyg.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imce_wysiwyg/js/imce_wysiwyg.js,v
retrieving revision 1.3
diff -u -p -r1.3 imce_wysiwyg.js
--- js/imce_wysiwyg.js	25 Feb 2009 16:31:46 -0000	1.3
+++ js/imce_wysiwyg.js	2 Dec 2009 05:51:37 -0000
@@ -9,3 +9,14 @@ function imceImageBrowser(field_name, ur
     win.open(Drupal.settings.imce.url + encodeURIComponent(field_name), '', 'width=760,height=560,resizable=1');
   }
 }
+
+//sendTo function for ckeditor
+var imceCkeditSendTo = function(file, win) {
+  var parts = /\?(?:.*&)?CKEditorFuncNum=(\d+)(?:&.*)?$/.exec(win.location.href);
+  if (parts && parts.length > 1) {
+    CKEDITOR.tools.callFunction(parts[1], file.url);
+    win.close();
+  } else {
+    throw 'CKEditorFuncNum parameter not found or invalid: ' + win.location.href;
+  }
+};
