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>
<tuple>
<none/> <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>
......
...@@ -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