Commit c66a2fac authored by Ivan Tyagov's avatar Ivan Tyagov

Make it possible select number of listbox entries.

Use proper selection API.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39528 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1b5ca71e
......@@ -51,12 +51,11 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal_selection = getattr(context,\'portal_selections\')\n
selection = portal_selection.getSelectionFor(selection_name)\n
params = selection.getParams()\n
readItemList = params.get(\'rss_read_item_list\', [])\n
if item not in readItemList:\n
readItemList.append(item)\n
params[\'rss_read_item_list\'] = readItemList\n
params = portal_selection.getSelectionParamsFor(selection_name)\n
rss_read_item_list = params.get(\'rss_read_item_list\', [])\n
params[\'rss_read_item_list\'] = rss_read_item_list\n
if item not in rss_read_item_list:\n
rss_read_item_list.append(item)\n
portal_selection.setSelectionParamsFor(selection_name, params)\n
return item\n
</string> </value>
......@@ -101,9 +100,8 @@ return item\n
<string>context</string>
<string>portal_selection</string>
<string>_getattr_</string>
<string>selection</string>
<string>params</string>
<string>readItemList</string>
<string>rss_read_item_list</string>
<string>_write_</string>
</tuple>
</value>
......
......@@ -250,12 +250,14 @@
</item>
<item>
<key> <string>lines</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>list_action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -305,7 +307,7 @@
<item>
<key> <string>selection_name</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
......@@ -331,7 +333,7 @@
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
......@@ -459,7 +461,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
......@@ -577,7 +579,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: (request.get(\'rss_link\') or \'\').encode(\'utf-8\')</string> </value>
<value> <string>python: int(context.restrictedTraverse(context.REQUEST.get(\'box_relative_url\', \'\')).KnowledgeBox_getDefaultPreferencesDict().get(\'listbox_selection_list_lines\', None) or 5)</string> </value>
</item>
</dictionary>
</pickle>
......@@ -590,7 +592,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.Base_getListboxGadgetSelectionName(context.REQUEST.get(\'box_relative_url\', \'\'))</string> </value>
<value> <string>python: (request.get(\'rss_link\') or \'\').encode(\'utf-8\')</string> </value>
</item>
</dictionary>
</pickle>
......@@ -603,12 +605,25 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: request.get(\'rss_title\', \'Rss Title Error\').encode(\'utf-8\')</string> </value>
<value> <string>python: context.Base_getListboxGadgetSelectionName(context.REQUEST.get(\'box_relative_url\', \'\'))</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: request.get(\'rss_title\', \'Rss Title Error\').encode(\'utf-8\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
......
......@@ -46,12 +46,10 @@
md5 here/field_md5;\n
box_relative_url python: request.get(\'box_relative_url\', \'\');\n
dom_id python: (\'%s-%s\' %(box_relative_url.replace(\'/\',\'_\'), md5));\n
selection_name python: context.Base_getListboxGadgetSelectionName(context.REQUEST.get(\'box_relative_url\', \'\'));\n
selection python: context.portal_selections.getSelectionFor(selection_name);\n
selection_params python: selection.getParams();\n
selection_name python: context.Base_getListboxGadgetSelectionName(box_relative_url);\n
selection_params python: context.portal_selections.getSelectionParamsFor(selection_name);\n
read_item_list python:selection_params.get(\'rss_read_item_list\', []);\n
is_read python: md5 in read_item_list">\n
\n
is_read python: md5 in read_item_list;">\n
\n
<div class="document-gadget-quick-preview">\n
\n
......
581
\ No newline at end of file
582
\ 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