summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--fckeditor.admin.inc4
-rw-r--r--fckeditor.module16
3 files changed, 21 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 8de2fbe..94ec97a 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -4,6 +4,7 @@ $Id$
* #726536 Save button in toolbar
* #705468 Insert View & Insert Block filters tags not preserved when editing saved nodes
* #670768 Display path to theme in settings
+* #224497 Add support for CKFinder to FCKEditor
-- 2010-03-13 version 6.x-2.x-dev
* Update German translation
diff --git a/fckeditor.admin.inc b/fckeditor.admin.inc
index c03bdf1..c46019d 100644
--- a/fckeditor.admin.inc
+++ b/fckeditor.admin.inc
@@ -765,6 +765,10 @@ function fckeditor_admin_profile_form($form_state, $profile = NULL) {
$filebrowsers['webfm'] = t('Web File Manager');
}
+ if (file_exists(_fckeditor_ckfinder_path())) {
+ $filebrowsers['ckfinder'] = t('CKFinder');
+ }
+
$form['fckeditor_upload_settings']['filebrowser'] = array(
'#type' => 'select',
'#title' => t('File browser type'),
diff --git a/fckeditor.module b/fckeditor.module
index c934bd9..e3a8ddb 100644
--- a/fckeditor.module
+++ b/fckeditor.module
@@ -42,6 +42,10 @@ global $_fckeditor_js_ids;
$_fckeditor_configuration = array();
$_fckeditor_js_ids = array();
+function _fckeditor_ckfinder_path() {
+ return drupal_get_path('module', 'fckeditor') . '/ckfinder/ckfinder.php';
+}
+
/**
* Implementation of hook_help().
*
@@ -670,6 +674,9 @@ function fckeditor_process_textarea($element) {
if ($filebrowser == 'webfm' && !module_exists('webfm_popup')) {
$filebrowser = 'none';
}
+ if ($filebrowser == 'ckfinder' && !file_exists(_fckeditor_ckfinder_path())) {
+ $filebrowser = 'none';
+ }
$quickupload = (!empty($conf['quickupload']) && $conf['quickupload'] == 't');
// load variables used by both quick upload and filebrowser
@@ -760,6 +767,15 @@ function fckeditor_process_textarea($element) {
$js .= $js_id .".Config['LinkBrowserWindowHeight'] = '439';";
break;
+ case 'ckfinder':
+ $js .= $js_id .".Config['LinkBrowser'] = true;\n";
+ $js .= $js_id .".Config['ImageBrowser'] = true;\n";
+ $js .= $js_id .".Config['FlashBrowser'] = true;\n";
+ $js .= $js_id .".Config['LinkBrowserURL'] = '". $module_full_path ."/ckfinder/ckfinder.html';\n";
+ $js .= $js_id .".Config['ImageBrowserURL'] = '". $module_full_path ."/ckfinder/ckfinder.html?type=Images';\n";
+ $js .= $js_id .".Config['FlashBrowserURL'] = '". $module_full_path ."/ckfinder/ckfinder.html?type=Flash';\n";
+ break;
+
default:
case 'none':
$js .= $js_id .".Config['LinkBrowser'] = false;\n";