Commit 864dbb9f authored by Andreas Jung's avatar Andreas Jung

Collector 396/397: applied patches for better XHTML compatiblity

parent 0a0f97a7
...@@ -145,8 +145,8 @@ Evaluating expressions without rendering results ...@@ -145,8 +145,8 @@ Evaluating expressions without rendering results
''' # ' ''' # '
__rcs_id__='$Id: DT_Var.py,v 1.52 2002/03/27 10:14:02 htrd Exp $' __rcs_id__='$Id: DT_Var.py,v 1.53 2002/05/21 14:41:41 andreasjung Exp $'
__version__='$Revision: 1.52 $'[11:-2] __version__='$Revision: 1.53 $'[11:-2]
from DT_Util import parse_params, name_param, str, ustr from DT_Util import parse_params, name_param, str, ustr
import os, string, re, sys import os, string, re, sys
...@@ -300,7 +300,7 @@ def url_quote_plus(v, name='(Unknown name)', md={}): ...@@ -300,7 +300,7 @@ def url_quote_plus(v, name='(Unknown name)', md={}):
def newline_to_br(v, name='(Unknown name)', md={}): def newline_to_br(v, name='(Unknown name)', md={}):
v=str(v) v=str(v)
if v.find('\r') >= 0: v=''.join(v.split('\r')) if v.find('\r') >= 0: v=''.join(v.split('\r'))
if v.find('\n') >= 0: v='<br>\n'.join(v.split('\n')) if v.find('\n') >= 0: v='<br />\n'.join(v.split('\n'))
return v return v
def whole_dollars(v, name='(Unknown name)', md={}): def whole_dollars(v, name='(Unknown name)', md={}):
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
############################################################################## ##############################################################################
"""Rendering object hierarchies as Trees """Rendering object hierarchies as Trees
""" """
__rcs_id__='$Id: TreeTag.py,v 1.51 2002/02/07 18:13:17 andreasjung Exp $' __rcs_id__='$Id: TreeTag.py,v 1.52 2002/05/21 14:41:41 andreasjung Exp $'
__version__='$Revision: 1.51 $'[11:-2] __version__='$Revision: 1.52 $'[11:-2]
from DocumentTemplate.DT_Util import * from DocumentTemplate.DT_Util import *
from DocumentTemplate.DT_String import String from DocumentTemplate.DT_String import String
...@@ -295,17 +295,17 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -295,17 +295,17 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
diff.append(id) diff.append(id)
_td_colspan='<TD COLSPAN="%s" NOWRAP></TD>' _td_colspan='<td colspan="%s" style="white-space: nowrap"></td>'
_td_single ='<TD WIDTH="16" NOWRAP></TD>' _td_single ='<td width="16" style="white-space: nowrap"></td>'
sub=None sub=None
if substate is state: if substate is state:
output('<TABLE CELLSPACING="0">\n') output('<table cellspacing="0">\n')
sub=substate[0] sub=substate[0]
exp=items exp=items
else: else:
# Add prefix # Add prefix
output('<TR>\n') output('<tr>\n')
# Add +/- icon # Add +/- icon
if items: if items:
...@@ -314,7 +314,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -314,7 +314,7 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
elif level > 1: output(_td_single * (level-1)) elif level > 1: output(_td_single * (level-1))
output(_td_single) output(_td_single)
output('\n') output('\n')
output('<TD WIDTH="16" VALIGN="TOP" NOWRAP>') output('<td width="16" valign="top" style="white-space: nowrap">')
for i in range(len(substate)): for i in range(len(substate)):
sub=substate[i] sub=substate[i]
if sub[0]==id: if sub[0]==id:
...@@ -343,14 +343,14 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -343,14 +343,14 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
if exp: if exp:
ptreeData['tree-item-expanded']=1 ptreeData['tree-item-expanded']=1
output('<A NAME="%s" HREF="%s?%stree-c=%s#%s">' output('<a name="%s" href="%s?%stree-c=%s#%s">'
'<IMG SRC="%s/p_/mi" ALT="-" BORDER=0></A>' % '<img src="%s/p_/mi" alt="-" border="0" /></a>' %
(id, root_url, param, s, id, script)) (id, root_url, param, s, id, script))
else: else:
output('<A NAME="%s" HREF="%s?%stree-e=%s#%s">' output('<a name="%s" href="%s?%stree-e=%s#%s">'
'<IMG SRC="%s/p_/pl" ALT="+" BORDER=0></A>' % '<img src="%s/p_/pl" alt="+" border="0" /></a>' %
(id, root_url, param, s, id, script)) (id, root_url, param, s, id, script))
output('</TD>\n') output('</td>\n')
else: else:
if level > 2: output(_td_colspan % level) if level > 2: output(_td_colspan % level)
...@@ -361,12 +361,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -361,12 +361,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
# add item text # add item text
dataspan=colspan-level dataspan=colspan-level
output('<TD%s%s VALIGN="TOP" ALIGN="LEFT">' % output('<td%s%s valign="top" align="left">' %
((dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''), ((dataspan > 1 and (' colspan="%s"' % dataspan) or ''),
(have_arg('nowrap') and args['nowrap'] and ' NOWRAP' or '')) (have_arg('nowrap') and args['nowrap'] and ' style="white-space: nowrap"' or ''))
) )
output(render_blocks(section, md)) output(render_blocks(section, md))
output('</TD>\n</TR>\n') output('</td>\n</tr>\n')
if exp: if exp:
...@@ -385,12 +385,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -385,12 +385,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
output(doc( output(doc(
None, md, None, md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16" NOWRAP></TD>' '<tr>%s<td width="16" style="white-space: nowrap"></td>'
'<TD%s VALIGN="TOP">' '<td%s valign="top">'
% (h, % (h,
(dataspan > 1 and (' COLSPAN="%s"' % dataspan) (dataspan > 1 and (' colspan="%s"' % dataspan)
or ''))), or ''))),
standard_html_footer='</TD></TR>', standard_html_footer='</td></tr>',
)) ))
if items==1: if items==1:
...@@ -406,12 +406,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -406,12 +406,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
try: output(doc( try: output(doc(
None,md, None,md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16" NOWRAP></TD>' '<tr>%s<td width="16" style="white-space: nowrap"></td>'
'<TD%s VALIGN="TOP">' '<td%s valign="top">'
% (h, % (h,
(dataspan > 1 and (dataspan > 1 and
(' COLSPAN="%s"' % dataspan) or ''))), (' colspan="%s"' % dataspan) or ''))),
standard_html_footer='</TD></TR>', standard_html_footer='</td></tr>',
)) ))
finally: md._pop(1) finally: md._pop(1)
elif have_arg('expand'): elif have_arg('expand'):
...@@ -425,12 +425,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -425,12 +425,12 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
try: output(doc( try: output(doc(
None,md, None,md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16" NOWRAP></TD>' '<tr>%s<td width="16" style="white-space: nowrap"></td>'
'<TD%s VALIGN="TOP">' '<td%s valign="top">'
% (h, % (h,
(dataspan > 1 and (dataspan > 1 and
(' COLSPAN="%s"' % dataspan) or ''))), (' colspan="%s"' % dataspan) or ''))),
standard_html_footer='</TD></TR>', standard_html_footer='</td></tr>',
)) ))
finally: md._pop(1) finally: md._pop(1)
else: else:
...@@ -464,16 +464,16 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, ...@@ -464,16 +464,16 @@ def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data,
output(doc( output(doc(
None, md, None, md,
standard_html_header=( standard_html_header=(
'<TR>%s<TD WIDTH="16" NOWRAP></TD>' '<tr>%s<td width="16" style="white-space: nowrap"></td>'
'<TD%s VALIGN="TOP">' '<td%s valign="top">'
% (h, % (h,
(dataspan > 1 and (' COLSPAN="%s"' % dataspan) (dataspan > 1 and (' colspan="%s"' % dataspan)
or ''))), or ''))),
standard_html_footer='</TD></TR>', standard_html_footer='</td></tr>',
)) ))
del diff[-1] del diff[-1]
if not diff: output('</TABLE>\n') if not diff: output('</table>\n')
return data return data
......
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