Skip to content
Snippets Groups Projects
Commit 01f08e86 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #7966 by Goba: The box has it's content wrapped in a paragraph now,...

- 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.
parent 2e67c2ff
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment