From 82f76f58cee78ab47debb34db7dbd45e6cca8472 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 10 Dec 2006 00:14:10 +0000 Subject: [PATCH] r1342: Process special case columns so we can now look exactly like we did previously --- includes/class_sort.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/includes/class_sort.php b/includes/class_sort.php index aa9fbe9..b260c32 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -372,13 +372,13 @@ class ListSorter $build = array(); foreach ($columns AS $column) { - $build[] = '
' . $bug["$column"] . '
'; + $build[] = '
' . $this->_processDataForColumn($bug, $column, $params) . '
'; } $data = "\n\t\t" . implode("\n\t\t", $build) . "\n\t"; } else { - $data = $bug["$columns[0]"]; + $data = $this->_processDataForColumn($bug, $columns[0], $params); } $fields .= "\n\t$data"; } @@ -387,6 +387,31 @@ class ListSorter return $output; } + // ################################################################### + /** + * Handler for special-case column data + * + * @param array Bug data + * @param string Column name + * @param string Additional URL params + * + * @return string Processed column data + */ + function _processDataForColumn($bug, $column, $params = null) + { + switch ($column) + { + case 'summary': + return '' . $bug['summary'] . ''; + case 'userid': + return ($bug['userid'] ? $bug['username'] : _('Guest')); + case 'lastpost': + return $bug['lastposttime'] . "\n\t\t
" . ($bug['lastpost'] ? $bug['lastpost'] : _('Guest')); + default: + return $bug["$column"]; + } + } + // ################################################################### /** * Sets up $this->columns so that the data can be processed more -- 2.43.5