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,16 +283,22 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -279,16 +283,22 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
if items==1: if items==1:
# leaves # leaves
doc=args['leaves']
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:
treeData['-tree-substate-']=sub treeData['-tree-substate-']=sub
treeData['tree-level']=level treeData['tree-level']=level
md._push(treeData) md._push(treeData)
output(md.getitem(args['leaves'],0)( output(doc(
self,md, self,md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16"></TD>' '<TR>%s<TD WIDTH="16"></TD>'
'<TD%s VALIGN="TOP">' '<TD%s VALIGN="TOP">'
% (h, % (h,
(dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), (dataspan > 1 and
(' COLSPAN="%s"' % dataspan) or ''))),
standard_html_footer='</TD></TR>', standard_html_footer='</TD></TR>',
)) ))
md._pop(1) md._pop(1)
...@@ -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