From 4c5e443a0f98fd9cbc52315590e7832c2890b0af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bartek=20G=C3=B3rny?= <bartek@gorny.edu.pl>
Date: Mon, 25 Sep 2006 15:58:12 +0000
Subject: [PATCH] spreadsheet links work in html preview

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10304 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../DMS_decorateHtmlRepresentation.xml        | 153 ++++++++++++++++++
 .../html_representation.xml                   |   6 +-
 2 files changed, 154 insertions(+), 5 deletions(-)
 create mode 100644 bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_decorateHtmlRepresentation.xml

diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_decorateHtmlRepresentation.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_decorateHtmlRepresentation.xml
new file mode 100644
index 0000000000..92a841fb0e
--- /dev/null
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_decorateHtmlRepresentation.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </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 encoding="cdata"><![CDATA[
+
+htmlrepr=\'<div style="background-color:white;color:black;">%s</div>\' % context.getHtmlRepresentation()\n
+context.log(context.REQUEST[\'URL\'])\n
+if context.portal_type==\'Spreadsheet\':\n
+  htmlrepr=htmlrepr.replace(\'<A HREF="#table\',\'<A HREF="%s#table\' % context.REQUEST[\'URL\'])\n
+return htmlrepr\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></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>_getattr_</string>
+                            <string>context</string>
+                            <string>htmlrepr</string>
+                            <string>_getitem_</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>DMS_decorateHtmlRepresentation</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_htmlRepresentation/html_representation.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_htmlRepresentation/html_representation.xml
index f259ba0338..dcf905730f 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_htmlRepresentation/html_representation.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_htmlRepresentation/html_representation.xml
@@ -299,11 +299,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
-
-python:\'<div style="background-color:white;color:black;">%s</div>\' % here.getHtmlRepresentation()
-
-]]></string> </value>
+            <value> <string>here/DMS_decorateHtmlRepresentation</string> </value>
         </item>
       </dictionary>
     </pickle>
-- 
2.30.9