[Zope-dev] Bug Report + Solution.

Yuan-Chen Cheng ycheng@oss.sinica.edu.tw
Sat, 24 Aug 2002 15:11:06 +0800


--pWyiEgJYm5f9v55/
Content-Type: text/plain; charset=big5
Content-Disposition: inline


Patch to

lib/python/TreeDisplay/TreeTag.py

Zope 2.5.1

So that when use virtual host monster, tree icon will appear.

thanks.

Yuan-Chen Cheng

--pWyiEgJYm5f9v55/
Content-Type: text/plain; charset=big5
Content-Disposition: attachment; filename="TreeTag.py.diff"

Index: TreeTag.py
===================================================================
RCS file: /home/service/cvsroot/zope/zope251/lib/python/TreeDisplay/TreeTag.py,v
retrieving revision 1.1.1.1
diff -u -3 -p -u -r1.1.1.1 TreeTag.py
--- TreeTag.py	22 Feb 2002 01:55:57 -0000	1.1.1.1
+++ TreeTag.py	24 Aug 2002 07:01:26 -0000
@@ -114,6 +114,8 @@ def tpRender(self, md, section, args,
     the state.
     """
 
+    basepath=md['BASEPATH1']
+
     data=[]
 
     idattr=args['id']
@@ -193,8 +195,8 @@ def tpRender(self, md, section, args,
     md._push(InstanceDict(self, md))
     md._push(treeData)
 
-    try: tpRenderTABLE(self,id,root,url,state,substate,diff,data,colspan,
-                       section,md,treeData, level, args)
+    try: tpRenderTABLE(self,id,root,url,state,substate,diff,data,
+                       colspan, section,md,basepath,treeData, level, args)
     finally: md._pop(2)
 
     if state is substate and not (args.has_key('single') and args['single']):
@@ -205,7 +207,7 @@ def tpRender(self, md, section, args,
     return join(data,'')
 
 def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
-                  colspan, section, md, treeData, level=0, args=None,
+                  colspan, section, md, basepath, treeData, level=0, args=None,
                   simple_type={type(''):0, type(1):0, type(1.0):0}.has_key,
                   ):
     "Render a tree as a table"
@@ -344,12 +346,12 @@ def tpRenderTABLE(self, id, root_url, ur
             if exp:
                 ptreeData['tree-item-expanded']=1
                 output('<A NAME="%s" HREF="%s?%stree-c=%s#%s">'
-                       '<IMG SRC="%s/p_/mi" ALT="-" BORDER=0></A>' %
-                       (id, root_url, param, s, id, script))
+                       '<IMG SRC="%s/%s/p_/mi" ALT="-" BORDER=0></A>' %
+                       (id, root_url, param, s, id, basepath, script))
             else:
                 output('<A NAME="%s" HREF="%s?%stree-e=%s#%s">'
-                       '<IMG SRC="%s/p_/pl" ALT="+" BORDER=0></A>' %
-                       (id, root_url, param, s, id, script))
+                       '<IMG SRC="%s/%s/p_/pl" ALT="+" BORDER=0></A>' %
+                       (id, root_url, param, s, id, basepath, script))
             output('</TD>\n')
 
         else:
@@ -448,7 +450,7 @@ def tpRenderTABLE(self, id, root_url, ur
                 md._push(InstanceDict(item,md))
                 try: data=tpRenderTABLE(
                     item,id,root_url,url,state,substate,diff,data,
-                    colspan, section, md, treeData, level, args)
+                    colspan, section, md, basepath, treeData, level, args)
                 finally: md._pop()
                 if not sub[1]: del sub[1]
 

--pWyiEgJYm5f9v55/--