Index: imce_wysiwyg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/imce_wysiwyg/imce_wysiwyg.module,v
retrieving revision 1.2
diff -u -r1.2 imce_wysiwyg.module
--- imce_wysiwyg.module	23 Feb 2009 12:49:16 -0000	1.2
+++ imce_wysiwyg.module	25 Feb 2009 08:39:31 -0000
@@ -13,27 +13,24 @@
 function imce_wysiwyg_plugin($editor, $version) {
   static $integrated = array();
 
-  if (!user_access('access imce')) {
+  if (!imce_access()) {
     return;
   }
   // Load our invocation scripts.
   if (empty($integrated)) {
-    $path = drupal_get_path('module', 'imce');
-    $intpath = drupal_get_path('module', 'imce_wysiwyg');
+    $imcepath = drupal_get_path('module', 'imce');
+    $path = drupal_get_path('module', 'imce_wysiwyg');
     drupal_add_js($imcepath . '/js/imce.js');
-    drupal_add_js($path . '/js/imce_set_app.js');
-    drupal_add_js($intpath .'/js/imce_wysiwyg.js');
+    drupal_add_js($imcepath . '/js/imce_set_app.js');
+    drupal_add_js($path . '/js/imce_wysiwyg.js');
   }
 
   switch ($editor) {
     case 'tinymce':
       if (!isset($integrated[$editor])) {
-        $path = drupal_get_path('module', 'imce');
-        drupal_add_js('var imceBrowserURL = "' . url('imce/browse') . '"', 'inline', 'footer');
-        drupal_add_js($path . '/imce_set_tinymce.js', 'module', 'footer');
         $integrated[$editor] = TRUE;
         $settings = array(
-          'imce' => array('url' => url('imce', array('query' => 'app=' . $editor . '|url@src'))),
+          'imce' => array('url' => url('imce', array('query' => array('app' => $editor.'|url@')))),
         );
         drupal_add_js($settings, 'setting');
       }
@@ -50,12 +47,7 @@
       );
 
     case 'fckeditor':
-      if (!isset($integrated[$editor])) {
-        $path = drupal_get_path('module', 'imce');
-        drupal_add_js('var imceBrowserURL = "' . url('imce/browse') . '"', 'inline', 'footer');
-        drupal_add_js($path . '/imce_set_fck.js', 'module', 'footer');
-        $integrated[$editor] = TRUE;
-      }
+      $integrated[$editor] = TRUE;
       return array(
         'imce' => array(
           'extensions' => array('imce' => t('IMCE')),
@@ -74,4 +66,3 @@
   }
 }
 
-
Index: js/imce_wysiwyg.js
===================================================================
RCS file: /cvs/drupal/contributions/modules/imce_wysiwyg/js/imce_wysiwyg.js,v
retrieving revision 1.2
diff -u -r1.2 imce_wysiwyg.js
--- js/imce_wysiwyg.js	23 Feb 2009 12:49:16 -0000	1.2
+++ js/imce_wysiwyg.js	25 Feb 2009 08:36:41 -0000
@@ -6,6 +6,6 @@
 function imceImageBrowser(field_name, url, type, win) {
   // TinyMCE.
   if (win !== 'undefined') {
-    win.open(Drupal.settings.imce.url, '', 'width=760,height=560,resizable=1');
+    win.open(Drupal.settings.imce.url + encodeURIComponent(field_name), '', 'width=760,height=560,resizable=1');
   }
 }

