Index: editors/ckeditor.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/ckeditor.inc,v retrieving revision 1.4 diff -u -p -r1.4 ckeditor.inc --- editors/ckeditor.inc 23 Oct 2009 02:11:33 -0000 1.4 +++ editors/ckeditor.inc 29 Oct 2009 03:29:42 -0000 @@ -24,7 +24,7 @@ function wysiwyg_ckeditor_editor() { 'src' => array( 'title' => 'Source', 'files' => array( - 'ckeditor_source.js' => array('preprocess' => FALSE), + 'ckeditor_source.js' => array('preprocess' => FALSE), ), ), ), @@ -92,15 +92,20 @@ function wysiwyg_ckeditor_version($edito function wysiwyg_ckeditor_themes($editor, $profile) { // @todo Skins are not themes but this will do for now. $path = $editor['library path'] . '/skins/'; - $dir_handle = @opendir($path) or drupal_set_message('Unable to open ' . $path, $type = 'error'); - $themes = array(); - while ($file = readdir($dir_handle)) { - if($file!="." && $file!=".." && $file!="CVS" && $file!=".svn") { - $themes[] = $file; + $dir_handle = @opendir($path); + if ($dir_handle) { + $themes = array(); + while ($file = readdir($dir_handle)) { + if ($file != '.' && $file != '..' && $file != 'CVS' && $file != '.svn') { + $themes[] = $file; + } } + closedir($dir_handle); + return $themes; + } + else { + return array('default'); } - closedir($dir_handle); - return $themes; } /** @@ -122,7 +127,7 @@ function wysiwyg_ckeditor_settings($edit 'baseHref' => base_path(), 'width' => '100%', 'height' => 420, - // Skin is not really the same as theme. + // @todo Do not use skins as themes and add separate skin handling. 'theme' => 'default', 'skin' => $theme, // By default, CKeditor converts most characters into HTML entities. Since @@ -162,15 +167,12 @@ function wysiwyg_ckeditor_settings($edit } } - // Language if (isset($config['language'])) { $settings['language'] = $config['language']; } - // Resizing button if (isset($config['resizing'])) { $settings['resize_enabled'] = $config['resizing']; } - //Toolbar location if (isset($config['toolbar_loc'])) { $settings['toolbarLocation'] = $config['toolbar_loc']; } @@ -270,10 +272,6 @@ function wysiwyg_ckeditor_proxy_plugin_s /** * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin(). - * - * Excluded native plugins: About, Button, Checkbox, Form, HiddenField, - * ImageButton, NewPage, PageBreak, Print, Radio, Select, Save, TextField, - * Textarea, Templates. */ function wysiwyg_ckeditor_plugins($editor) { $plugins = array( Index: editors/js/ckeditor-3.0.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/js/ckeditor-3.0.js,v retrieving revision 1.5 diff -u -p -r1.5 ckeditor-3.0.js --- editors/js/ckeditor-3.0.js 23 Oct 2009 02:11:33 -0000 1.5 +++ editors/js/ckeditor-3.0.js 29 Oct 2009 03:29:42 -0000 @@ -36,13 +36,16 @@ Drupal.wysiwyg.editor.attach.ckeditor = CKEDITOR.config.customConfig = ''; settings.on = { - // Event handlers. instanceReady: function(ev) { var editor = ev.editor; + // Get a list of block, list and table tags from CKEditor's XHTML DTD. + // See http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Output_Formatting. var dtd = CKEDITOR.dtd; - var tags = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ); + var tags = CKEDITOR.tools.extend({}, dtd.$block, dtd.$listItem, dtd.$tableContent); + // Set source formatting rules for each listed tag except
.
+      // Linebreaks can be inserted before or after opening and closing tags.
       if (settings.apply_source_formatting) {
-        // Mimic FCKeditor output.
+        // Mimic FCKeditor output, by breaking lines between tags.
         for (var tag in tags) {
           if (tag == 'pre') {
             continue;
@@ -58,7 +61,7 @@ Drupal.wysiwyg.editor.attach.ckeditor = 
       }
       else {
         // No indents or linebreaks;
-        for (var key in tags) {
+        for (var tag in tags) {
           if (tag == 'pre') {
             continue;
           }
@@ -76,7 +79,7 @@ Drupal.wysiwyg.editor.attach.ckeditor = 
     pluginsLoaded: function(ev) {
       // Override the conversion methods to let Drupal plugins modify the data.
       var editor = ev.editor;
-      if (editor.dataProcessor) {
+      if (editor.dataProcessor && Drupal.settings.wysiwyg.plugins[params.format]) {
         editor.dataProcessor.toHtml = CKEDITOR.tools.override(editor.dataProcessor.toHtml, function(originalToHtml) {
           // Convert raw data for display in WYSIWYG mode.
           return function(data, fixForBody) {