Index: ckeditor.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ckeditor/ckeditor.module,v
retrieving revision 1.2
diff -u -r1.2 ckeditor.module
--- ckeditor.module	22 Oct 2009 20:35:40 -0000	1.2
+++ ckeditor.module	30 Oct 2009 12:28:05 -0000
@@ -935,20 +935,24 @@
  *   path to CKEditor folder
  */
 function ckeditor_path($local = FALSE) {
-  static $fck_path;
-  static $fck_local_path;
+  static $ck_path;
+  static $ck_local_path;
 
-  if (!$fck_path) {
+  if (!$ck_path) {
     $mod_path = drupal_get_path('module', 'ckeditor');
     $global_profile = ckeditor_profile_load('CKEditor Global Profile');
 
-    //default: path to ckeditor subdirectory in the ckeditor module directory (starting from the document root)
-    //e.g. for http://example.com/drupal it will be /drupal/sites/all/modules/ckeditor/ckeditor
-    $fck_path = base_path() . $mod_path .'/ckeditor';
-
     //default: path to ckeditor subdirectory in the ckeditor module directory (relative to index.php)
     //e.g.: sites/all/modules/ckeditor/ckeditor
-    $fck_local_path = $mod_path .'/ckeditor';
+    $ck_local_path =  'sites/all/libraries/ckeditor';
+    
+    if(!file_exists($ck_local_path)){
+      $ck_local_path =  $mod_path .'/ckeditor';
+    }
+    
+    //default: path to ckeditor subdirectory in the ckeditor module directory (starting from the document root)
+    //e.g. for http://example.com/drupal it will be /drupal/sites/all/modules/ckeditor/ckeditor
+    $ck_path = base_path() . $ck_local_path;
 
     if ($global_profile) {
       $gs = $global_profile->settings;
@@ -962,7 +966,7 @@
         if (substr($tmp_path, 0, 1) != '/') {
           $tmp_path = '/'. $tmp_path; //starts with '/'
         }
-        $fck_path = $tmp_path;
+        $ck_path = $tmp_path;
 
         if (empty($gs['ckeditor_local_path'])) {
           //fortunately wildcards are used, we can easily get the right server path
@@ -978,22 +982,22 @@
       //ckeditor_path is defined, but wildcards are not used, we need to try to find out where is
       //the document root located and append ckeditor_path to it.
       if (!empty($gs['ckeditor_local_path'])) {
-        $fck_local_path = $gs['ckeditor_local_path'];
+        $ck_local_path = $gs['ckeditor_local_path'];
       }
       elseif (!empty($gs['ckeditor_path'])) {
         module_load_include('lib.inc', 'ckeditor');
         $local_path = ckeditor_resolve_url( $gs['ckeditor_path'] ."/" );
         if (FALSE !== $local_path) {
-          $fck_local_path = $local_path;
+          $ck_local_path = $local_path;
         }
       }
     }
   }
   if ($local) {
-    return $fck_local_path;
+    return $ck_local_path;
   }
   else {
-    return $fck_path;
+    return $ck_path;
   }
 }
 

