Hello,
at the moment it is possible to integrate tinymce or the fck editor as
rich text editors for textareas.

Now, i have written a sfBBCode plugin on my own (i now that there is a
official sfBBCodeParser plugin too) and on every symfony core update i
have to manipulate the textarea_tag function in the FormHelper.php file so
that i can use my bbcode editor for the admin generator.

So my question is, if it is possible to add some new lines to this method,
so that one could use an own editor which implements a rich text interface
of symfony ???

I thought about that in the FormHelper:

==========
        if($rich=='sfeditor'){
                $editorClass=sfConfig::get('sf_rich_text_editor_class_name');
                if(!$editorClass){
                        throw new sfConfigurationException('You have to config 
your rich text
editor class name.');
                }
                $sfEditor=new $editorClass();
                if(!$sfEditor implements sfRichTextEditorInterface){
                        throw new sfConfigurationException('The configured 
editor does not
implement sfRichTextEditorInterface.');
                }
                $sfEditor->init($name,$content,$options);
                return $sfEditor->toHTML();
        }
=====
and then it goes on with:

        elseif ($rich == 'tinymce')
        { ........



The according interface which has to be provided by symfony could look
like this:

===========================
<?php
interface sfRichTextEditorInterface{

        /**
         * @param string $name
         * @param string $content
         * @param string $options
         */
        public function init($name,$content,$options);

        /**
         * @return string
         */
        public function toHTML();
}
=============================


So now it would be possible that one could write a rich text editor and
symfony could integrate this editor without changing the core code! No
matter what this editor actually does!
The only thing a developer has to do is to configure the class name of the
editor, configure that the sfeditor should be the standard rich text
editor and to implement sfRichTextEditorInterface.

I would be very happy, if this could be integrated in the core!

- Frank



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to