diff --git a/README.txt b/README.txt index 6b4451988ea3cd9c5d6c5423aefa273fa4c68610..74bf70d4dcc980e21f26867753d9ae179244a0f5 100644 --- a/README.txt +++ b/README.txt @@ -76,7 +76,7 @@ To use the drupal files directory you also need to comment out or remove the following line in the connector configuration: //$Config['UserFilesPath'] = '/UserFiles/' ; -Furthermore, you will need to create a "File", an "Image" and a "Flash" +Furthermore, you will need to create a "File", "Image", "Flash" and "Media" subdirectory in your drupal files directory. These directories must have the same privileges as the drupal files directory. In some cases these directories must be world writable (chmod 0777). diff --git a/fckeditor.module b/fckeditor.module index cc666abb80b365ee1fd38f75bbee3d13f75a8174..ebb36db7ac90b73bececa40e5da83bc2acb71bfb 100644 --- a/fckeditor.module +++ b/fckeditor.module @@ -51,7 +51,7 @@ function fckeditor_help($section = '') {

To enable file browsing you need to edit the connector configuration file in your fckeditor module directory, the file should be in:
/fckeditor/editor/filemanager/browser/default/connectors/php/config.php

In this file you will need to enable the file browser:
$ Config['Enabled'] = true;

To use the drupal files directory you also need to comment out the following line in the connector configuration:
//$ Config['UserFilesPath'] = '/UserFiles/';

-

Furthermore, you will need to create a 'File', an 'Image' and a 'Flash' subdirectory in your drupal files directory ('".file_directory_path()."'). These directories must have the same privileges as the drupal files directory. In some cases these directories must be world writable (chmod 0777).

"; +

Furthermore, you will need to create a 'File', 'Image', 'Flash' and 'Media' subdirectory in your drupal files directory ('".file_directory_path()."'). These directories must have the same privileges as the drupal files directory. In some cases these directories must be world writable (chmod 0777).

"; break; } return $output; @@ -211,6 +211,8 @@ function fckeditor_process_textarea($element) { // setting some variables $module_drupal_path = drupal_get_path('module', 'fckeditor'); $module_full_path = base_path() . $module_drupal_path; + // get the default drupal files path + $files_path = file_directory_path(); // '-' in a javascript id will not work $js_id = 'oFCKeditor_' . str_replace('-', '_', $element['#id']); @@ -242,9 +244,9 @@ var ".$js_id." = new FCKeditor( '".$element['#id']."' ); // add code for filebrowser for users that have access if (user_access('allow fckeditor file uploads')) { - $element['#suffix'] .= $js_id.".Config['LinkBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath=/".variable_get("file_directory_path", 'files')."'; -".$js_id.".Config['ImageBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath=/".variable_get("file_directory_path", 'files')."'; -".$js_id.".Config['FlashBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath=/".variable_get("file_directory_path", 'files')."'; + $element['#suffix'] .= $js_id.".Config['LinkBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath=/".$files_path."'; +".$js_id.".Config['ImageBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath=/".$files_path."'; +".$js_id.".Config['FlashBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath=/".$files_path."'; ".$js_id.".Config['LinkUpload'] = false; ".$js_id.".Config['ImageUpload'] = false; ".$js_id.".Config['FlashUpload'] = false;\n";