Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
• Thanks to FatherShawn for his wiki posting but I think there is an alternative, possibly more logical approach, as posted above by several writers, i.e. to use the Drupal text editor.
$baseUrl = 'http://example.tld/path/to_images/'; $baseDir = '/full/path/to_images/';
{* temporary hack to fix wysiysg editor failure if js compression is on *}{if $defaultWysiwygEditor eq 1}<script type=text/javascript src={$config->resourceBase}packages/tinymce/jscripts/tiny_mce/jquery.tinymce.js></script><script type=text/javascript src={$config->resourceBase}packages/tinymce/jscripts/tiny_mce/tiny_mce.js></script>{elseif $defaultWysiwygEditor eq 2}{* We want to use the Drupal CKEditor if it exists, if not we will use the CiviCRM packaged version (currently 3.3.1) *}{*using the Drupal API module_exists($module) function *} {if (module_exists('ckeditor')) eq 0} {* module does not exist point to CiviCRM packaged version of CKEditor *} <script type="text/javascript" src="{$config->resourceBase}packages/ckeditor/ckeditor.js"></script> {elseif (module_exists('ckeditor')) eq 1} {* module does exist so point to Drupal version of CKEditor *} <script type="text/javascript" src="/sites/all/modules/ckeditor/ckeditor/ckeditor.js?I"></script> {/if}
function toHtml() { if ($this->_flagFrozen) { return $this->getFrozenHtml(); } else { $name = $this->getAttribute('name'); if( file_exists($_SERVER{'DOCUMENT_ROOT'} . "/sites/all/modules/ckeditor/ckfinder/ckfinder.html")) // if {module_exists(ckeditor)} { { $html = parent::toHtml() . "<script type='text/javascript'> cj( function( ) { cj('#{$name}').removeClass(); if ( CKEDITOR.instances['{$name}'] ) { CKEDITOR.remove(CKEDITOR.instances['{$name}']); } CKEDITOR.replace( '{$name}', { filebrowserBrowseUrl : '/sites/all/modules/ckeditor/ckfinder/ckfinder.html', filebrowserImageBrowseUrl : '/sites/all/modules/ckeditor/ckfinder/ckfinder.html?Type=Images', filebrowserFlashBrowseUrl : '/sites/all/modules/ckeditor/ckfinder/ckfinder.html?Type=Flash', filebrowserUploadUrl : '/sites/default/files/', filebrowserImageUploadUrl : '/sites/default/files/', filebrowserFlashUploadUrl : '/sites/default/files/' }); var editor = CKEDITOR.instances['{$name}']; if ( editor ) { editor.on( 'key', function( evt ){ global_formNavigate = false; } ); editor.config.width = '".$this->width."'; editor.config.height = '".$this->height."'; } }); </script>"; } else { $html = parent::toHtml() . "<script type='text/javascript'> cj( function( ) { cj('#{$name}').removeClass(); if ( CKEDITOR.instances['{$name}'] ) { CKEDITOR.remove(CKEDITOR.instances['{$name}']); } CKEDITOR.replace( '{$name}' ); var editor = CKEDITOR.instances['{$name}']; if ( editor ) { editor.on( 'key', function( evt ){ global_formNavigate = false; } ); editor.config.width = '".$this->width."'; editor.config.height = '".$this->height."'; } }); </script>"; } return $html; } }
{* We want to use the Drupal CKEditor if it exists, if not we will use the CiviCRM packaged version (currently 3.3.1) *}{*using the Drupal API module_exists($module) function *}