there is a bug (which I have introduced in XH 1.5 ) in the implementation of external filebrowsers - AFAIK in all versions since 1.5.1.
Caused by a wrong if/else clause, the fallback code for the internal filebrowser gets never executed, if $cf['filebrowser']['external'] != FALSE.
The active editor might crash, if the external filebrowser not provide a connector for this configured editor.
That was not a problem until now, because all available filebrowsers have compatible connectors for all available editors.
But with TinyMCE4, this behavior might change...
Beside this, the TinyMCE4-plugin in 1.6beta contains wrong code to detect the filebrowser - connector (in fact it's just a copy of the code for TinyMCE 3x).
The init-function to call the filebrowser must always reflect the name of the external filebrowser and the external editor:
Code: Select all
$init_function = $cf['filebrowser']['external'] . '_tinymce4_init';
/plugins/tinymce/init.php:
Code: Select all
Index: init.php
===================================================================
--- init.php (revision 941)
+++ init.php (working copy)
@@ -22,26 +22,23 @@
//Einbindung alternativer Filebrowser, gesteuert über $cf['filebrowser']['external']
//und den Namen des aufrufenden Editors
if ($cf['filebrowser']['external'] != FALSE) {
- $fbConnector = CMSIMPLE_BASE . 'plugins/' . $cf['filebrowser']['external'] . '/connectors/tinymce/tinymce.php';
- if (is_readable($fbConnector)) {
- include_once($fbConnector);
- $init_function = $cf['filebrowser']['external'] . '_tinymce_init';
- if (function_exists($init_function)) {
- $script = $init_function();
- }
- return $script;
+ $fbConnector = CMSIMPLE_BASE . 'plugins/' . $cf['filebrowser']['external'] . '/connectors/tinymce/tinymce.php';
+ if (is_readable($fbConnector)) {
+ include_once($fbConnector);
+ $init_function = $cf['filebrowser']['external'] . '_tinymce_init';
+ if (function_exists($init_function)) {
+ $script = $init_function();
+ return $script;
+ }
+ }
}
- } else {
-
//default filebrowser
$_SESSION['tinymce_fb_callback'] = 'wrFilebrowser';
$url = CMSIMPLE_ROOT . 'plugins/filebrowser/editorbrowser.php?editor=tinymce&prefix=' . CMSIMPLE_BASE . '&base=./';
$script = file_get_contents(dirname(__FILE__) . '/filebrowser.js');
$script = str_replace('%URL%', $url, $script);
return $script;
-
- }
}
/plugins/tinymce4/init.php:
Code: Select all
Index: init.php
===================================================================
--- init.php (revision 941)
+++ init.php (working copy)
@@ -18,26 +18,23 @@
//Einbindung alternativer Filebrowser, gesteuert über $cf['filebrowser']['external']
//und den Namen des aufrufenden Editors
if ($cf['filebrowser']['external'] != FALSE) {
- $fbConnector = CMSIMPLE_BASE . 'plugins/' . $cf['filebrowser']['external'] . '/connectors/tinymce/tinymce.php';
- if (is_readable($fbConnector)) {
- include_once($fbConnector);
- $init_function = $cf['filebrowser']['external'] . '_tinymce_init';
- if (function_exists($init_function)) {
- $script = $init_function();
- }
- return $script;
+ $fbConnector = CMSIMPLE_BASE . 'plugins/' . $cf['filebrowser']['external'] . '/connectors/tinymce4/tinymce4.php';
+ if (is_readable($fbConnector)) {
+ include_once($fbConnector);
+ $init_function = $cf['filebrowser']['external'] . '_tinymce4_init';
+ if (function_exists($init_function)) {
+ $script = $init_function();
+ return $script;
+ }
+ }
}
- } else {
-
//default filebrowser
$_SESSION['tinymce_fb_callback'] = 'wrFilebrowser';
$url = CMSIMPLE_ROOT . 'plugins/filebrowser/editorbrowser.php?editor=tinymce4&prefix=' . CMSIMPLE_BASE . '&base=./';
$script = file_get_contents(dirname(__FILE__) . '/filebrowser.js');
$script = str_replace('%URL%', $url, $script);
return $script;
-
- }
}
Holger