If you want to be able to edit plain text files, I think you're better off outputting those to a plain textarea field. Web-based WYSIWYG tend to feature loads of auto-correcting and that sort of thing. They have those features to make them not only output in whichever markup standard the WYSIWYG supports (for instance, XHTML, as FCKEditor does), but also to get around some browser bugs. Explorer, for instance, takes all of the markup and forces it into uppercase HTML and removes all line breaks. This is a limitiation of Explorer, and a bug in the innerHTML property, some WYSIWYG's try to correct that. The WYSIWYG's also force quoting of attributes, and tend to rearrange those attributes, a feature that I find annoying, but if you have to use a WYSIWYG, you're pretty much stuck with those idiosyncrasies. So without building your own web-based IDE for plaintext languages, you're pretty much stuck with the auto-correction features of the WYSIWYG. Of course you can also dive into the bowels of the WYSIWYG and write something that forces it to ignore script, because I doubt the developers have much priority for those features, since the people using WYSIWYG tend to have little technical knowledge and no need for the ability to do that.
On the server-side you can also just detect the MIME type of the language you want to output and switch between a simple textarea and WYSIWYG accordingly.
My CMS features separate fields for JavaScript and CSS. I'm using HTMLArea, haven't tried to insert PHP yet, but I'll give it a go and let you know how it goes.
Regards,
Rich
--
[
http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design