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

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
Silmarillion
Dev Team Member
Dev Team Member
Posts: 483
Joined: Sun Jan 02, 2005 9:10 pm
Location: Denmark

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

Post 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
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

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

Post by megabob3 »

I wanna understand if i have understood :P

....

Nothing i am going to look Xinha code :P
thetallguy

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

Post 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
User avatar
Silmarillion
Dev Team Member
Dev Team Member
Posts: 483
Joined: Sun Jan 02, 2005 9:10 pm
Location: Denmark

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

Post 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
Post Reply

Return to “Developers Discussion”