Page 1 of 1

Protecting (or hiding) text to prevent user editing?

PostPosted: Thu Feb 10, 2011 1:12 pm
by moonlightinred
Is it possible to exclude, protect, or hide text from WYMeditor so that a user cannot edit it? For example, when I'm pulling information for the user to edit using the editor, there may be some PHP scripts on the page that I don't want to the user to be able to change. I could wrap all PHP in its own div or something when it's pulled into the editor, but how would I get WYMeditor to "lock" that text (or hide from the user's view) so that they can't make any changes to it? Is this possible?

Re: Protecting (or hiding) text to prevent user editing?

PostPosted: Thu Feb 10, 2011 4:47 pm
by moonlightinred
Okay, so I now realize that WYMeditor won't show anything that's hidden using HTML comments. I'm able to use str_replace to encapsulate all PHP and JavaScript tags in HTML comments, but WYMeditor is stripping them out upon submit. Why is this? I know they're being correctly encapsulated and being passed into the WYMeditor window, but when I update it by clicking the submission button, ALL commented-out text (including the HTML commenting text itself) is completely removed. Any way to change that behavior?