Index: wysiwyg_editor.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg_editor.admin.inc,v
retrieving revision 1.9
diff -u -p -r1.9 wysiwyg_editor.admin.inc
--- wysiwyg_editor.admin.inc	11 Jun 2008 04:29:01 -0000	1.9
+++ wysiwyg_editor.admin.inc	11 Jun 2008 04:29:52 -0000
@@ -8,18 +8,22 @@
  */
 
 /**
- * Controller for Wysiwyg Editor administrative settings.
+ * Callback handler for admin pages; menu callback.
  *
  * @todo Move into hook_menu(), resp. FAPI functions.
  */
-function _wysiwyg_editor_admin($op = NULL) {
+function wysiwyg_editor_admin($arg = '') {
   $edit = $_POST;
+  $op = isset($_POST['op']) ? $_POST['op'] : '';
+  $op = ($arg && !$op ? $arg : $op);
   switch ($op) {
     case 'add':
-      $breadcrumb[] = array('path' => 'admin', 'title' => t('administer'));
-      $breadcrumb[] = array('path' => 'admin/settings/wysiwyg/profile', 'title' => t('Wysiwyg Editor'));
-      $breadcrumb[] = array('path' => 'admin/settings/wysiwyg/profile/add', 'title' => t('Add new Wysiwyg Editor profile'));
-      menu_set_location($breadcrumb);
+      $breadcrumb[] = l(t('Home'), NULL);
+      $breadcrumb[] = l(t('Administer'), 'admin');
+      $breadcrumb[] = l(t('Site configuration'), 'admin/settings');
+      $breadcrumb[] = l(t('Wysiwyg'), 'admin/settings/wysiwyg');
+      $breadcrumb[] = l(t('Wysiwyg Profiles'), 'admin/settings/wysiwyg/profile');
+      drupal_set_breadcrumb($breadcrumb);
       $output = drupal_get_form('wysiwyg_editor_profile_form', $edit);
       break;
 
@@ -49,7 +53,7 @@ function _wysiwyg_editor_admin($op = NUL
 /**
  * Return an HTML form for profile configuration.
  */
-function wysiwyg_editor_profile_form($edit) {
+function wysiwyg_editor_profile_form($form_state, $edit) {
   // Merge in defaults.
   settype($edit, 'array');
   $edit += array(
@@ -395,35 +399,35 @@ function wysiwyg_editor_profile_form($ed
  *
  * @see wysiwyg_editor_profile_form_build()
  */
-function wysiwyg_editor_profile_form_submit($form_id, &$form_values) {
+function wysiwyg_editor_profile_form_submit($form, &$form_state) {
   // Count enabled plugins for this profile.
   $plugin_count = 0;
-  foreach ($form_values['buttons'] as $plugin => $buttons) {
-    $form_values['buttons'][$plugin] = array_filter($form_values['buttons'][$plugin]);
-    $plugin_count += count($form_values['buttons'][$plugin]);
+  foreach ($form_state['values']['buttons'] as $plugin => $buttons) {
+    $form_state['values']['buttons'][$plugin] = array_filter($form_state['values']['buttons'][$plugin]);
+    $plugin_count += count($form_state['values']['buttons'][$plugin]);
   }
-  $form_values['buttons'] = array_filter($form_values['buttons']);
+  $form_state['values']['buttons'] = array_filter($form_state['values']['buttons']);
 
   // Filter enabled roles for this profile.
-  $form_values['rids'] = array_filter($form_values['rids']);
+  $form_state['values']['rids'] = array_filter($form_state['values']['rids']);
 
   // Delete existing profile(s) with the current profile name.
-  if (!empty($form_values['old_name'])) {
-    db_query("DELETE FROM {wysiwyg_editor_profile} WHERE name = '%s' OR name = '%s'", $form_values['name'], $form_values['old_name']);
-    db_query("DELETE FROM {wysiwyg_editor_role} WHERE name = '%s' OR name = '%s'", $form_values['name'], $form_values['old_name']);
+  if (!empty($form_state['values']['old_name'])) {
+    db_query("DELETE FROM {wysiwyg_editor_profile} WHERE name = '%s' OR name = '%s'", $form_state['values']['name'], $form_state['values']['old_name']);
+    db_query("DELETE FROM {wysiwyg_editor_role} WHERE name = '%s' OR name = '%s'", $form_state['values']['name'], $form_state['values']['old_name']);
   }
 
   // Remove FAPI values.
   // @see system_settings_form_submit()
-  unset($form_values['submit'], $form_values['form_id'], $form_values['op'], $form_values['form_token']);
+  unset($form_state['values']['submit'], $form_state['values']['form_id'], $form_state['values']['op'], $form_state['values']['form_token']);
 
   // Insert new profile data.
-  db_query("INSERT INTO {wysiwyg_editor_profile} (name, settings, plugin_count) VALUES ('%s', '%s', %d)", $form_values['name'], serialize($form_values), $plugin_count);
-  foreach ($form_values['rids'] as $rid => $value) {
-    db_query("INSERT INTO {wysiwyg_editor_role} (name, rid) VALUES ('%s', %d)", $form_values['name'], $rid);
+  db_query("INSERT INTO {wysiwyg_editor_profile} (name, settings, plugin_count) VALUES ('%s', '%s', %d)", $form_state['values']['name'], serialize($form_state['values']), $plugin_count);
+  foreach ($form_state['values']['rids'] as $rid => $value) {
+    db_query("INSERT INTO {wysiwyg_editor_role} (name, rid) VALUES ('%s', %d)", $form_state['values']['name'], $rid);
   }
 
-  if (isset($form_values['old_name'])) {
+  if (isset($form_state['values']['old_name'])) {
     drupal_set_message(t('Wysiwyg Editor profile has been updated.'));
   }
   else {
@@ -477,7 +481,7 @@ function wysiwyg_editor_profile_overview
   // Check if at least one role is granted access to Wysiwyg Editor.
   $access_check = user_roles(FALSE, 'access wysiwyg editor');
   if (!$access_check) {
-    drupal_set_message(t('You must <a href="!access-control-url">assign</a> at least one role with the \'access wysiwyg editor\' permission before creating a profile.', array('!access-control-url' => url('admin/user/access'))), 'error');
+    drupal_set_message(t('You must <a href="!access-control-url">assign</a> at least one role with the \'access wysiwyg editor\' permission before creating a profile.', array('!access-control-url' => url('admin/user/permissions'))), 'error');
     $usable = FALSE;
   }
   if (!$usable) {
Index: wysiwyg_editor.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg_editor.info,v
retrieving revision 1.3
diff -u -p -r1.3 wysiwyg_editor.info
--- wysiwyg_editor.info	10 Jun 2008 18:20:14 -0000	1.3
+++ wysiwyg_editor.info	11 Jun 2008 04:29:55 -0000
@@ -2,3 +2,4 @@
 name = Wysiwyg Editor
 description = Allows users to edit contents with client-side editors.
 package = User Interface
+core = 6.x
Index: wysiwyg_editor.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg_editor.install,v
retrieving revision 1.6
diff -u -p -r1.6 wysiwyg_editor.install
--- wysiwyg_editor.install	11 Jun 2008 04:29:01 -0000	1.6
+++ wysiwyg_editor.install	11 Jun 2008 04:30:06 -0000
@@ -3,39 +3,60 @@
 
 
 /**
+ * Implementation of hook_schema().
+ */
+function wysiwyg_editor_schema() {
+  $schema = array();
+  $schema['wysiwyg_editor_profile'] = array(
+    'description' => t('Stores Wysiwyg Editor profiles.'),
+    'fields' => array(
+      'name' => array(
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'settings' => array(
+        'type' => 'text',
+        'size' => 'normal',
+      ),
+      'plugin_count' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'primary key' => array('name'),
+  );
+  $schema['wysiwyg_editor_role'] = array(
+    'description' => t('Stores user role access permissions for Wysiwyg Editor profiles.'),
+    'fields' => array(
+      'name' => array(
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'rid' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'primary key' => array('name', 'rid'),
+  );
+  return $schema;
+}
+
+/**
  * Implementation of hook_install().
  */
 function wysiwyg_editor_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {wysiwyg_editor_profile} (
-        name varchar(128) NOT NULL default '',
-        settings text,
-        plugin_count tinyint NOT NULL default '0',
-        PRIMARY KEY (name)
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */");
-      db_query("CREATE TABLE {wysiwyg_editor_role} (
-        name varchar(128) NOT NULL default '',
-        rid tinyint(3) unsigned NOT NULL default '0',
-        PRIMARY KEY (name,rid)
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */");
-      break;
-
-    case 'pgsql':
-      db_query("CREATE TABLE {wysiwyg_editor_profile} (
-        name varchar(128) NOT NULL default '',
-        settings text,
-        plugin_count smallint NOT NULL default '0',
-        PRIMARY KEY (name)
-      )");
-      db_query("CREATE TABLE {wysiwyg_editor_role} (
-        name varchar(128) NOT NULL default '',
-        rid smallint NOT NULL default '0',
-        PRIMARY KEY (name,rid)
-      )");
-      break;
-  }
+  drupal_install_schema('wysiwyg_editor');
   // Import data from old editor modules.
   wysiwyg_editor_migrate_tinymce();
 }
@@ -44,8 +65,7 @@ function wysiwyg_editor_install() {
  * Implementation of hook_uninstall()
  */
 function wysiwyg_editor_uninstall() {
-  db_query('DROP TABLE {wysiwyg_editor_profile}');
-  db_query('DROP TABLE {wysiwyg_editor_role}');
+  drupal_uninstall_schema('wysiwyg_editor');
 }
 
 /**
@@ -73,24 +93,6 @@ function wysiwyg_editor_migrate_tinymce(
 }
 
 /**
- * Add plugin_count to editor profiles.
- */
-function wysiwyg_editor_update_5000() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("ALTER TABLE {wysiwyg_editor_profile} ADD COLUMN plugin_count tinyint NOT NULL default '0'");
-      break;
-
-    case 'pgsql':
-      db_add_column($ret, 'wysiwyg_editor_profile', 'plugin_count', 'smallint', array('not null' => TRUE, 'default' => "'0'"));
-      break;
-  }
-  return $ret;
-}
-
-/**
  * Convert buttons and plugins into associative array and fix plugin count for old profiles.
  *
  * Note: This update is required for wysiwyg_editor_migrate_tinymce().
Index: wysiwyg_editor.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg_editor.module,v
retrieving revision 1.11
diff -u -p -r1.11 wysiwyg_editor.module
--- wysiwyg_editor.module	11 Jun 2008 04:29:01 -0000	1.11
+++ wysiwyg_editor.module	11 Jun 2008 04:30:27 -0000
@@ -10,28 +10,35 @@
 /**
  * Implementation of hook_menu().
  */
-function wysiwyg_editor_menu($may_cache) {
+function wysiwyg_editor_menu() {
   $items = array();
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/wysiwyg/profile',
-      'title' => t('Wysiwyg Editor'),
-      'callback' => 'wysiwyg_editor_admin',
-      'description' => t('Configure the rich editor.'),
-      'access' => user_access('administer site configuration'),
-    );
-  }
+  $items['admin/settings/wysiwyg/profile'] = array(
+    'title' => 'Wysiwyg Editor',
+    'page callback' => 'wysiwyg_editor_admin',
+    'description' => 'Configure the rich editor.',
+    'access arguments' => array('administer site configuration'),
+    'file' => 'wysiwyg_editor.admin.inc',
+  );
   return $items;
 }
 
 /**
+ * Implementation of hook_theme().
+ */
+function wysiwyg_editor_theme() {
+  return array(
+    'wysiwyg_editor_admin_button_table' => array('arguments' => array('form')),
+  );
+}
+
+/**
  * Implementation of hook_help().
  */
-function wysiwyg_editor_help($section) {
-  switch ($section) {
+function wysiwyg_editor_help($path, $arg) {
+  switch ($path) {
     case 'admin/settings/wysiwyg/profile':
     case 'admin/help#wysiwyg_editor':
-      $output = '<p>'. t('Profiles can be defined based on user roles. A Wysiwyg Editor profile can define which pages receive this Wysiwyg Editor capability, what buttons or themes are enabled for the editor, how the editor is displayed, and a few other editor functions. Lastly, only users with the %permission <a href="!url">user permission</a> are able to use Wysiwyg Editor.', array('%permission' => 'access wysiwyg editor', '!url' => url('admin/user/access'))) .'</p>';
+      $output = '<p>'. t('Profiles can be defined based on user roles. A Wysiwyg Editor profile can define which pages receive this Wysiwyg Editor capability, what buttons or themes are enabled for the editor, how the editor is displayed, and a few other editor functions. Lastly, only users with the %permission <a href="!url">user permission</a> are able to use Wysiwyg Editor.', array('%permission' => 'access wysiwyg editor', '!url' => url('admin/user/permissions'))) .'</p>';
       return $output;
   }
 }
@@ -54,28 +61,27 @@ function wysiwyg_editor_perm() {
 }
 
 /**
- * Callback handler for admin pages; menu callback.
- */
-function wysiwyg_editor_admin($arg = '') {
-  require_once drupal_get_path('module', 'wysiwyg_editor') .'/wysiwyg_editor.admin.inc';
-  $op = isset($_POST['op']) ? $_POST['op'] : '';
-  $op = ($arg && !$op ? $arg : $op);
-  return _wysiwyg_editor_admin($op);
-}
-
-/**
  * Implementation of hook_elements().
  */
 function wysiwyg_editor_elements() {
   $type = array();
   if (user_access('access wysiwyg editor')) {
     // Let Wysiwyg Editor potentially process each textarea.
-    $type['textarea'] = array('#process' => array('wysiwyg_editor_process_textarea' => array()), '#wysiwyg' => TRUE, '#wysiwyg_style' => 'advanced');
+    $type['textarea'] = array('#process' => array('wysiwyg_editor_process_textarea'), '#wysiwyg' => TRUE, '#wysiwyg_style' => 'advanced');
   }
   return $type;
 }
 
 /**
+ * Implementation of hook_form_alter().
+ */
+function wysiwyg_editor_form_alter(&$form, &$form_state) {
+  // Disable 'teaser' textarea.
+  unset($form['body_field']['teaser_js']);
+  $form['body_field']['teaser_include'] = array();
+}
+
+/**
  * Load Wysiwyg Editor files and send configuration data.
  */
 function wysiwyg_editor_load() {
@@ -106,14 +112,14 @@ function wysiwyg_editor_load() {
 
     // TinyMCE Compressor >= 1.0.9
     if (file_exists($path_editor .'/tiny_mce_gzip.js')) {
-      drupal_add_js($path_editor .'/tiny_mce_gzip.js');
+      drupal_add_js($path_editor .'/tiny_mce_gzip.js', 'module', 'header', FALSE, FALSE, FALSE);
     }
     // TinyMCE Compressor < 1.0.9
     elseif (file_exists($path_editor .'/tiny_mce_gzip.php')) {
-      drupal_add_js($path_editor .'/tiny_mce_gzip.php');
+      drupal_add_js($path_editor .'/tiny_mce_gzip.php', 'module', 'header', FALSE, FALSE, FALSE);
     }
     else {
-      drupal_add_js($path_editor .'/tiny_mce.js');
+      drupal_add_js($path_editor .'/tiny_mce.js', 'module', 'header', FALSE, FALSE);
     }
     // Add wysiwyg_editor.js to the footer to ensure it's executed after the
     // Drupal.settings array has been rendered and populated.
