Commit 3aaea256 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Support for user configurable text editor.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15818 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa21ea71
...@@ -58,24 +58,31 @@ class EditorWidget(Widget.TextAreaWidget): ...@@ -58,24 +58,31 @@ class EditorWidget(Widget.TextAreaWidget):
""" """
property_names = Widget.TextAreaWidget.property_names + [ property_names = Widget.TextAreaWidget.property_names + [
'text_editor'
] ]
# default = fields.StringField( text_editor = fields.ListField('text_editor',
# 'default', title='Text Editor',
# title='Default', description=(
# description=( "The text editor widget to use."
# "A default value (whatever it means)."), ""),
# default="", default="text_area",
# required=0) required=1,
size=1,
items=[('Standard Text Area', 'text_area'),
('FCK Editor', 'fck_editor')])
def render(self, field, key, value, REQUEST): def render(self, field, key, value, REQUEST):
""" """
Render editor Render editor
""" """
here = REQUEST['here'] here = REQUEST['here']
return here.fckeditor_wysiwyg_support.pt_render( text_editor = field.get_value('text_editor')
extra_context= { if text_editor == 'text_area':
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
else:
return here.fckeditor_wysiwyg_support.pt_render(
extra_context= {
'inputvalue' : value, 'inputvalue' : value,
'inputname' : key 'inputname' : key
}) })
......
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