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 @@ ...@@ -60,15 +60,15 @@
Field expects to be provided valid HTML. It is therefore the responsibility\n Field expects to be provided valid HTML. It is therefore the responsibility\n
of the Default value script to provide this valid HTML.\n of the Default value script to provide this valid HTML.\n
"""\n """\n
# If content is editable, nothing to do\n # Define default editable value\n
if context.Event_isTextContentEditable():\n if editable is None:\n
return context.getTextContent()\n editable = context.Event_isTextContentEditable()\n
\n \n
# If content is HTML, nothing to do\n # If content is editable, nothing to do\n
if context.getTextFormat() == \'text/html\':\n if editable:\n
return context.getTextContent()\n return context.getTextContent()\n
\n \n
# If not, convert it\n # If not, convert it to stripped HTML (read-only)\n
return context.asStrippedHTML()\n return context.asStrippedHTML()\n
</string> </value> </string> </value>
</item> </item>
...@@ -80,7 +80,7 @@ return context.asStrippedHTML()\n ...@@ -80,7 +80,7 @@ return context.asStrippedHTML()\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>editable=None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -100,12 +100,14 @@ return context.asStrippedHTML()\n ...@@ -100,12 +100,14 @@ return context.asStrippedHTML()\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>editable</string>
<string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
</tuple> </tuple>
...@@ -119,7 +121,9 @@ return context.asStrippedHTML()\n ...@@ -119,7 +121,9 @@ return context.asStrippedHTML()\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<none/>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -128,6 +128,10 @@ else:\n ...@@ -128,6 +128,10 @@ else:\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Event_getTextContentCorrespondToFormat</string> </value> <value> <string>Event_getTextContentCorrespondToFormat</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>SUPERCEDED by Event_getEditorFieldTextContent</string> </value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
...@@ -3,12 +3,25 @@ ...@@ -3,12 +3,25 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<global name="EditorField" module="Products.ERP5Form.EditorField"/> <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/> <tuple/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <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> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>text_content</string> </value> <value> <string>text_content</string> </value>
...@@ -21,22 +34,6 @@ ...@@ -21,22 +34,6 @@
<key> <string>external_validator_failed</string> </key> <key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value> <value> <string>The input failed the external validator.</string> </value>
</item> </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> </dictionary>
</value> </value>
</item> </item>
...@@ -45,75 +42,15 @@ ...@@ -45,75 +42,15 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>alternate_name</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>target</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>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -123,88 +60,38 @@ ...@@ -123,88 +60,38 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <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> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>height</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </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> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </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> <item>
<key> <string>width</string> </key> <key> <string>width</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -216,10 +103,6 @@ ...@@ -216,10 +103,6 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>page</string> </value> <value> <string>page</string> </value>
...@@ -228,10 +111,6 @@ ...@@ -228,10 +111,6 @@
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -241,49 +120,21 @@ ...@@ -241,49 +120,21 @@
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string>my_text_content</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>
</item> </item>
<item> <item>
<key> <string>max_linelength</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string>Event_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>max_lines</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Page Content</string> </value> <value> <string>Page Content</string> </value>
</item> </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> <item>
<key> <string>width</string> </key> <key> <string>width</string> </key>
<value> <int>80</int> </value> <value> <int>80</int> </value>
...@@ -305,44 +156,12 @@ ...@@ -305,44 +156,12 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <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> <pickle>
<tuple> <tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
...@@ -358,20 +177,4 @@ ...@@ -358,20 +177,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
<string>center</string> <string>center</string>
<string>bottom</string> <string>bottom</string>
<string>hidden</string> <string>hidden</string>
<string>not_assigned</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -103,6 +104,14 @@ ...@@ -103,6 +104,14 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>not_assigned</string> </key>
<value>
<list>
<string>your_reportbox</string>
</list>
</value>
</item>
<item> <item>
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
......
434 435
\ No newline at end of file \ 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