--- tinymce.module	Tue Jul 31 10:40:36 2007
+++ ../../tinymce/tinymce.module	Wed Oct  3 02:29:21 2007
@@ -11,27 +11,28 @@
 /**
  * Implementation of hook_menu().
  */
-function tinymce_menu($may_cache) {
+function tinymce_menu() {
   $items = array();
-  if ($may_cache) {
-    $items[] = array('path' => 'admin/settings/tinymce', 'title' => t('TinyMCE'),
-                     'callback' => 'tinymce_admin',
-                     'description' => t('Configure the rich editor.'),
-                     'access' => user_access('administer tinymce'));
-  }
+    $items['admin/settings/tinymce'] = array(
+      'title' => 'TinyMCE',
+      'page callback' => 'tinymce_admin',
+      'description' => 'Configure the rich editor.',
+      'access arguments' => array('administer tinymce')
+    );
+
   return $items;
 }
 
 /**
  * Implementation of hook_help().
  */
-function tinymce_help($section) {
-  switch ($section) {
+function tinymce_help($path, $arg) {
+  switch ($path) {
     case 'admin/settings/tinymce#pages':
       return "node/*\nuser/*\ncomment/*";
     case 'admin/settings/tinymce':
     case 'admin/help#tinymce' :
-      return t('<p style="font-size:x-small">$Revision: 1.92 $ $Date: 2007/07/31 14:40:36 $</p>' .
+      return t('<p style="font-size:x-small">$Revision: 1.92 $ $Date: 2007/07/31 14:40:36 $</p>'.
                '<p>TinyMCE adds what-you-see-is-what-you-get (WYSIWYG) html editing to textareas. This editor can be enabled/disabled without reloading the page by clicking a link below each textarea.</p>
                 <p>Profiles can be defined based on user roles. A TinyMCE profile can define which pages receive this TinyMCE capability, what buttons or themes are enabled for the editor, how the editor is displayed, and a few other editor functions.</p>
                 <p>Lastly, only users with the <code>access tinymce</code> <a href="!url">permission</a> will be able to use TinyMCE.</p>', array('!url' => url('admin/user/access'))
@@ -46,10 +47,10 @@
   $array = array('administer tinymce', 'access tinymce');
   $tinymce_mod_path = drupal_get_path('module', 'tinymce');
 
-  if (is_dir($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/plugins/imagemanager/')) {
+  if (is_dir($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/plugins/imagemanager/')) {
     $array[] = 'access tinymce imagemanager';
   }
-  if (is_dir($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/plugins/filemanager/')) {
+  if (is_dir($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/plugins/filemanager/')) {
     $array[] = 'access tinymce filemanager';
   }
 
@@ -107,9 +108,9 @@
       $v = is_array($v) ? implode(',', $v) : $v;
       // Don't wrap the JS init in quotes for boolean values or functions.
       if (strtolower($v) != 'true' && strtolower($v) != 'false' && $v[0] != '{') {
-        $v = '"'. $v. '"';
+        $v = '"'. $v .'"';
       }
-      $settings[] = $k. ' : '. $v;
+      $settings[] = $k .' : '. $v;
     }
     $tinymce_settings = implode(",\n    ", $settings);
 
@@ -194,28 +195,28 @@
       $is_running = TRUE;
       $tinymce_mod_path = drupal_get_path('module', 'tinymce');
 
-      if (is_dir($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/plugins/imagemanager/') && user_access('access tinymce imagemanager') ) {
+      if (is_dir($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/plugins/imagemanager/') && user_access('access tinymce imagemanager') ) {
         // if tinymce imagemanager is installed
-        drupal_add_js($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/plugins/imagemanager/jscripts/mcimagemanager.js');
+        drupal_add_js($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/plugins/imagemanager/jscripts/mcimagemanager.js');
       }
 
-      if (is_dir($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/plugins/filemanager/') && user_access('access tinymce filemanager') ) {
+      if (is_dir($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/plugins/filemanager/') && user_access('access tinymce filemanager') ) {
         // if tinymce filemanager is installed
-        drupal_add_js($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/plugins/filemanager/jscripts/mcfilemanager.js');
+        drupal_add_js($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/plugins/filemanager/jscripts/mcfilemanager.js');
       }
 
       // TinyMCE Compressor 1.0.9 and greater
-      if (file_exists($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/tiny_mce_gzip.js')) {
-        drupal_add_js($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/tiny_mce_gzip.js');
+      if (file_exists($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/tiny_mce_gzip.js')) {
+        drupal_add_js($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/tiny_mce_gzip.js');
         drupal_add_js($tinymce_gz_invoke, 'inline');
       }
       // TinyMCE Compressor (versions < 1.0.9)
-      elseif (file_exists($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/tiny_mce_gzip.php')) {
-        drupal_add_js($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/tiny_mce_gzip.php');
+      elseif (file_exists($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/tiny_mce_gzip.php')) {
+        drupal_add_js($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/tiny_mce_gzip.php');
       }
       else {
         // For some crazy reason IE will only load this JS file if the absolute reference is given to it.
-        drupal_add_js($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/tiny_mce.js');
+        drupal_add_js($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/tiny_mce.js');
       }
       drupal_add_js($js_toggle, 'inline');
       // We have to do this becuase of some unfocused CSS in certain themes. See http://drupal.org/node/18879 for details
@@ -384,12 +385,12 @@
  *   An array for each plugin.
  */
 function _tinymce_get_buttons($skip_metadata = TRUE) {
-  include_once(drupal_get_path('module', 'tinymce'). '/plugin_reg.php');
+  include_once(drupal_get_path('module', 'tinymce') .'/plugin_reg.php');
   $plugins = _tinymce_plugins();
 
   if ($skip_metadata == FALSE && is_array($plugins)) {
     foreach ($plugins as $name => $plugin) {
-      $file = drupal_get_path('module', 'tinymce'). '/tinymce/jscripts/tiny_mce/plugins/'. $name .'/editor_plugin_src.js';
+      $file = drupal_get_path('module', 'tinymce') .'/tinymce/jscripts/tiny_mce/plugins/'. $name .'/editor_plugin_src.js';
       // Grab the plugin metadata by scanning the *.js file.
       if (file_exists($file)) {
         $lines = file($file);
@@ -490,7 +491,7 @@
   global $user;
 
   // Drupal theme path.
-  $themepath = path_to_theme() . '/';
+  $themepath = path_to_theme() .'/';
   $host = base_path();
 
   $settings = $profile->settings;
@@ -517,11 +518,11 @@
 
 
   $tinymce_mod_path = drupal_get_path('module', 'tinymce');
-  if (is_dir($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/plugins/imagemanager/') && user_access('access tinymce imagemanager')) {
+  if (is_dir($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/plugins/imagemanager/') && user_access('access tinymce imagemanager')) {
     // we probably need more security than this
     $init['file_browser_callback'] = "mcImageManager.filebrowserCallBack";
   }
-  if (is_dir($tinymce_mod_path . '/tinymce/jscripts/tiny_mce/plugins/filemanager/') && user_access('access tinymce filemanager')) {
+  if (is_dir($tinymce_mod_path .'/tinymce/jscripts/tiny_mce/plugins/filemanager/') && user_access('access tinymce filemanager')) {
     // we probably need more security than this
     $init['file_browser_callback'] = "mcImageManager.filebrowserCallBack";
   }
@@ -544,7 +545,7 @@
       foreach ($plugins as $rname => $rplugin) { // Plugin name
         foreach ($rplugin as $mce_key => $mce_value) { // TinyMCE key
           foreach ($mce_value as $k => $v) { // Buttons
-            if ($settings['buttons'][$rname . '-' . $v]) {
+            if ($settings['buttons'][$rname .'-'. $v]) {
               // Font isn't a true plugin, rather it's buttons made available by the advanced theme
               if (!in_array($rname, $plugin_tracker) && $rname != 'font') $plugin_tracker[] = $rname;
               $init[$mce_key][] = $v;
@@ -617,7 +618,7 @@
   if ($settings['css_classes']) $init['theme_advanced_styles'] = $settings['css_classes'];
 
   if ($settings['css_setting'] == 'theme') {
-    $css = $themepath . 'style.css';
+    $css = $themepath .'style.css';
     if (file_exists($css)) {
       $init['content_css'] = $host . $css;
     }
@@ -650,7 +651,7 @@
   if (arg(3) == 'add') {
     $result = db_query('SELECT DISTINCT(rid) FROM {tinymce_role}');
     while ($data = db_fetch_object($result)) {
-      if (!in_array($data->rid, array_keys((array) $edit->rids)) && !form_get_errors()){
+      if (!in_array($data->rid, array_keys((array) $edit->rids)) && !form_get_errors()) {
         unset($roles[$data->rid]);
       }
     }
@@ -782,7 +783,7 @@
     $form['visibility']['access_pages'] = array(
       '#type' => 'textarea',
       '#title' => t('Pages'),
-      '#default_value' => isset($edit->settings['access_pages']) ? $edit->settings['access_pages'] : tinymce_help('admin/settings/tinymce#pages'),
+      '#default_value' => isset($edit->settings['access_pages']) ? $edit->settings['access_pages'] : tinymce_help('admin/settings/tinymce#pages', arg()),
       '#description' => $description
     );
   }
@@ -798,19 +799,19 @@
 
   $metadata = _tinymce_get_buttons(FALSE);
   // Generate the button list.
-  foreach($metadata as $name => $meta) {
+  foreach ($metadata as $name => $meta) {
     if (is_array($meta['buttons'])) {
       foreach ($meta['buttons'] as $button) {
         if ($name != 'default') {
-          $img_src = drupal_get_path('module', 'tinymce'). "/tinymce/jscripts/tiny_mce/plugins/$name/images/$name.gif";
+          $img_src = drupal_get_path('module', 'tinymce') ."/tinymce/jscripts/tiny_mce/plugins/$name/images/$name.gif";
 
           //correct for plugins that have more than one button
           if (!file_exists($img_src)) {
-            $img_src = drupal_get_path('module', 'tinymce'). "/tinymce/jscripts/tiny_mce/plugins/$name/images/$button.gif";
+            $img_src = drupal_get_path('module', 'tinymce') ."/tinymce/jscripts/tiny_mce/plugins/$name/images/$button.gif";
           }
         }
         else {
-          $img_src = drupal_get_path('module', 'tinymce'). "/tinymce/jscripts/tiny_mce/themes/advanced/images/$button.gif";
+          $img_src = drupal_get_path('module', 'tinymce') ."/tinymce/jscripts/tiny_mce/themes/advanced/images/$button.gif";
         }
 
         $b = file_exists($img_src) ? '<img src="'. base_path() . $img_src .'" title="'. $button .'" style="border: 1px solid grey; vertical-align: middle;" />' : $button;
@@ -823,10 +824,10 @@
           if ($metadata[$name]['infourl']) {
             $title = '<a href="'. $metadata[$name]['infourl'] .'" target="_blank">'. $title .'</a>';
           }
-          $title = $b . ' &#8211; '. $title;
+          $title = $b .' &#8211; '. $title;
         }
-        $form_value = $edit->settings['buttons'][$name . '-' . $button];
-        $form['buttons'][$name . '-' . $button] = array('#type' => 'checkbox', '#title' => $title, '#default_value' => $form_value);
+        $form_value = $edit->settings['buttons'][$name .'-'. $button];
+        $form['buttons'][$name .'-'. $button] = array('#type' => 'checkbox', '#title' => $title, '#default_value' => $form_value);
       }
     }
     else {
@@ -1048,7 +1049,7 @@
     $roles = user_roles();
     $header = array(t('Profile'), t('Roles'), t('Operations'));
     foreach ($profiles as $p) {
-      $rows[] = array(array('data' => $p->name, 'valign' => 'top'), array('data' => implode("<br />\n", $p->rids)), array('data' => l(t('edit'), 'admin/settings/tinymce/edit/'. urlencode($p->name)) . ' '. l(t('delete'), 'admin/settings/tinymce/delete/'. urlencode($p->name)), 'valign' => 'top'));
+      $rows[] = array(array('data' => $p->name, 'valign' => 'top'), array('data' => implode("<br />\n", $p->rids)), array('data' => l(t('edit'), 'admin/settings/tinymce/edit/'. urlencode($p->name)) .' '. l(t('delete'), 'admin/settings/tinymce/delete/'. urlencode($p->name)), 'valign' => 'top'));
     }
     $output .= theme('table', $header, $rows);
     $output .= t('<p><a href="!create-profile-url">Create new profile</a></p>', array('!create-profile-url' => url('admin/settings/tinymce/add')));
@@ -1142,7 +1143,7 @@
 
 function tinymce_user_get_profile($account) {
   $profile_name = db_result(db_query('SELECT s.name FROM {tinymce_settings} s INNER JOIN {tinymce_role} r ON r.name = s.name WHERE r.rid IN (%s)', implode(',', array_keys($account->roles))));
-  if ($profile_name){
+  if ($profile_name) {
     return tinymce_profile_load($profile_name);
   }
   else {
@@ -1150,7 +1151,7 @@
   }
 }
 
-function tinymce_user_get_status($user, $profile){
+function tinymce_user_get_status($user, $profile) {
   $settings = $profile->settings;
 
   if ($settings['user_choose']) {
--- tinymce.install	Tue Jul 31 10:40:36 2007
+++ ../../tinymce/tinymce.install	Wed Oct  3 02:12:13 2007
@@ -12,36 +12,7 @@
  * and will need to be removed.
  */
 function tinymce_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {tinymce_settings} (
-                name varchar(128) NOT NULL default '',
-                settings text,
-                PRIMARY KEY (name)
-               ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-
-      db_query("CREATE TABLE {tinymce_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 {tinymce_settings} (
-                name varchar(128) NOT NULL default '',
-                settings text,
-                PRIMARY KEY (name)
-               );");
-
-      db_query("CREATE TABLE {tinymce_role} (
-                name varchar(128) NOT NULL default '',
-                rid smallint NOT NULL default '0',
-                PRIMARY KEY (name,rid)
-               );");
-      break;
-   }
+  drupal_install_schema('tinymce');
 }
 
 function tinymce_update_1() {
@@ -52,6 +23,5 @@
  * Implementation of hook_uninstall()
  */
 function tinymce_uninstall() {
-  db_query('DROP TABLE {tinymce_settings}');
-  db_query('DROP TABLE {tinymce_role}');
+  drupal_uninstall_schema('tinymce');
 }
--- tinymce.schema	Wed Oct  3 02:43:38 2007
+++ ../../tinymce/tinymce.schema	Wed Oct  3 02:10:23 2007
@@ -0,0 +1,20 @@
+<?php
+function tinymce_schema() {
+  $schema['tinymce_settings'] = array(
+    'fields' => array(
+      'name'     => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
+      'settings' => array('type' => 'text'),
+    ),
+    'primary key' => array('name'),
+  );
+
+  $schema['tinymce_role'] = array(
+    '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;
+}
--- tinymce.info	Tue Jul 31 10:50:13 2007
+++ ../../tinymce/tinymce.info	Wed Oct  3 01:49:58 2007
@@ -1,10 +1,10 @@
 ; $Id: $
 name = TinyMCE
 description = The most popular WYSIWYG editor for advanced content editing.
-
+core = 6.x
 
 ; Information added by drupal.org packaging script on 2007-07-31
-version = "5.x-1.9"
+version = "6.x"
 project = "tinymce"
 datestamp = "1185893413"
 
