Commit de083d33 authored by Jérome Perrin's avatar Jérome Perrin

Remove dead code and update comments (TextArea are no longer rendered as a

<textarea readonly>, use "pre" css class or add "readonly" in extra ).



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12638 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c50d5b6
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
from Products.Formulator.Field import Field from Products.Formulator.Field import Field
from Products.Formulator.Widget import Widget from Products.Formulator.Widget import Widget
from Products.Formulator.Widget import render_element
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from cgi import escape from cgi import escape
import types import types
...@@ -282,29 +283,6 @@ def CheckBoxWidget_render(self, field, key, value, REQUEST): ...@@ -282,29 +283,6 @@ def CheckBoxWidget_render(self, field, key, value, REQUEST):
CheckBoxWidget.render = CheckBoxWidget_render CheckBoxWidget.render = CheckBoxWidget_render
# Patch the render_view of a TextAreaWidget so that
# it is rendered as a nice box, it is using the tag
# readonly understood by most browsers for a text area
from Products.Formulator.Widget import TextAreaWidget
from Products.Formulator.Widget import render_element
from DocumentTemplate.DT_Util import html_quote
def TextAreaWidget_render_view(self, field, value): # Probably useless
width = field.get_value('width')
height = field.get_value('height')
return render_element("textarea",
name='',
css_class=field.get_value('css_class'),
cols=width,
rows=height,
contents=html_quote(value),
extra='readonly')
# TextAreaWidget.render_view = TextAreaWidget_render_view
# See bellow TextWidget_patched_render_view
# Patch the render_view of LinkField so that it is clickable in read-only mode. # Patch the render_view of LinkField so that it is clickable in read-only mode.
from Products.Formulator.Widget import TextWidget from Products.Formulator.Widget import TextWidget
from Products.Formulator.StandardFields import LinkField from Products.Formulator.StandardFields import LinkField
...@@ -355,7 +333,9 @@ def TextWidget_patched_render_view(self, field, value): ...@@ -355,7 +333,9 @@ def TextWidget_patched_render_view(self, field, value):
from Products.Formulator.Widget import TextWidget from Products.Formulator.Widget import TextWidget
TextWidget.render_view = TextWidget_patched_render_view TextWidget.render_view = TextWidget_patched_render_view
TextAreaWidget.render_view = TextWidget_patched_render_view # Use a standard span rendering from Products.Formulator.Widget import TextAreaWidget
# Use a standard span rendering
TextAreaWidget.render_view = TextWidget_patched_render_view
class IntegerWidget(TextWidget) : class IntegerWidget(TextWidget) :
def render(self, field, key, value, REQUEST) : def render(self, field, key, value, REQUEST) :
...@@ -976,8 +956,6 @@ class PatchedDateTimeValidator(DateTimeValidator): ...@@ -976,8 +956,6 @@ class PatchedDateTimeValidator(DateTimeValidator):
DateTimeField.validator = PatchedDateTimeValidator() DateTimeField.validator = PatchedDateTimeValidator()
from Products.Formulator.Widget import TextWidgetInstance
class FloatWidget(TextWidget): class FloatWidget(TextWidget):
property_names = TextWidget.property_names +\ property_names = TextWidget.property_names +\
......
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