Commit 242767ba authored by Nicolas Delaby's avatar Nicolas Delaby

Add new my_content_type radio field in Base_viewFieldLibrary

Add comment to deprecate my_text_format
replace text_format by content_type in Base_getEditorFieldPreferredTextEditor

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35345 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9ad9a65c
...@@ -55,19 +55,20 @@ ...@@ -55,19 +55,20 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
Returns the preferred text editor and tries to take into \n Returns the preferred text editor and tries to take into \n
account a default text format if any.\n account a default content type if any.\n
"""\n """\n
# By default, everthing related to EditorField is HTML\n # By default, everthing related to EditorField is HTML\n
text_format = \'text/html\'\n content_type = \'text/html\'\n
\n \n
# If this document provide a text format property, \n # If this document provide a text format property, \n
# get the text format from the property\n # get the content type from the property\n
if getattr(context, \'getTextFormat\', None) is not None:\n if getattr(context, \'getContentType\', None) is not None:\n
text_format = context.getTextFormat()\n content_type = context.getContentType()\n
if not text_format: text_format = \'text/html\'\n if not content_type:\n
content_type = \'text/html\'\n
\n \n
# If this is not HTML, fallback to TextArea\n # If this is not HTML, fallback to TextArea\n
if text_format != \'text/html\':\n if content_type != \'text/html\':\n
return \'text_area\'\n return \'text_area\'\n
\n \n
# Else return preferred value or TextArea if nothing defined\n # Else return preferred value or TextArea if nothing defined\n
...@@ -108,7 +109,7 @@ return context.portal_preferences.getPreferredTextEditor() or \'text_area\'\n ...@@ -108,7 +109,7 @@ return context.portal_preferences.getPreferredTextEditor() or \'text_area\'\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>text_format</string> <string>content_type</string>
<string>getattr</string> <string>getattr</string>
<string>context</string> <string>context</string>
<string>None</string> <string>None</string>
......
...@@ -180,6 +180,7 @@ ...@@ -180,6 +180,7 @@
<string>my_report_box</string> <string>my_report_box</string>
<string>your_captcha</string> <string>your_captcha</string>
<string>my_view_mode_module_listbox</string> <string>my_view_mode_module_listbox</string>
<string>my_content_type</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -194,7 +194,8 @@ ...@@ -194,7 +194,8 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The text format used by default</string> </value> <value> <string>The text format used by default\n
(Deprecated use content_type instead)</string> </value>
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
......
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