Page 1 of 1

To WYSIWYG-mantainers: Change in WYSIWYG-module-api

Posted: Wed Feb 01, 2006 8:22 pm
by Silmarillion
To all maintainers of wysiwyg-modules

After consulting wishy I implemented and extension to the parameterlist for the CreateTextArea function allowing a specific wysiwyg-system to be forced. I use it for the example textarea in the admin page of Xinha, which oddly showed FCK if that was the active one. But other uses are imaginable, like a syntaxhighlighting module for template/css editing without breaking the wysiwyg for contents etc.
Unfortunately I had to require a small change in your modules to support this, for eventhough I could force you WYSIWYGTextArea to be called and inserted with no changes I couldn't do so for the other WYSIWYG-Codegenerating functions. Therefore I built in a member-var of the base module-class called $wysiwygactive and a function WYSIWYGActive return the value of the var for use in admin/footer.php which then will know whether to call these other code-generation functions eventhough the wysiwyg is not the chosen one.
But this member var has to be set to true somewhere in you code, I recommend in WYSIWYGTextArea function as it is not called unless the wysiwyg actually should be used.

I hope this is ok, the changes are in svn. If you have another solution please say so, but I couldn't think of one...

Best regards
Morten/Silmarillion

Re: To WYSIWYG-mantainers: Change in WYSIWYG-module-api

Posted: Wed Feb 01, 2006 10:21 pm
by megabob3
I wanna understand if i have understood :P

....

Nothing i am going to look Xinha code :P

Re: To WYSIWYG-mantainers: Change in WYSIWYG-module-api

Posted: Thu Feb 02, 2006 10:44 pm
by thetallguy
Thanks for letting us know!  I don't exactly understand what it is I need to change in my editor's code.  Can you post some sample code showing what you expect?  Also, will my code still be backward-compatible to the production release of CMSMS, or will the change break the code on the current system. (This isn't a problem, but I need to warn users if that is the case.)

Michael

Re: To WYSIWYG-mantainers: Change in WYSIWYG-module-api

Posted: Fri Feb 03, 2006 9:38 am
by Silmarillion
Hi tallGuy

The only thing you have to do is insert a line in your WYSIWYGTextArea-method which says:
$this->wysiwygactive=true
That way the system will know that it is active and the the other potentially code-generation methods should be called eventhough the wysiwyg is not the user-chosen one.
As for backwardscompatibility I doubt inserting the line i a previous version will result in anything other than a notice about setting a non-existing var.

Best regards
Morten/Silmarillion