Is it possible to disable the tinyMCE editor for the "Contact form" module only so that when the site is online the user not have use of it??

Thanks for your time.
--
JamesKB

Comments

CleanCutRogue’s picture

Just place the following code in your template.php file for your current theme:

<?php
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
  switch ($textarea_name) {
    // Disable tinymce for these textareas
    case 'log': // book and page log
    case 'img_assist_pages':
    case 'caption': // signature
    case 'comment':
    case 'pages':
    case 'access_pages': //TinyMCE profile settings.
    case 'user_mail_welcome_body': // user config settings
    case 'user_mail_approval_body': // user config settings
    case 'user_mail_pass_body': // user config settings
    case 'synonyms': // taxonomy terms
    case 'description': // taxonomy terms
      unset($init);
      break;

    // Force the 'simple' theme for some of the smaller textareas.
    case 'site_mission':
    case 'site_footer':
    case 'site_offline_message':
    case 'page_help':
    case 'user_registration_help':
    case 'user_picture_guidelines':
      $init['theme'] = 'simple';
      foreach ($init as $k => $v) {
        if (strstr($k, 'theme_advanced_')) unset($init[$k]);
      }
      break;
  }

  // Always return $init
  return $init;
}?>

It seems like a lot of code, but it's necessary. It will be called instead of the theme_tinymce_theme() function in the tinymce module, but is a copy of that function (renamed with the phptemplate_ prefix instead of the theme_ prefix). I added a case for 'comment' but otherwise it's just a copy of that function.

JamesKB’s picture

Thanka for your help. I'll give that a shot.

CleanCutRogue’s picture

Oops - I misread your title... I added "comment" as a case for disabling tinyMCE. That's wrong. That will disable it for comments, not the contact form. Sorry about that.

The same principal applies though. I think you have to replace "comment" with "contact" but otherwise it should work.