Index: wysiwyg.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.js,v
retrieving revision 1.14
diff -u -p -r1.14 wysiwyg.js
--- wysiwyg.js	4 Jun 2009 21:46:17 -0000	1.14
+++ wysiwyg.js	7 Jun 2009 22:59:41 -0000
@@ -94,10 +94,16 @@ Drupal.wysiwygAttach = function(context,
     }
     // Store this field id, so (external) plugins can use it.
     // @todo Wrong point in time. Probably can only supported by editors which
-    //   support a onFocus() or similar event.
+    //   support an onFocus() or similar event.
     Drupal.wysiwyg.activeId = params.field;
-    // Attach or update toggle link.
-    Drupal.wysiwygAttachToggleLink(context, params);
+    // Attach or update toggle link, if enabled.
+    if (params.toggle) {
+      Drupal.wysiwygAttachToggleLink(context, params);
+    }
+    // Otherwise, ensure that toggle link is hidden.
+    else {
+      $('#wysiwyg-toggle-' + params.field).hide();
+    }
     // Attach editor, if enabled by default or last state was enabled.
     if (params.status) {
       Drupal.wysiwyg.editor.attach[params.editor](context, params, (Drupal.settings.wysiwyg.configs[params.editor] ? jQuery.extend(true, {}, Drupal.settings.wysiwyg.configs[params.editor][params.format]) : {}));
@@ -134,36 +140,38 @@ Drupal.wysiwygDetach = function(context,
  *   An object containing input format parameters.
  */
 Drupal.wysiwygAttachToggleLink = function(context, params) {
-  if (!$('#wysiwyg-toggle-' + params.field).size()) {
+  if (!$('#wysiwyg-toggle-' + params.field).length) {
     var text = document.createTextNode(params.status ? Drupal.settings.wysiwyg.disable : Drupal.settings.wysiwyg.enable);
     var a = document.createElement('a');
-    $(a).attr({id: 'wysiwyg-toggle-' + params.field, href: 'javascript:void(0);'}).append(text);
+    $(a).attr({ id: 'wysiwyg-toggle-' + params.field, href: 'javascript:void(0);' }).append(text);
     var div = document.createElement('div');
     $(div).addClass('wysiwyg-toggle-wrapper').append(a);
     $('#' + params.field).after(div);
   }
-  $('#wysiwyg-toggle-' + params.field).html(params.status ? Drupal.settings.wysiwyg.disable : Drupal.settings.wysiwyg.enable).show().unbind('click').click(function() {
-    if (params.status) {
-      // Detach current editor.
-      params.status = false;
-      Drupal.wysiwygDetach(context, params);
-      // After disabling the editor, re-attach default behaviors.
-      // @todo We HAVE TO invoke Drupal.wysiwygAttach() here.
-      Drupal.wysiwyg.editor.attach.none(context, params);
-      Drupal.wysiwyg.instances[params.field] = Drupal.wysiwyg.editor.instance.none;
-      Drupal.wysiwyg.instances[params.field].editor = 'none';
-      $(this).html(Drupal.settings.wysiwyg.enable).blur();
-    }
-    else {
-      // 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.
-      Drupal.wysiwyg.getParams($('.wysiwyg-field-' + params.field + ':checked, div.wysiwyg-field-' + params.field, context).get(0), params);
-      params.status = true;
-      Drupal.wysiwygAttach(context, params);
-      $(this).html(Drupal.settings.wysiwyg.disable).blur();
-    }
-  });
+  $('#wysiwyg-toggle-' + params.field)
+    .html(params.status ? Drupal.settings.wysiwyg.disable : Drupal.settings.wysiwyg.enable).show()
+    .unbind('click').click(function() {
+      if (params.status) {
+        // Detach current editor.
+        params.status = false;
+        Drupal.wysiwygDetach(context, params);
+        // After disabling the editor, re-attach default behaviors.
+        // @todo We HAVE TO invoke Drupal.wysiwygAttach() here.
+        Drupal.wysiwyg.editor.attach.none(context, params);
+        Drupal.wysiwyg.instances[params.field] = Drupal.wysiwyg.editor.instance.none;
+        Drupal.wysiwyg.instances[params.field].editor = 'none';
+        $(this).html(Drupal.settings.wysiwyg.enable).blur();
+      }
+      else {
+        // 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.
+        Drupal.wysiwyg.getParams($('.wysiwyg-field-' + params.field + ':checked, div.wysiwyg-field-' + params.field, context).get(0), params);
+        params.status = true;
+        Drupal.wysiwygAttach(context, params);
+        $(this).html(Drupal.settings.wysiwyg.disable).blur();
+      }
+    });
   // Hide toggle link in case no editor is attached.
   if (params.editor == 'none') {
     $('#wysiwyg-toggle-' + params.field).hide();
@@ -194,6 +202,7 @@ Drupal.wysiwyg.getParams = function(elem
   params.format = 'format' + params.format;
   // Convert numeric values.
   params.status = parseInt(params.status, 10);
+  params.toggle = parseInt(params.toggle, 10);
   params.resizable = parseInt(params.resizable, 10);
   return params;
 };
Index: wysiwyg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.module,v
retrieving revision 1.29
diff -u -p -r1.29 wysiwyg.module
--- wysiwyg.module	18 May 2009 01:08:13 -0000	1.29
+++ wysiwyg.module	7 Jun 2009 23:00:05 -0000
@@ -130,11 +130,13 @@ function wysiwyg_process_form(&$form) {
             // Default to 'none' editor (Drupal's default behaviors).
             $editor = 'none';
             $status = 1;
+            $toggle = 1;
             // Fetch the profile associated to this input format.
             $profile = wysiwyg_get_profile($format);
             if ($profile) {
               $editor = $profile->editor;
-              $status = (int)wysiwyg_user_get_status($profile);
+              $status = (int) wysiwyg_user_get_status($profile);
+              $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'] : ''));
 
@@ -147,7 +149,7 @@ function wysiwyg_process_form(&$form) {
             // Use a prefix/suffix for a single input format, or attach to input
             // format selector radio buttons.
             if (isset($element['format']['guidelines'])) {
-              $element['format']['guidelines']['#prefix'] = '<div class="wysiwyg wysiwyg-format-'. $format .' wysiwyg-editor-'. $editor .' wysiwyg-field-'. $field['#id'] .' wysiwyg-status-'. $status . $extra_class .'">';
+              $element['format']['guidelines']['#prefix'] = '<div class="wysiwyg wysiwyg-format-' . $format . ' wysiwyg-editor-' . $editor . ' wysiwyg-field-' . $field['#id'] . ' wysiwyg-status-' . $status . ' wysiwyg-toggle-' . $toggle . $extra_class . '">';
               $element['format']['guidelines']['#suffix'] = '</div>';
               // Edge-case: Default format contains no input filters.
               if (empty($element['format']['guidelines']['#value'])) {
@@ -155,13 +157,8 @@ function wysiwyg_process_form(&$form) {
               }
             }
             else {
-              if (isset($element[$format]['#attributes']['class'])) {
-                $element[$format]['#attributes']['class'] .= ' ';
-              }
-              else {
-                $element[$format]['#attributes']['class'] = '';
-              }
-              $element[$format]['#attributes']['class'] .= 'wysiwyg wysiwyg-format-'. $format .' wysiwyg-editor-'. $editor .' wysiwyg-field-'. $field['#id'] .' wysiwyg-status-'. $status . $extra_class;
+              $element[$format]['#attributes']['class'] = (isset($element[$format]['#attributes']['class']) ? $element[$format]['#attributes']['class'] . ' ' : '');
+              $element[$format]['#attributes']['class'] .= 'wysiwyg wysiwyg-format-' . $format . ' wysiwyg-editor-' . $editor . ' wysiwyg-field-' . $field['#id'] . ' wysiwyg-status-' . $status . ' wysiwyg-toggle-' . $toggle . $extra_class;
             }
           }
         }
