Commit 6508f024 authored by Rafael Monnerat's avatar Rafael Monnerat

Integrate Bespin Editor as one Experimental option of EditorField.

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.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37827 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2b7b3b78
......@@ -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= {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment