From 8d76758cf22a62fe1f7cb4840c8962b6d3db23a1 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 10 Dec 2006 21:18:18 +0000 Subject: [PATCH] r1348: Let's generate valid XHTML in ListSorter->_processDataForColumn() --- includes/class_sort.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/includes/class_sort.php b/includes/class_sort.php index 0093ed6..cec00f2 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -393,13 +393,13 @@ class ListSorter $build = array(); foreach ($columns AS $column) { - $build[] = '
' . $this->_processDataForColumn($bug, $column, $params) . '
'; + $build[] = $this->_processDataForColumn($bug, $column, $params, true); } $data = "\n\t\t" . implode("\n\t\t", $build) . "\n\t"; } else { - $data = $this->_processDataForColumn($bug, $columns[0], $params); + $data = $this->_processDataForColumn($bug, $columns[0], $params, false); } $fields .= "\n\t$data"; } @@ -415,23 +415,26 @@ class ListSorter * @param array Bug data * @param string Column name * @param string Additional URL params + * @param bool Will this column have multiple data sets? * * @return string Processed column data */ - function _processDataForColumn($bug, $column, $params = null) + function _processDataForColumn($bug, $column, $params = null, $multi = false) { + $open = ($multi ? '
' : ''); + $close = ($multi ? '
' : ''); switch ($column) { case 'summary': - return '' . $bug['summary'] . ''; + return $open . '' . $bug['summary'] . '' . $close; case 'userid': - return ($bug['userid'] ? $bug['username'] : _('Guest')); + return $open . ($bug['userid'] ? $bug['username'] : _('Guest')) . $close; case 'lastpost': - return $bug['lastposttime'] . "\n\t\t
" . _('by') . ' ' . ($bug['lastpost'] ? $bug['lastpost'] : _('Guest')); + return "\n\t\t
" . $bug['lastposttime'] . "
\n\t\t
" . _('by') . ' ' . ($bug['lastpost'] ? $bug['lastpost'] : _('Guest')) . "
\n\t"; case 'votes': - return '
' . _('For:') . ' ' . $bug['votefor'] . "
\n\t\t
" . _('Against:') . ' ' . $bug['voteagainst']; + return "\n\t\t
" . _('For:') . ' ' . $bug['votefor'] . "
\n\t\t
" . _('Against:') . ' ' . $bug['voteagainst'] . "
\n\t"; default: - return $bug["$column"]; + return $open . $bug["$column"] . $close; } } -- 2.43.5