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 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -53,8 +50,14 @@
</item>
<item>
<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
content_information = context.getContentInformation()\n
page_number = int(content_information.get(\'Pages\', 0))\n
limit = kw.get(\'limit\', (0, 0))\n
list_start = int(kw.get(\'list_start\', 0))\n
......@@ -66,7 +69,10 @@ page_list = range(page_number)\n
\n
result = []\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
</string> </value>
</item>
......@@ -105,6 +111,8 @@ return result\n
<value>
<tuple>
<string>kw</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>_getattr_</string>
<string>context</string>
<string>content_information</string>
......@@ -121,6 +129,9 @@ return result\n
<string>result</string>
<string>_getiter_</string>
<string>i</string>
<string>x</string>
<string>_apply_</string>
<string>temp_object</string>
</tuple>
</value>
</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 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -85,7 +82,9 @@
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
<list>
<string>listbox_thumbnail</string>
</list>
</value>
</item>
<item>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ListBox" module="Products.ERP5Form.ListBox"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -343,6 +340,10 @@
<key> <string>css_class</string> </key>
<value> <string>hidden_label</string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>thumbnail</string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
......@@ -353,6 +354,17 @@
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list>
<tuple>
<string>thumbnail</string>
<string>thumbnail</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
......@@ -370,7 +382,12 @@
<item>
<key> <string>editable_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>thumbnail</string>
<string>Thumbnail</string>
</tuple>
</list>
</value>
</item>
<item>
......@@ -387,10 +404,18 @@
<list/>
</value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>lines</string> </key>
<value> <int>20</int> </value>
......@@ -411,9 +436,13 @@
<list/>
</value>
</item>
<item>
<key> <string>page_navigation_mode</string> </key>
<value> <string>slider</string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string>ListBox_asPDFThumbnailListStyleHTML</string> </value>
<value> <string>ListBox_asHTML</string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
......@@ -431,6 +460,10 @@
<key> <string>report_tree</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search</string> </key>
<value> <int>0</int> </value>
......@@ -471,16 +504,38 @@
<key> <string>stat_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list>
<tuple>
<string>thumbnail</string>
<string>thumbnail_Thumbnail</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Thumbnails</string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>thumbnail</string>
<string></string>
</tuple>
</list>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -489,10 +544,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -505,10 +557,7 @@
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -521,10 +570,7 @@
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......
1169
\ No newline at end of file
1171
\ 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