Because I wanted to limit the number of options in TinyMCE and wanted to be sure all classes, styles etc are cleared on paste, I inserted the following in my function getCMSFields()
HtmlEditorConfig::get('cms')->setOptions(array('theme_advanced_disable' => 'underline, justifyleft, justifyright, justifycenter, justifyfull, indent, outdent, formatselect, styleselect, hr, pasteword, ssflash',
'invalid_elements' => '@[style | align | class]',
'valid_elements'=>'a, strong/ b, em/ i, p, br, ul, li, ol, table, td, tr, tf, th, tbody, thead, tfoot, s, img',
'entity_encoding', 'raw'));
After I give a ?flush=1 at first all the buttons I do not want have disappeared, and I can paste every style I want into it but instead of colored text, I get black text etc.
But: after for instance creating a list and then saving and then going to another page the first thing I notice is that all the buttons have returned. This might or might not happen, it depends, but do not know on what - sometimes you have to go back and forth several times. But if the buttons have returned and I go back to the page I edited, all my formatting is removed from the content field and the lists and tables have become one big paragraph (images remain).
Something else that happens most of the time in my browsers is this: If I login, the buttons I removed using my code are there, but if I give a ?flush=1 they go away and the script seems to function the way it should - until the formatting is removed.
I am testing this without the option to remove the buttons and so far it seems ok. Next I will test adding buttons to the simple theme.
I have tested this in Opera 9, Safari 4 and firefox 3.5.
I have attached the errorcodes Opera has given me (errors in LeftAndMain_right.js). If nobody finds any mistakes in my code, should I create a ticket out of it?
EDIT: errorcodes in opera seem to be unrelated to the HtmlEditorConfig, I have tried and failed to remove the text with the errorcodes