--- tinymce.module 31 Mar 2008 16:22:21 -0000 1.92.2.3 +++ tinymce.module 1 May 2008 23:31:52 -0000 @@ -161,8 +161,8 @@ link = document.getElementById(linkid); img_assist = document.getElementById('img_assist-link-'+ id); - if (tinyMCE.getEditorId(element.id) == null) { - tinyMCE.addMCEControl(element, element.id); + if (tinyMCE.get(element.id) == null) { + tinyMCE.execCommand('mceAddControl',false,element.id); element.togg = 'on'; link.innerHTML = '$disable'; link.href = "javascript:mceToggle('" +id+ "', '" +linkid+ "');"; @@ -171,7 +171,7 @@ link.blur(); } else { - tinyMCE.removeMCEControl(tinyMCE.getEditorId(element.id)); + tinyMCE.execCommand('mceRemoveControl',false,element.id); element.togg = 'off'; link.innerHTML = '$enable'; link.href = "javascript:mceToggle('" +id+ "', '" +linkid+ "');"; @@ -195,10 +195,10 @@ if (img_assist) { var img_assist_default_link = img_assist.innerHTML; if ('$img_assist_link' == 'yes') { - img_assist.innerHTML = tinyMCE.getEditorId('edit-$textarea_name') == null ? '' : img_assist_default_link; + img_assist.innerHTML = tinyMCE.get('edit-$textarea_name') == null ? '' : img_assist_default_link; } else { - img_assist.innerHTML = tinyMCE.getEditorId('edit-$textarea_name') == null ? img_assist_default_link : ''; + img_assist.innerHTML = tinyMCE.get('edit-$textarea_name') == null ? img_assist_default_link : ''; } } if (typeof(document.execCommand) == 'undefined') { @@ -245,6 +245,12 @@ // Load a TinyMCE init for each textarea. if ($init) drupal_add_js($tinymce_invoke, 'inline'); + //settings are saved as strings, not booleans + if ($profile->settings['show_toggle'] == 'true') { + // Make sure to append to #suffix so it isn't completely overwritten + $element['#suffix'] .= $wysiwyg_link; + } + // Set resizable to false to avoid drupal.js resizable function from taking control of the textarea $element['#resizable'] = FALSE; } @@ -492,7 +498,6 @@ // Is tinymce on by default? $status = tinymce_user_get_status($user, $profile); - $status = 'true'; $init['mode'] = $status == 'true' ? 'exact' : 'none'; // $init['mode'] = "textareas";