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,22 +58,29 @@ class EditorWidget(Widget.TextAreaWidget):
"""
property_names = Widget.TextAreaWidget.property_names + [
'text_editor'
]
# default = fields.StringField(
# 'default',
# title='Default',
# description=(
# "A default value (whatever it means)."),
# default="",
# required=0)
text_editor = fields.ListField('text_editor',
title='Text Editor',
description=(
"The text editor widget to use."
""),
default="text_area",
required=1,
size=1,
items=[('Standard Text Area', 'text_area'),
('FCK Editor', 'fck_editor')])
def render(self, field, key, value, REQUEST):
"""
Render editor
"""
here = REQUEST['here']
text_editor = field.get_value('text_editor')
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,
......
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