diff -r 75cd02e917a1 htdocs/sites/all/modules/wysiwyg/wysiwyg.module --- a/htdocs/sites/all/modules/wysiwyg/wysiwyg.module Thu Nov 19 02:03:09 2009 -0500 +++ b/htdocs/sites/all/modules/wysiwyg/wysiwyg.module Mon Nov 23 15:33:19 2009 -0500 @@ -93,12 +93,48 @@ * * @see wysiwyg_process_form() */ -function wysiwyg_form_alter(&$form, &$form_state) { +function wysiwyg_form_alter(&$form, &$form_state, $form_id) { $form['#after_build'][] = 'wysiwyg_process_form'; // Teaser splitter is unconditionally removed and NOT supported. if (isset($form['body_field'])) { unset($form['body_field']['teaser_js']); } + + switch($form_id) { + case 'panels_edit_display_form': + case 'panels_panel_context_edit_content': + // Load a fake version of TinyMCE on the original page to get the javascript added + $form['tinymce_hidden'] = array( + '#type' => 'fieldset', + '#attributes' => array('style' => 'display: none'), + ); + $form['tinymce_hidden']['tinymce_prerender'] = array( + '#type' => 'textarea', + ); + + foreach (filter_formats() as $format => $object) { + if ($profile = wysiwyg_get_profile($format)) { + // wysiwyg_get_profile calls wysiwyg_load_editor + + // copied from wysiwyg.module + $theme = wysiwyg_get_editor_themes($profile, (isset($profile->settings['theme']) ? $profile->settings['theme'] : '')); + // Add plugin settings (first) for this input format. + wysiwyg_add_plugin_settings($profile); + // Add profile settings for this input format. + wysiwyg_add_editor_settings($profile, $theme); + // /copied from wysiwyg.module + } + } + + break; + + case 'ctools_custom_content_type_edit_form': + // Modify the submit handler to save TinyMCE display to hidden textarea + $form['buttons']['return']['#attributes'] = array('onclick' => 'tinyMCE.triggerSave(true,true);'); + break; + + } // /switch $form_id + } /**