Index: modules/tinymce/tinymce.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tinymce/tinymce.install,v
retrieving revision 1.6
diff -u -r1.6 tinymce.install
--- modules/tinymce/tinymce.install	11 May 2006 16:58:18 -0000	1.6
+++ modules/tinymce/tinymce.install	26 Feb 2007 00:26:54 -0000
@@ -18,6 +18,7 @@
       db_query("CREATE TABLE {tinymce_settings} (
                 name varchar(128) NOT NULL default '',
                 settings text NOT NULL default '',
+                custom_config text NOT NULL default '',
                 PRIMARY KEY (name)
                ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
   
@@ -32,6 +33,7 @@
       db_query("CREATE TABLE {tinymce_settings} (
                 name varchar(128) NOT NULL default '',
                 settings text NOT NULL default '',
+                custom_config text NOT NULL default '',
                 PRIMARY KEY (name)
                );");
      
@@ -47,3 +49,16 @@
 function tinymce_update_1() {
   return _system_update_utf8(array('tinymce_settings', 'tinymce_role'));
 }
+
+function tinymce_update_2() {
+  $ret = array();
+
+  if ($GLOBALS['db_type'] == 'mysql') {
+    $ret[] = update_sql("ALTER TABLE {tinymce_settings} ADD custom_config text NOT NULL default ''");
+  }
+  elseif ($GLOBALS['db_type'] == 'pgsql') {
+    db_add_column($ret, 'tinymce_settings', 'custom_config', 'text', array('default' => '', 'not null' => TRUE));
+  }
+
+  return $ret;
+}
Index: modules/tinymce/tinymce.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tinymce/tinymce.module,v
retrieving revision 1.91
diff -u -r1.91 tinymce.module
--- modules/tinymce/tinymce.module	22 Feb 2007 22:41:06 -0000	1.91
+++ modules/tinymce/tinymce.module	26 Feb 2007 00:58:42 -0000
@@ -114,6 +114,7 @@
 
     $enable  = t('enable rich-text');
     $disable = t('disable rich-text');
+    $tinymce_settings = $profile->custom_config ? $profile->custom_config : $tinymce_settings;
 
 $tinymce_invoke = <<<EOD
 
@@ -288,7 +289,8 @@
     case 'img_assist_pages':
     case 'caption': // signature
     case 'pages':
-    case 'access_pages': //TinyMCE profile settings.
+    case 'access_pages': // TinyMCE profile settings.
+    case 'custom_config': // TinyMCE custom configuration.
     case 'user_mail_welcome_body': // user config settings
     case 'user_mail_approval_body': // user config settings
     case 'user_mail_pass_body': // user config settings
@@ -729,6 +731,20 @@
     '#description' => t('TinyMCE support for the Safari web browser is experimental and a warning message is displayed when that browser is detected. You can disable this message here.')
   );
 
+  $form['expert'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Custom configuration (expert use)'),
+    '#collapsible' => TRUE,
+    '#collapsed' => isset($edit->custom_config) && $edit->custom_config ? FALSE : TRUE,
+  );
+
+  $form['expert']['custom_config'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Custom configuration'),
+    '#default_value' => isset($edit->custom_config) ? $edit->custom_config : '',
+    '#description' => t('You may enter a custom configuration here. If you do so, it will override settings you make through the UI for selecting buttons and plugins.'),
+  );
+
   $form['visibility'] = array(
     '#type' => 'fieldset', 
     '#title' => t('Visibility'), 
@@ -1035,7 +1051,9 @@
 function tinymce_profile_save($edit) {
   db_query("DELETE FROM {tinymce_settings} WHERE name = '%s' or name = '%s'", $edit['name'], $edit['old_name']);
   db_query("DELETE FROM {tinymce_role} WHERE name = '%s' or name = '%s'", $edit['name'], $edit['old_name']);
-  db_query("INSERT INTO {tinymce_settings} (name, settings) VALUES ('%s', '%s')", $edit['name'], serialize($edit));
+  $custom_config = $edit['custom_config'];
+  unset($edit['custom_config']);
+  db_query("INSERT INTO {tinymce_settings} (name, settings, custom_config) VALUES ('%s', '%s', '%s')", $edit['name'], serialize($edit), $custom_config);
   foreach ($edit['rids'] as $rid => $value) {
     db_query("INSERT INTO {tinymce_role} (name, rid) VALUES ('%s', %d)", $edit['name'], $rid);
   }
