Index: wysiwyg.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.admin.inc,v
retrieving revision 1.18
diff -u -p -r1.18 wysiwyg.admin.inc
--- wysiwyg.admin.inc	26 Sep 2009 05:37:56 -0000	1.18
+++ wysiwyg.admin.inc	28 Oct 2009 17:44:33 -0000
@@ -98,7 +98,7 @@ function wysiwyg_profile_form($form, &$f
     '#description' => t('The language to use for the editor interface. Language codes are based on the <a href="http://www.loc.gov/standards/iso639-2/englangn.html">ISO-639-2</a> format.'),
   );
 
-  $form['buttons'] = array(
+  $form['wysiwyg_buttons'] = array(
     '#type' => 'fieldset',
     '#title' => t('Buttons and plugins'),
     '#collapsible' => TRUE,
@@ -125,7 +125,7 @@ function wysiwyg_profile_form($form, &$f
         }
         $title = (isset($meta['url']) ? l($title, $meta['url'], array('target' => '_blank')) : $title);
         $title = (!empty($icon) ? $icon . ' ' . $title : $title);
-        $form['buttons'][$name][$button] = array(
+        $form['wysiwyg_buttons'][$name][$button] = array(
           '#type' => 'checkbox',
           '#title' => $title,
           '#default_value' => !empty($profile->settings['buttons'][$name][$button]) ? $profile->settings['buttons'][$name][$button] : FALSE,
@@ -134,7 +134,7 @@ function wysiwyg_profile_form($form, &$f
     }
     else if (isset($meta['extensions']) && is_array($meta['extensions'])) {
       foreach ($meta['extensions'] as $extension => $title) {
-        $form['buttons'][$name][$extension] = array(
+        $form['wysiwyg_buttons'][$name][$extension] = array(
           '#type' => 'checkbox',
           '#title' => isset($meta['url']) ? l($title, $meta['url'], array('target' => '_blank')) : $title,
           '#default_value' => !empty($profile->settings['buttons'][$name][$extension]) ? $profile->settings['buttons'][$name][$extension] : FALSE,
@@ -292,10 +292,10 @@ function wysiwyg_profile_form($form, &$f
  */
 function wysiwyg_profile_form_submit($form, &$form_state) {
   $values = $form_state['values'];
-  if (isset($values['buttons'])) {
+  if (isset($values['wysiwyg_buttons'])) {
     // Store only enabled buttons for each plugin.
-    foreach ($values['buttons'] as $plugin => $buttons) {
-      $values['buttons'][$plugin] = array_filter($values['buttons'][$plugin]);
+    foreach ($values['wysiwyg_buttons'] as $plugin => $buttons) {
+      $values['buttons'][$plugin] = array_filter($values['wysiwyg_buttons'][$plugin]);
     }
     // Store only enabled plugins.
     $values['buttons'] = array_filter($values['buttons']);
@@ -321,7 +321,8 @@ function wysiwyg_profile_form_submit($fo
 /**
  * Layout for the buttons in the Wysiwyg Editor profile form.
  */
-function theme_wysiwyg_admin_button_table($form) {
+function theme_wysiwyg_admin_button_table($variables) {
+  $form = $variables['form'];
   $buttons = array();
 
   // Flatten forms array.
@@ -346,7 +347,7 @@ function theme_wysiwyg_admin_button_tabl
     $rows[] = $row;
   }
 
-  $output = theme('table', array(), $rows, array('width' => '100%'));
+  $output = theme('table', array('rows' => $rows, 'attributes' => array('width' => '100%')));
 
   return $output;
 }
@@ -363,6 +364,9 @@ function wysiwyg_profile_overview($form,
   $status = array();
   $options = array('' => t('No editor'));
 
+  // D7's seven theme displays links in table headers as block elements.
+  drupal_add_css('table.system-status-report th a {display: inline;}', 'inline');
+
   foreach ($editors as $name => $editor) {
     $status[$name] = array(
       'severity' => (isset($editor['error']) ? REQUIREMENT_ERROR : ($editor['installed'] ? REQUIREMENT_OK : REQUIREMENT_INFO)),
@@ -403,7 +407,7 @@ function wysiwyg_profile_overview($form,
     '#description' => (!$count ? t('There are no editor libraries installed currently. The following list contains a list of currently supported editors:') : ''),
     '#weight' => 10,
   );
-  $form['status']['report'] = array('#markup' => theme('status_report', $status));
+  $form['status']['report'] = array('#markup' => theme('status_report', array('requirements' => $status)));
 
   if (!$count) {
     return $form;
@@ -416,6 +420,8 @@ function wysiwyg_profile_overview($form,
     '#description' => t('To assign a different editor to a text format, click "delete" to remove the existing first.'),
     '#tree' => TRUE,
   );
+
+  $enable_save = FALSE;
   foreach ($formats as $id => $format) {
     $form['formats'][$id]['name'] = array(
       '#markup' => check_plain($format->name),
@@ -433,6 +439,7 @@ function wysiwyg_profile_overview($form,
         '#default_value' => '',
         '#options' => $options,
       );
+      $enable_save = TRUE;
     }
     if (isset($profiles[$id]) && !empty($profiles[$id]->editor)) {
       $form['formats'][$id]['edit'] = array(
@@ -444,14 +451,18 @@ function wysiwyg_profile_overview($form,
     }
   }
 
-  $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
+  // Submitting the form when no editors can be selected causes errors.
+  if ($enable_save) {
+    $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
+  }
   return $form;
 }
 
 /**
  * Return HTML for the Wysiwyg profile overview form.
  */
-function theme_wysiwyg_profile_overview($form) {
+function theme_wysiwyg_profile_overview($variables) {
+  $form = $variables['form'];
   if (!isset($form['formats'])) {
     return;
   }
@@ -467,7 +478,7 @@ function theme_wysiwyg_profile_overview(
       isset($format['delete']) ? drupal_render($format['delete']) : '',
     );
   }
-  $form['formats']['table']['#markup'] = theme('table', $header, $rows);
+  $form['formats']['table']['#markup'] = theme('table', array('header' => $header, 'rows' => $rows));
   $output .= drupal_render_children($form);
   return $output;
 }
Index: wysiwyg.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.js,v
retrieving revision 1.17
diff -u -p -r1.17 wysiwyg.js
--- wysiwyg.js	26 Sep 2009 05:37:56 -0000	1.17
+++ wysiwyg.js	28 Oct 2009 17:44:33 -0000
@@ -46,7 +46,7 @@ Drupal.behaviors.attachWysiwyg = {
     }
 
     $('.wysiwyg', context).once('wysiwyg', function() {
-      if (!this.id || !this.value || typeof Drupal.settings.wysiwyg.triggers[this.id] === undefined) {
+      if (!this.id || !this.value || typeof Drupal.settings.wysiwyg.triggers[this.id] === 'undefined') {
         return;
       }
       var $this = $(this);
Index: wysiwyg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.module,v
retrieving revision 1.40
diff -u -p -r1.40 wysiwyg.module
--- wysiwyg.module	26 Sep 2009 05:37:57 -0000	1.40
+++ wysiwyg.module	28 Oct 2009 17:44:34 -0000
@@ -62,13 +62,13 @@ function wysiwyg_menu() {
 function wysiwyg_theme() {
   return array(
     'wysiwyg_profile_overview' => array(
-      'arguments' => array('form' => NULL),
+      'render element' => 'form',
     ),
     'wysiwyg_admin_button_table' => array(
-      'arguments' => array('form' => NULL),
+      'render element' => 'form',
     ),
     'wysiwyg_dialog_page' => array(
-      'arguments' => array('content' => NULL, 'show_messages' => TRUE),
+      'variables' => array('content' => NULL, 'show_messages' => TRUE),
       'file' => 'wysiwyg.dialog.inc',
       'template' => 'wysiwyg-dialog-page',
     ),
@@ -248,7 +248,7 @@ function wysiwyg_load_editor($profile) {
       foreach ($files as $file => $options) {
         if (is_array($options)) {
           $options += array('type' => 'file', 'scope' => 'header', 'defer' => FALSE, 'cache' => TRUE, 'preprocess' => TRUE);
-          drupal_add_js($editor['library path'] . '/' . $file, $options['type'], $options['scope'], $options['defer'], $options['cache'], $options['preprocess']);
+          drupal_add_js($editor['library path'] . '/' . $file, $options);
         }
         else {
           drupal_add_js($editor['library path'] . '/' . $options);
Index: plugins/break/break.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/plugins/break/break.js,v
retrieving revision 1.6
diff -u -p -r1.6 break.js
--- plugins/break/break.js	13 Jun 2009 01:14:43 -0000	1.6
+++ plugins/break/break.js	28 Oct 2009 17:44:34 -0000
@@ -1,5 +1,6 @@
 // $Id: break.js,v 1.6 2009/06/13 01:14:43 sun Exp $
 
+(function ($) {
 // @todo Array syntax required; 'break' is a predefined token in JavaScript.
 Drupal.wysiwyg.plugins['break'] = {
 
@@ -64,3 +65,4 @@ Drupal.wysiwyg.plugins['break'] = {
     return '<img src="' + settings.path + '/images/spacer.gif" alt="&lt;--break-&gt;" title="&lt;--break--&gt;" class="wysiwyg-break drupal-content" />';
   }
 };
+})(jQuery);
