From 01f08e86dda86c9617935d467bb6f50dc95d1462 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 24 May 2004 05:10:32 +0000 Subject: - Patch #7966 by Goba: The box has it's content wrapped in a paragraph now, which is not suitable for the purposes the box is used in. Boxes are used to wrap tables or forms with titles. The comment module uses theme(box, ...) to wrap forms into boxes for example. Therefore using a paragraph does not make the output valid XHTML and a div is needed. --- includes/theme.inc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/includes/theme.inc b/includes/theme.inc index a4f329cd4..e77a79ce9 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -333,6 +333,7 @@ function theme_table($header, $rows, $attributes = NULL) { */ if (is_array($rows)) { + $i = 0; foreach ($rows as $number => $row) { if ($number % 2 == 1) { $output .= " "; @@ -342,9 +343,23 @@ function theme_table($header, $rows, $attributes = NULL) { } foreach ($row as $cell) { + // highlight the currently sorted column. only applies to tables with headers. + if (is_array($header)) { + $ts = tablesort_init($header); + if ($i === $ts['index']) { + if (is_array($cell)) { + $cell['class'] = 'active'; + } + else { + $cell = array('data' => $cell, 'class' => 'active'); + } + } + } $output .= _theme_table_cell($cell, 0); + $i++; } $output .= " \n"; + $i = 0; } } @@ -363,7 +378,7 @@ function theme_table($header, $rows, $attributes = NULL) { * @return a string containing the @a box output. */ function theme_box($title, $content, $region = 'main') { - $output = "

$title

$content

"; + $output = "

$title

$content
"; return $output; } -- cgit v1.2.3