Commit 11ca5c02 authored by Gabriel Monnerat's avatar Gabriel Monnerat

add support to svg editor and spreadsheet editor in EditorField

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40214 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c6ceec3a
......@@ -71,7 +71,9 @@ class EditorWidget(Widget.TextAreaWidget):
items=[('Standard Text Area', 'text_area'),
('FCK Editor', 'fck_editor'),
('Bespin Editor', 'bespin'),
('Xinha Editor', 'xinha')])
('Xinha Editor', 'xinha'),
('SVG Editor', 'svg_editor'),
('Spreadsheet Editor', 'spreadsheet_editor')])
def render(self, field, key, value, REQUEST, render_prefix=None):
"""
......@@ -104,6 +106,16 @@ class EditorWidget(Widget.TextAreaWidget):
'field_value' : value,
'field_name' : key
})
elif text_editor == "svg_editor":
svg_editor_support = getattr(here, 'svg_editor_support', None)
if svg_editor_support is None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
return svg_editor_support.pt_render()
elif text_editor == "spreadsheet_editor":
sheet_editor_support = getattr(here, 'sheet_editor_support', None)
if sheet_editor_support is None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
return sheet_editor_support.pt_render()
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