<?php echo "Hello world!"; ?>
I’m here ’cause I am having a little problem with FCKE in MODx.
I would change a little the FCKE’s configuration but I want to ensure that this new config will be kept even if the MODx version changes (ie on a MODx update).
For the moment I have modified
plugins/fckeditor/fckconfig.js but I think it’s not really safe (in my opinion) => I have to be sure the modifications are kept.
Secondly, by editing the
FCKConfig.CustomConfigurationsPath variable in the above file, my value is overwritten by this code:
<script language='javascript' type='text/javascript'>var oFCKta = new FCKeditor('ta');oFCKta.Width = '100%';oFCKta.Height = '400';oFCKta.BaseHref = 'http://www.neutrik-france.com/';oFCKta.BasePath = '/assets/plugins/fckeditor/';oFCKta.Config['ImageBrowser'] = true;oFCKta.Config['ImageBrowserURL'] = FCKImageBrowserURL;oFCKta.Config['LinkBrowser'] = true;oFCKta.Config['LinkBrowserURL'] = FCKLinkBrowserURL;oFCKta.Config['FlashBrowser'] = true;oFCKta.Config['FlashBrowserURL'] = FCKFlashBrowserURL;oFCKta.Config['SpellChecker'] = 'SpellerPages';oFCKta.Config['CustomConfigurationsPath'] = '/assets/plugins/fckeditor/custom_config.js';oFCKta.ToolbarSet = 'advanced';oFCKta.Config['EditorAreaCSS'] = FCKEditorAreaCSS;oFCKta.ReplaceTextarea();</script>
more precisely this instruction:
oFCKta.Config['CustomConfigurationsPath'] = '/assets/plugins/fckeditor/custom_config.js';
I managed to find the code which include those affectations (and any more), and I identified that in file
manager/actions/dynamic/mutate_content.dynamic.action.php:
<?php
/**
* Initialize RichText Editor
* orig MODIFIED BY S.BRENNAN for DocVars
*
*/
if($content['type']=="document" || $_REQUEST['a']==4) {
if(($content['richtext']==1 || $_REQUEST['a']==4) && $use_editor==1) {
if(is_array($replace_richtexteditor)) {
// invoke OnRichTextEditorInit event
$evtOut = $modx->invokeEvent("OnRichTextEditorInit", // line 1082
array(
editor => $which_editor,
elements => $replace_richtexteditor
));
if(is_array($evtOut)) echo implode("",$evtOut); // line 1087 => echo the JavaScript which overwrite my variable
}
}
}
?>
But here I need some help...
Where do $modx
->invokeEvent
("OnRichTextEditorInit", ...
) gets its content? Is there a way to surely modify the path to a personal FCKE’s config file? (I didn’t see it in the MODx administration)
Thanks.