summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWiktor Walc2009-03-11 13:42:22 (GMT)
committer Wiktor Walc2009-03-11 13:42:22 (GMT)
commit43e129e14bb003cc0a1f6bb9919ea249f53e561e (patch)
treec1405e6e2c714cd2b46f3cf8754a868fdf9a9cdf
parentd8a31afdd04f8db49c3513730e14f5c7950737b8 (diff)
#379088 Added support for Web File Manager (WebFM)
-rw-r--r--CHANGELOG.txt1
-rw-r--r--fckeditor.admin.inc16
-rw-r--r--fckeditor.help.inc2
-rw-r--r--fckeditor.module17
4 files changed, 27 insertions, 9 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 8c70697..81c857f 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,6 +2,7 @@ $Id$
-- 2009-03-11 version 6.x-2.x-dev
* #380134 Fixed the incompatibility with JsMin in IE
+* #379088 Added support for Web File Manager (WebFM)
-- 2009-03-10 version 6.x-2.x-dev
* #389186 Fixed the issue with calling IMCE filebrowser when index.html resides in Drupal folder
diff --git a/fckeditor.admin.inc b/fckeditor.admin.inc
index e39c325..4e08e86 100644
--- a/fckeditor.admin.inc
+++ b/fckeditor.admin.inc
@@ -258,7 +258,7 @@ function fckeditor_admin_profile_form($form_state, $profile = NULL) {
'#description' => t('Only roles with "access fckeditor" permission will be shown here. If no role is available, make sure that you have assigned the "access fckeditor" <a href="!permission">permission</a>.', array('!permission' => url('admin/user/permissions'))),
'#required' => TRUE
);
-
+
$form['basic']['allow_user_conf'] = array(
'#type' => 'radios',
'#title' => t('Allow users to customize FCKeditor appearance'),
@@ -277,7 +277,7 @@ function fckeditor_admin_profile_form($form_state, $profile = NULL) {
'#collapsible' => TRUE,
'#collapsed' => TRUE
);
-
+
$all = filter_list_all();
$form['security']['filters'] = array(
@@ -286,7 +286,7 @@ function fckeditor_admin_profile_form($form_state, $profile = NULL) {
'#description' => t('Please choose carefully all filters that protect your content (probably not all filters listed below are security filters).'),
'#tree' => TRUE,
);
-
+
//don't bother administrator with filters that definitely are not security filters
$modules_with_filters_to_skip = array('amazon_filter', 'asy', 'bbcode', 'biblio', 'blockquote', 'bookpost', 'chessboard', 'citation_filter', 'codefilter', 'collapse_text', 'contextlinks', 'coolfilter', 'dialectic', 'dript', 'dme', 'drutex', 'embedfilter', 'ext_link_page', 'extlink', 'elf', 'flickr', 'flickrstickr', 'footnotes', 'formdefaults', 'freelinking', 'gallery', 'geogebra', 'geshifilter', 'gotwo', 'googtube', 'gotcha', 'gtspam', 'hidden_content', 'img_assist', 'image_filter', 'inlinetags', 'insert_view', 'insertframe', 'insertnode', 'interwiki', 'jlightbox', 'jsmath', 'language_sections', 'link_node', 'lootz', 'markdown', 'marksmarty', 'mobile_codes', 'mykml', 'nofollowlist', 'oagwt', 'paging', 'pathfilter', 'pearwiki_filter', 'php', 'pirate', 'reptag', 'scrippet', 'scripturefilter', 'signwriter', 'slideshowpro', 'smartlinebreakconverter', 'smartypants', 'smileys', 'spamspan', 'spam_tokens', 'spoiler', 'table_altrow', 'tablemanager', 'tableofcontents', 'textile', 'tooltips', 'twikifilter', 'typogrify', 'unwrap', 'urlclass', 'urlicon', 'url_replace_filter', 'username_highlighter', 'video_filter', 'quote');
@@ -320,7 +320,7 @@ function fckeditor_admin_profile_form($form_state, $profile = NULL) {
),
'#description' => t('There are two ways of starting FCKeditor: automatically and manually (via toggle or in a popup). If you decide to apply security filters only when FCKeditor starts automatically, you\'ll not be protected when toggling manually from plain textarea to FCKeditor or when using FCKeditor in a popup mode. So choose this option only, if you can detect various attacks (mainly XSS) by yourself just by looking at the HTML code.'),
);
-
+
$form['fckeditor_exclude_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Visibility settings'),
@@ -610,7 +610,7 @@ function fckeditor_admin_profile_form($form_state, $profile = NULL) {
'#title' => t('File browser settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
- '#description' => t('Set file browser settings. A file browser will allow you to explore the files contained on the server and embed them as links, images or flash movies. Besides the built-in FCKeditor file browser, you can also use a contributed module like <a href="!imce">IMCE</a> or <a href="!ib">Image Browser</a>. The quick upload setting controls whether images, flash movies and files can be uploaded using the upload tab of the respective dialogs. Please note that these options require manual configuration, check <a href="!readme">readme.txt</a> for more information.', array('!imce' => url('http://drupal.org/project/imce'), '!ib' => url('http://drupal.org/project/imagebrowser'), '!readme' => url('admin/help/fckeditor')))
+ '#description' => t('Set file browser settings. A file browser will allow you to explore the files contained on the server and embed them as links, images or flash movies. Besides the built-in FCKeditor file browser, you can also use a contributed module like <a href="!imce">IMCE</a>, <a href="!ib">Image Browser</a> or <a href="!webfm">Web File Manager</a>. The quick upload setting controls whether images, flash movies and files can be uploaded using the upload tab of the respective dialogs. Please note that these options require manual configuration, check <a href="!readme">readme.txt</a> for more information.', array('!imce' => url('http://drupal.org/project/imce'), '!ib' => url('http://drupal.org/project/imagebrowser'), '!webfm' => url('http://drupal.org/project/webfm'), '!readme' => url('admin/help/fckeditor')))
);
$filebrowsers = array(
@@ -626,6 +626,10 @@ function fckeditor_admin_profile_form($form_state, $profile = NULL) {
$filebrowsers['ib'] = t('Image Browser');
}
+ if (module_exists('webfm_popup')) {
+ $filebrowsers['webfm'] = t('Web File Manager');
+ }
+
$form['fckeditor_upload_settings']['filebrowser'] = array(
'#type' => 'select',
'#title' => t('File browser type'),
@@ -956,7 +960,7 @@ function fckeditor_admin_global_profile_form($form_state, $mode = 'add') {
'#description' => t('The path relative to the location of the private directory where FCKeditor should store uploaded files.') .'<br />'. t('<strong>Warning:</strong> FCKeditor does not implement any kind of access protection on files available in this location. All files stored in the directory defined above might be accessible by unathenticated users if there is no information about the file in the Drupal\'s database.') .'<br />'. t('System path to the private folder is: !system_path.', array('!system_path' => realpath(file_directory_path()) . DIRECTORY_SEPARATOR)) .'<br />'. t('Available wildcard characters:<br/><strong>%u</strong> - User ID.') .'<br />'. t('Current path: !path', array('!path' => $current_private_dir .' ('. file_create_path($current_private_dir) .')')),
);
}
-
+
$form['submit'] = array(
'#type' => 'submit',
'#value' => $btn
diff --git a/fckeditor.help.inc b/fckeditor.help.inc
index 7aed0bf..7bc3299 100644
--- a/fckeditor.help.inc
+++ b/fckeditor.help.inc
@@ -100,7 +100,7 @@ function fckeditor_help_delegate($path, $arg) {
$output .= '<p>'. t('There are three ways for uploading files:') .'</p>';
$output .= '<ol>';
$output .= '<li>'. t('By using the built-in file browser.') .'</li>';
- $output .= '<li>'. t('By using a module like <a href="!imce">IMCE</a> or <a href="!ib">Image Browser</a>.', array('!imce' => 'http://drupal.org/project/imce', '!ib' => 'http://drupal.org/project/imagebrowser')) .'</li>';
+ $output .= '<li>'. t('By using a module like <a href="!imce">IMCE</a>, <a href="!ib">Image Browser</a> or <a href="!webfm">Web File Manager</a>.', array('!imce' => 'http://drupal.org/project/imce', '!ib' => 'http://drupal.org/project/imagebrowser', '!webfm' => 'http://drupal.org/project/webfm')) .'</li>';
$output .= '<li>'. t('By using the core upload module.') .'</li>';
$output .= '</ol>';
diff --git a/fckeditor.module b/fckeditor.module
index 407ee28..341bfcb 100644
--- a/fckeditor.module
+++ b/fckeditor.module
@@ -635,6 +635,9 @@ function fckeditor_process_textarea($element) {
if ($filebrowser == 'ib' && !module_exists('imagebrowser')) {
$filebrowser = 'none';
}
+ if ($filebrowser == 'webfm' && !module_exists('webfm_popup')) {
+ $filebrowser = 'none';
+ }
$quickupload = (!empty($conf['quickupload']) && $conf['quickupload'] == 't');
// load variables used by both quick upload and filebrowser
@@ -693,6 +696,16 @@ function fckeditor_process_textarea($element) {
$js .= $js_id .".Config['FlashBrowserURL']= '". $host ."index.php?q=imce&app=FCKEditor|url@txtUrl';\n";
break;
+ case 'webfm':
+ $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['ImageDlgHideLink']= true;\n";
+ $js .= $js_id .".Config['LinkBrowserURL']= '". $host ."index.php?q=webfm_popup&url=txtUrl';\n";
+ $js .= $js_id .".Config['ImageBrowserURL']= '". $host ."index.php?q=webfm_popup&url=txtUrl';\n";
+ $js .= $js_id .".Config['FlashBrowserURL']= '". $host ."index.php?q=webfm_popup&url=txtUrl';\n";
+ break;
+
case 'builtin':
$js .= $js_id .".Config['LinkBrowser'] = true;\n";
$js .= $js_id .".Config['ImageBrowser'] = true;\n";
@@ -706,8 +719,8 @@ function fckeditor_process_textarea($element) {
$js .= $js_id .".Config['ImageBrowser']= true;\n";
$js .= $js_id .".Config['LinkBrowser']= true;\n";
$js .= $js_id .".Config['FlashBrowser']= false;\n";
- $js .= $js_id .".Config['ImageBrowserURL']= '". $host ."?q=imagebrowser/view/browser&app=FCKEditor';\n";
- $js .= $js_id .".Config['LinkBrowserURL']= '". $host ."?q=imagebrowser/view/browser&app=FCKEditor';\n";
+ $js .= $js_id .".Config['ImageBrowserURL']= '". $host ."index.php?q=imagebrowser/view/browser&app=FCKEditor';\n";
+ $js .= $js_id .".Config['LinkBrowserURL']= '". $host ."index.php?q=imagebrowser/view/browser&app=FCKEditor';\n";
$js .= $js_id .".Config['ImageBrowserWindowWidth']= '680';";
$js .= $js_id .".Config['ImageBrowserWindowHeight'] = '439';";
$js .= $js_id .".Config['LinkBrowserWindowWidth']= '680';";