Commit 164ac843 authored by Ivan Tyagov's avatar Ivan Tyagov

Use unified listbox to display PDF preview thumbnails.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38346 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2d5cffaf
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -53,8 +50,14 @@ ...@@ -53,8 +50,14 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>content_information = context.getContentInformation()\n <value> <string>"""\n
THis script returns a suitable slide list of PDF thumbnails\n
for current form selection.\n
It\'s to be used in a listbox.\n
"""\n
from Products.ERP5Type.Document import newTempBase\n
\n \n
content_information = context.getContentInformation()\n
page_number = int(content_information.get(\'Pages\', 0))\n page_number = int(content_information.get(\'Pages\', 0))\n
limit = kw.get(\'limit\', (0, 0))\n limit = kw.get(\'limit\', (0, 0))\n
list_start = int(kw.get(\'list_start\', 0))\n list_start = int(kw.get(\'list_start\', 0))\n
...@@ -66,7 +69,10 @@ page_list = range(page_number)\n ...@@ -66,7 +69,10 @@ page_list = range(page_number)\n
\n \n
result = []\n result = []\n
for i in page_list[list_start:list_end]:\n for i in page_list[list_start:list_end]:\n
result.append(context)\n x = {\'title\': \'%s\' %i, \n
\'frame\':\'%s\' %i} # frame is used by listbox render field\n
temp_object = newTempBase(context, x[\'title\'], **x)\n
result.append(temp_object)\n
return result\n return result\n
</string> </value> </string> </value>
</item> </item>
...@@ -105,6 +111,8 @@ return result\n ...@@ -105,6 +111,8 @@ return result\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>content_information</string> <string>content_information</string>
...@@ -121,6 +129,9 @@ return result\n ...@@ -121,6 +129,9 @@ return result\n
<string>result</string> <string>result</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>i</string> <string>i</string>
<string>x</string>
<string>_apply_</string>
<string>temp_object</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block\n
tal:define="cell python: request.get(\'cell\');\n
frame python: cell.frame;\n
display python: request.get(\'display\', \'thumbnail\');\n
format python: request.get(\'format\', \n
context.portal_preferences.getPreference(\'preferred_image_format\', \'png\'))">\n
<img title="Thumbnail"\n
i18n:attributes="title" i18n:domain="ui"\n
tal:attributes="src string:index_html?display=${display}&format=${format}&frame=${frame}"/>\n
</tal:block>\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PDF_renderHTMLThumbnailPreview</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -85,7 +82,9 @@ ...@@ -85,7 +82,9 @@
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value>
<list/> <list>
<string>listbox_thumbnail</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <global name="ListBox" module="Products.ERP5Form.ListBox"/>
<global name="ListBox" module="Products.ERP5Form.ListBox"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -343,6 +340,10 @@ ...@@ -343,6 +340,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>hidden_label</string> </value> <value> <string>hidden_label</string> </value>
</item> </item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>thumbnail</string> </value>
</item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <value>
...@@ -353,6 +354,17 @@ ...@@ -353,6 +354,17 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list>
<tuple>
<string>thumbnail</string>
<string>thumbnail</string>
</tuple>
</list>
</value>
</item>
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
...@@ -370,7 +382,12 @@ ...@@ -370,7 +382,12 @@
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>thumbnail</string>
<string>Thumbnail</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -387,10 +404,18 @@ ...@@ -387,10 +404,18 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <int>20</int> </value> <value> <int>20</int> </value>
...@@ -411,9 +436,13 @@ ...@@ -411,9 +436,13 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>page_navigation_mode</string> </key>
<value> <string>slider</string> </value>
</item>
<item> <item>
<key> <string>page_template</string> </key> <key> <string>page_template</string> </key>
<value> <string>ListBox_asPDFThumbnailListStyleHTML</string> </value> <value> <string>ListBox_asHTML</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
...@@ -431,6 +460,10 @@ ...@@ -431,6 +460,10 @@
<key> <string>report_tree</string> </key> <key> <string>report_tree</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>search</string> </key> <key> <string>search</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -471,16 +504,38 @@ ...@@ -471,16 +504,38 @@
<key> <string>stat_method</string> </key> <key> <string>stat_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list>
<tuple>
<string>thumbnail</string>
<string>thumbnail_Thumbnail</string>
</tuple>
</list>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Thumbnails</string> </value> <value> <string>Thumbnails</string> </value>
</item> </item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>untranslatable_columns</string> </key>
<value> <value>
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>thumbnail</string>
<string></string>
</tuple>
</list>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -489,10 +544,7 @@ ...@@ -489,10 +544,7 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -505,10 +557,7 @@ ...@@ -505,10 +557,7 @@
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <global name="Method" module="Products.Formulator.MethodField"/>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -521,10 +570,7 @@ ...@@ -521,10 +570,7 @@
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<tuple> <global name="Method" module="Products.Formulator.MethodField"/>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
......
1169 1171
\ 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