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 @@ ...@@ -51,12 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal_selection = getattr(context,\'portal_selections\')\n <value> <string>portal_selection = getattr(context,\'portal_selections\')\n
selection = portal_selection.getSelectionFor(selection_name)\n params = portal_selection.getSelectionParamsFor(selection_name)\n
params = selection.getParams()\n rss_read_item_list = params.get(\'rss_read_item_list\', [])\n
readItemList = params.get(\'rss_read_item_list\', [])\n params[\'rss_read_item_list\'] = rss_read_item_list\n
if item not in readItemList:\n if item not in rss_read_item_list:\n
readItemList.append(item)\n rss_read_item_list.append(item)\n
params[\'rss_read_item_list\'] = readItemList\n
portal_selection.setSelectionParamsFor(selection_name, params)\n portal_selection.setSelectionParamsFor(selection_name, params)\n
return item\n return item\n
</string> </value> </string> </value>
...@@ -101,9 +100,8 @@ return item\n ...@@ -101,9 +100,8 @@ return item\n
<string>context</string> <string>context</string>
<string>portal_selection</string> <string>portal_selection</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>selection</string>
<string>params</string> <string>params</string>
<string>readItemList</string> <string>rss_read_item_list</string>
<string>_write_</string> <string>_write_</string>
</tuple> </tuple>
</value> </value>
......
...@@ -250,12 +250,14 @@ ...@@ -250,12 +250,14 @@
</item> </item>
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>list_action</string> </key> <key> <string>list_action</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -305,7 +307,7 @@ ...@@ -305,7 +307,7 @@
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -331,7 +333,7 @@ ...@@ -331,7 +333,7 @@
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -459,7 +461,7 @@ ...@@ -459,7 +461,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -577,7 +579,7 @@ ...@@ -577,7 +579,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -590,7 +592,7 @@ ...@@ -590,7 +592,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -603,12 +605,25 @@ ...@@ -603,12 +605,25 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="5" aka="AAAAAAAAAAU="> <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> <pickle>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
</pickle> </pickle>
......
...@@ -46,12 +46,10 @@ ...@@ -46,12 +46,10 @@
md5 here/field_md5;\n md5 here/field_md5;\n
box_relative_url python: request.get(\'box_relative_url\', \'\');\n box_relative_url python: request.get(\'box_relative_url\', \'\');\n
dom_id python: (\'%s-%s\' %(box_relative_url.replace(\'/\',\'_\'), md5));\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_name python: context.Base_getListboxGadgetSelectionName(box_relative_url);\n
selection python: context.portal_selections.getSelectionFor(selection_name);\n selection_params python: context.portal_selections.getSelectionParamsFor(selection_name);\n
selection_params python: selection.getParams();\n
read_item_list python:selection_params.get(\'rss_read_item_list\', []);\n read_item_list python:selection_params.get(\'rss_read_item_list\', []);\n
is_read python: md5 in read_item_list">\n is_read python: md5 in read_item_list;">\n
\n
\n \n
<div class="document-gadget-quick-preview">\n <div class="document-gadget-quick-preview">\n
\n \n
......
581 582
\ 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