diff --git a/product/ERP5Form/EditorField.py b/product/ERP5Form/EditorField.py index 29dc32a4e103e29d0dc31945f6ed7b7bf49d2884..43057b2da4691b174d9b2884779849bad1ab5d72 100644 --- a/product/ERP5Form/EditorField.py +++ b/product/ERP5Form/EditorField.py @@ -69,7 +69,8 @@ class EditorWidget(Widget.TextAreaWidget): required=1, size=1, items=[('Standard Text Area', 'text_area'), - ('FCK Editor', 'fck_editor')]) + ('FCK Editor', 'fck_editor'), + ('Bespin Editor', 'bespin')]) def render(self, field, key, value, REQUEST, render_prefix=None): """ @@ -79,6 +80,19 @@ class EditorWidget(Widget.TextAreaWidget): text_editor = field.get_value('text_editor') if text_editor == 'text_area': return Widget.TextAreaWidget.render(self, field, key, value, REQUEST) + elif text_editor == 'bespin': + # XXX The usage of bespin editor depends of erp5_bespin bt5 + # installed and still experimental. If erp5_bespin is not installed, it + # render standard an standard editor field. + bespin_support = getattr(here, 'bespin_support',None) + if bespin_support is None: + return Widget.TextAreaWidget.render(self, field, key, value, REQUEST) + return bespin_support.pt_render( + extra_context= { + 'field' : field, + 'inputvalue' : value, + 'inputname' : key + }) else: return here.fckeditor_wysiwyg_support.pt_render( extra_context= {