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>
......
......@@ -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