Comment by Dave Cohen (not verified) on Sun, 2008/03/23 - 5:15pm.
Hey I've done something similar, and I notice your code removes the logic in the default theme_tinymce_theme(). You might be better off calling it instead of simply using $init untouched. Here's what I've used...
<?php /** * Override theme_tinymce_theme. This control which textareas have * the tinymce editor applied to them. See tinymce module README.TXT * for more information. */ function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) { // default theme_tinymce_theme enables tinymce by default, and // supresses on certain textareas. Our implementation disables by // default, and allows only on the following textareas. if (in_array($textarea_name, array('body', 'formnode-data-submit-body', 'mn-data-header', 'mn-data-footer', 'signature', 'site_mission', 'site_footer', 'site_offline_message', 'page_help', 'user_registration_help', 'user_picture_guidelines', ))) { // Prevent tinymce from mucking up our paths $init['convert_urls'] = 'false'; $returnMe = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running); return $returnMe; } else // disable tinymce return NULL; } ?>
I've used tinymce on only one project and don't plan to ever use it again. It has nasty habits like inserting silly <br type="_moz" /> tags.
Something similar
Hey I've done something similar, and I notice your code removes the logic in the default theme_tinymce_theme(). You might be better off calling it instead of simply using $init untouched. Here's what I've used...
<?php/**
* Override theme_tinymce_theme. This control which textareas have
* the tinymce editor applied to them. See tinymce module README.TXT
* for more information.
*/
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
// default theme_tinymce_theme enables tinymce by default, and
// supresses on certain textareas. Our implementation disables by
// default, and allows only on the following textareas.
if (in_array($textarea_name, array('body',
'formnode-data-submit-body',
'mn-data-header',
'mn-data-footer',
'signature',
'site_mission',
'site_footer',
'site_offline_message',
'page_help',
'user_registration_help',
'user_picture_guidelines',
))) {
// Prevent tinymce from mucking up our paths
$init['convert_urls'] = 'false';
$returnMe = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running);
return $returnMe;
}
else
// disable tinymce
return NULL;
}
?>
I've used tinymce on only one project and don't plan to ever use it again. It has nasty habits like inserting silly <br type="_moz" /> tags.