Commit 097ed941 authored by Fabien Morin's avatar Fabien Morin

Improve GadgetTool_viewPrettyGadgetDialog form :

* GadgetTool_viewPrettyGadgetDialog is used to add a gadget in the current Knowledge Pad.
It previously used an sub EditorField to display the gadget image. Instead of this, replace it by a ImageField, which will be use to standardize the rendering and size of all screenshots.
* Add a new columns which shows the gadget description.
* Replace the custom listmethod GadgetTool_getGadgetList by the standard portal_catalog call.
* Use the portal type parameter to filter only Gadget.
* Use the default parameters's parameter to pass the value of gadget_type_uid.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32218 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12e5781a
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" \n
Filter found gadgets in respect to the current mode.\n
"""\n
portal = context.getPortalObject()\n
mode = kw.get(\'mode\', None)\n
if mode is not None:\n
gadget_type_category = portal.restrictedTraverse(\'portal_categories/gadget_type/%s\' %mode,\n
None)\n
if gadget_type_category is not None:\n
kw[\'gadget_type_uid\'] = gadget_type_category.getUid()\n
return portal.portal_gadgets.searchFolder(**kw)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>None</string>
<string>mode</string>
<string>gadget_type_category</string>
<string>_write_</string>
<string>_apply_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>GadgetTool_getGadgetList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -93,7 +93,7 @@
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_description</string>
<string>listbox_thumbnail</string>
</list>
</value>
</item>
......
......@@ -16,12 +16,15 @@
<string>columns</string>
<string>count_method</string>
<string>css_class</string>
<string>default_params</string>
<string>editable_columns</string>
<string>hide_rows_on_no_search_criterion</string>
<string>list_method</string>
<string>portal_types</string>
<string>search_columns</string>
<string>selection_name</string>
<string>sort</string>
<string>sort_columns</string>
<string>title</string>
<string>url_columns</string>
</list>
......@@ -65,6 +68,28 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -73,10 +98,46 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -96,6 +157,10 @@
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>thumbnail</string>
<string>Thumbnail</string>
</tuple>
</list>
</value>
</item>
......@@ -107,13 +172,19 @@
<key> <string>css_class</string> </key>
<value> <string>full_width</string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value>
<list>
<tuple>
<string>description</string>
<string>Description</string>
<string>thumbnail</string>
<string>Thumbnail</string>
</tuple>
</list>
</value>
......@@ -133,7 +204,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -155,6 +226,10 @@
<string>translated_title</string>
<string>Title</string>
</tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
</list>
</value>
</item>
......@@ -162,6 +237,23 @@
<key> <string>selection_name</string> </key>
<value> <string>gadget_tool_view_pretty_gadget_dialog</string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
......@@ -192,6 +284,22 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:[[\'gadget_type_uid\', context.getPortalObject().restrictedTraverse(\'portal_categories/gadget_type/%s\' %request.get(\'mode\', None) , None) is not None and context.getPortalObject().restrictedTraverse(\'portal_categories/gadget_type/%s\' %request.get(\'mode\',None), None).getUid() or \'\'],]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
......@@ -202,7 +310,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>GadgetTool_getGadgetList</string> </value>
<value> <string>portal_catalog</string> </value>
</item>
</dictionary>
</pickle>
......
445
\ No newline at end of file
446
\ 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