Commit 7a4ebe6c authored by Jim Fulton's avatar Jim Fulton

Fixed bugs in fetching headers, footers, and leaves.

parent 6f3548e2
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
# rights reserved. # rights reserved.
# #
############################################################################ ############################################################################
__rcs_id__='$Id: TreeTag.py,v 1.20 1997/12/22 15:09:52 jim Exp $' __rcs_id__='$Id: TreeTag.py,v 1.21 1998/01/20 16:13:10 jim Exp $'
__version__='$Revision: 1.20 $'[11:-2] __version__='$Revision: 1.21 $'[11:-2]
from DocumentTemplate.DT_Util import * from DocumentTemplate.DT_Util import *
from DocumentTemplate.DT_String import String from DocumentTemplate.DT_String import String
...@@ -265,8 +265,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -265,8 +265,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
else: h='' else: h=''
if have_arg('header'): if have_arg('header'):
if md.has_key(args['header']): doc=args['header']
output(md.getitem(args['header'],0)( if hasattr(self, doc): doc=getattr(self, doc)
elif md.has_key(doc): doc=md.getitem(args['header'],0)
else: doc=None
if doc is not None:
output(doc(
self, md, self, md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16"></TD>' '<TR>%s<TD WIDTH="16"></TD>'
...@@ -279,19 +283,25 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -279,19 +283,25 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
if items==1: if items==1:
# leaves # leaves
treeData['-tree-substate-']=sub doc=args['leaves']
treeData['tree-level']=level if hasattr(self, doc): doc=getattr(self, doc)
md._push(treeData) elif md.has_key(doc): doc=md.getitem(args['header'],0)
output(md.getitem(args['leaves'],0)( else: doc=None
self,md, if doc is not None:
standard_html_header=( treeData['-tree-substate-']=sub
'<TR>%s<TD WIDTH="16"></TD>' treeData['tree-level']=level
'<TD%s VALIGN="TOP">' md._push(treeData)
% (h, output(doc(
(dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), self,md,
standard_html_footer='</TD></TR>', standard_html_header=(
)) '<TR>%s<TD WIDTH="16"></TD>'
md._pop(1) '<TD%s VALIGN="TOP">'
% (h,
(dataspan > 1 and
(' COLSPAN="%s"' % dataspan) or ''))),
standard_html_footer='</TD></TR>',
))
md._pop(1)
elif have_arg('expand'): elif have_arg('expand'):
treeData['-tree-substate-']=sub treeData['-tree-substate-']=sub
treeData['tree-level']=level treeData['tree-level']=level
...@@ -318,8 +328,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -318,8 +328,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
if not ids(substate[i][0]): del substate[i] if not ids(substate[i][0]): del substate[i]
if have_arg('footer'): if have_arg('footer'):
if md.has_key(args['footer']): doc=args['footer']
output(md.getitem(args['footer'],0)( if hasattr(self, doc): doc=getattr(self, doc)
elif md.has_key(doc): doc=md.getitem(args['header'],0)
else: doc=None
if doc is not None:
output(doc(
self, md, self, md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16"></TD>' '<TR>%s<TD WIDTH="16"></TD>'
......
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