diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-05-24 05:10:32 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-05-24 05:10:32 +0000 |
commit | 01f08e86dda86c9617935d467bb6f50dc95d1462 (patch) | |
tree | 566bf1b9a649a0fc99e09171b9780a084500c014 | |
parent | 2e67c2ffa1e4db433978342ce10fbac0a30dee12 (diff) | |
download | brdo-01f08e86dda86c9617935d467bb6f50dc95d1462.tar.gz brdo-01f08e86dda86c9617935d467bb6f50dc95d1462.tar.bz2 |
- 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.
-rw-r--r-- | includes/theme.inc | 17 |
1 files changed, 16 insertions, 1 deletions
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 .= " <tr class=\"light\">"; @@ -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 .= " </tr>\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 = "<h2 class=\"title\">$title</h2><p>$content</p>"; + $output = "<h2 class=\"title\">$title</h2><div>$content</div>"; return $output; } |