Index: wysiwyg.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.admin.inc,v retrieving revision 1.24 diff -u -p -r1.24 wysiwyg.admin.inc --- wysiwyg.admin.inc 18 Oct 2010 21:57:48 -0000 1.24 +++ wysiwyg.admin.inc 23 Oct 2010 19:52:40 -0000 @@ -13,7 +13,7 @@ function wysiwyg_profile_form($form, &$f // Merge in defaults. $profile = (array) $profile; $profile += array( - 'format' => 0, + 'format' => '', 'editor' => '', ); if (empty($profile['settings'])) { Index: wysiwyg.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.install,v retrieving revision 1.7 diff -u -p -r1.7 wysiwyg.install --- wysiwyg.install 10 Sep 2010 00:39:16 -0000 1.7 +++ wysiwyg.install 23 Oct 2010 19:52:40 -0000 @@ -8,7 +8,7 @@ function wysiwyg_schema() { $schema['wysiwyg'] = array( 'description' => t('Stores Wysiwyg profiles.'), 'fields' => array( - 'format' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'format' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), 'editor' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), 'settings' => array('type' => 'text', 'size' => 'normal'), ), Index: wysiwyg.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.js,v retrieving revision 1.19 diff -u -p -r1.19 wysiwyg.js --- wysiwyg.js 25 Sep 2010 00:46:33 -0000 1.19 +++ wysiwyg.js 23 Oct 2010 19:52:40 -0000 @@ -56,7 +56,7 @@ Drupal.behaviors.attachWysiwyg = { params[format].trigger = this.id; params[format].field = params.field; } - var format = 'format' + this.value; + var format = this.value; // Directly attach this editor, if the input format is enabled or there is // only one input format at all. if ($this.is(':input')) { @@ -67,7 +67,7 @@ Drupal.behaviors.attachWysiwyg = { $this.change(function() { // If not disabled, detach the current and attach a new editor. Drupal.wysiwygDetach(context, params[format]); - format = 'format' + this.value; + format = this.value; Drupal.wysiwygAttach(context, params[format]); }); } @@ -176,7 +176,7 @@ Drupal.wysiwygAttachToggleLink = functio // Before enabling the editor, detach default behaviors. Drupal.wysiwyg.editor.detach.none(context, params); // Attach new editor using parameters of the currently selected input format. - params = Drupal.settings.wysiwyg.triggers[params.trigger]['format' + $('#' + params.trigger).val()]; + params = Drupal.settings.wysiwyg.triggers[params.trigger][$('#' + params.trigger).val()]; params.status = true; Drupal.wysiwygAttach(context, params); $(this).html(Drupal.settings.wysiwyg.disable).blur(); @@ -208,8 +208,6 @@ Drupal.wysiwyg.getParams = function(elem params[parts[1]] = value; } } - // Convert format id into string. - params.format = 'format' + params.format; // Convert numeric values. params.status = parseInt(params.status, 10); params.toggle = parseInt(params.toggle, 10); Index: wysiwyg.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.module,v retrieving revision 1.46 diff -u -p -r1.46 wysiwyg.module --- wysiwyg.module 18 Oct 2010 21:57:48 -0000 1.46 +++ wysiwyg.module 23 Oct 2010 19:52:41 -0000 @@ -134,21 +134,20 @@ function wysiwyg_pre_render_text_format( } // Determine the available text formats. foreach ($format_field['format']['#options'] as $format_id => $format_name) { - $format = 'format' . $format_id; // Initialize default settings, defaulting to 'none' editor. - $settings[$format]['editor'] = 'none'; - $settings[$format]['status'] = 1; - $settings[$format]['toggle'] = 1; - $settings[$format]['resizable'] = $resizable; + $settings[$format_id]['editor'] = 'none'; + $settings[$format_id]['status'] = 1; + $settings[$format_id]['toggle'] = 1; + $settings[$format_id]['resizable'] = $resizable; // Fetch the profile associated to this text format. $profile = wysiwyg_get_profile($format_id); if ($profile) { $loaded = TRUE; - $settings[$format]['editor'] = $profile->editor; - $settings[$format]['status'] = (int) wysiwyg_user_get_status($profile); + $settings[$format_id]['editor'] = $profile->editor; + $settings[$format_id]['status'] = (int) wysiwyg_user_get_status($profile); if (isset($profile->settings['show_toggle'])) { - $settings[$format]['toggle'] = (int) $profile->settings['show_toggle']; + $settings[$format_id]['toggle'] = (int) $profile->settings['show_toggle']; } // Check editor theme (and reset it if not/no longer available). $theme = wysiwyg_get_editor_themes($profile, (isset($profile->settings['theme']) ? $profile->settings['theme'] : '')); @@ -338,7 +337,7 @@ function wysiwyg_add_editor_settings($pr // drupal_to_js() does not properly convert numeric array keys, so we need // to use a string instead of the format id. if ($config) { - drupal_add_js(array('wysiwyg' => array('configs' => array($profile->editor => array('format' . $profile->format => $config)))), 'setting'); + drupal_add_js(array('wysiwyg' => array('configs' => array($profile->editor => array($profile->format => $config)))), 'setting'); } $formats[$profile->format] = TRUE; } @@ -415,7 +414,7 @@ function wysiwyg_add_plugin_settings($pr $settings_native = call_user_func($editor['plugin settings callback'], $editor, $profile, $profile_plugins_native); if ($settings_native) { - drupal_add_js(array('wysiwyg' => array('plugins' => array('format' . $profile->format => array('native' => $settings_native)))), 'setting'); + drupal_add_js(array('wysiwyg' => array('plugins' => array($profile->format => array('native' => $settings_native)))), 'setting'); } } @@ -446,7 +445,7 @@ function wysiwyg_add_plugin_settings($pr $settings_drupal = call_user_func($editor['proxy plugin settings callback'], $editor, $profile, $profile_plugins_drupal); if ($settings_drupal) { - drupal_add_js(array('wysiwyg' => array('plugins' => array('format' . $profile->format => array('drupal' => $settings_drupal)))), 'setting'); + drupal_add_js(array('wysiwyg' => array('plugins' => array($profile->format => array('drupal' => $settings_drupal)))), 'setting'); } } }