Commit f4f1fffe authored by Jean-Paul Smets's avatar Jean-Paul Smets

Proxify text_content fields. Deprecate Event_getTextContentCorrespondToFormat...

Proxify text_content fields. Deprecate Event_getTextContentCorrespondToFormat (wrong naming, wrong implemetation) and replace it with Event_getEditorFieldTextContent

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28941 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d4f55a47
......@@ -60,15 +60,15 @@
Field expects to be provided valid HTML. It is therefore the responsibility\n
of the Default value script to provide this valid HTML.\n
"""\n
# If content is editable, nothing to do\n
if context.Event_isTextContentEditable():\n
return context.getTextContent()\n
# Define default editable value\n
if editable is None:\n
editable = context.Event_isTextContentEditable()\n
\n
# If content is HTML, nothing to do\n
if context.getTextFormat() == \'text/html\':\n
# If content is editable, nothing to do\n
if editable:\n
return context.getTextContent()\n
\n
# If not, convert it\n
# If not, convert it to stripped HTML (read-only)\n
return context.asStrippedHTML()\n
</string> </value>
</item>
......@@ -80,7 +80,7 @@ return context.asStrippedHTML()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>editable=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -100,12 +100,14 @@ return context.asStrippedHTML()\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>editable</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
......@@ -119,7 +121,9 @@ return context.asStrippedHTML()\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
......
......@@ -128,6 +128,10 @@ else:\n
<key> <string>id</string> </key>
<value> <string>Event_getTextContentCorrespondToFormat</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>SUPERCEDED by Event_getEditorFieldTextContent</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
......@@ -3,12 +3,25 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="EditorField" module="Products.ERP5Form.EditorField"/>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>css_class</string>
<string>default</string>
<string>editable</string>
<string>enabled</string>
<string>title</string>
<string>width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>text_content</string> </value>
......@@ -21,22 +34,6 @@
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>line_too_long</string> </key>
<value> <string>A line was too long.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>You entered too many characters.</string> </value>
</item>
<item>
<key> <string>too_many_lines</string> </key>
<value> <string>You entered too many lines.</string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -45,75 +42,15 @@
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
......@@ -123,88 +60,38 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>text_editor</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
......@@ -216,10 +103,6 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string>page</string> </value>
......@@ -228,10 +111,6 @@
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
......@@ -241,49 +120,21 @@
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>18</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
<key> <string>field_id</string> </key>
<value> <string>my_text_content</string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
<key> <string>form_id</string> </key>
<value> <string>Event_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Page Content</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>80</int> </value>
......@@ -305,44 +156,12 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:(getattr(here, \'hasFile\', None) is not None and here.hasFile() and \'page\') or \'\'</string> </value>
<value> <string>python:here.Event_getEditorFieldTextContent(editable=False)</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Event_getTextContentCorrespondToFormat(editable=False)</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:getattr(here, \'hasFile\', None) is not None and not here.hasFile()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
......@@ -358,20 +177,4 @@
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:(here.getTextFormat() == \'text/html\' and here.portal_preferences.getPreferredTextEditor()) or \'text_area\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -61,6 +61,7 @@
<string>center</string>
<string>bottom</string>
<string>hidden</string>
<string>not_assigned</string>
</list>
</value>
</item>
......@@ -103,6 +104,14 @@
</list>
</value>
</item>
<item>
<key> <string>not_assigned</string> </key>
<value>
<list>
<string>your_reportbox</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
......
434
\ No newline at end of file
435
\ No newline at end of file
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