Skip to content
Snippets Groups Projects
Commit ec465d4f authored by Earl Miles's avatar Earl Miles
Browse files

#414304 by jcmarco: Fix visual problems when context list is entirely empty on context page.

parent 0385fee1
No related branches found
Tags 6.x-1.0-alpha3
No related merge requests found
...@@ -118,6 +118,7 @@ function theme_ctools_context_list($object, $header = '') { ...@@ -118,6 +118,7 @@ function theme_ctools_context_list($object, $header = '') {
$titles = array(); $titles = array();
$output = ''; $output = '';
$count = 1; $count = 1;
// Describe 'built in' contexts. // Describe 'built in' contexts.
if (!empty($object->base_contexts)) { if (!empty($object->base_contexts)) {
foreach ($object->base_contexts as $id => $context) { foreach ($object->base_contexts as $id => $context) {
...@@ -152,6 +153,7 @@ function theme_ctools_context_list($object, $header = '') { ...@@ -152,6 +153,7 @@ function theme_ctools_context_list($object, $header = '') {
$count++; $count++;
} }
} }
$count = 1; $count = 1;
// Then, make a nice list of contexts. // Then, make a nice list of contexts.
if (!empty($object->contexts)) { if (!empty($object->contexts)) {
...@@ -168,6 +170,7 @@ function theme_ctools_context_list($object, $header = '') { ...@@ -168,6 +170,7 @@ function theme_ctools_context_list($object, $header = '') {
$count++; $count++;
} }
} }
// And relationships // And relationships
if (!empty($object->relationships)) { if (!empty($object->relationships)) {
foreach ($object->relationships as $relationship) { foreach ($object->relationships as $relationship) {
...@@ -183,15 +186,15 @@ function theme_ctools_context_list($object, $header = '') { ...@@ -183,15 +186,15 @@ function theme_ctools_context_list($object, $header = '') {
$count++; $count++;
} }
} }
if ($output) {
$head = ''; $head = '';
if ($header) { if ($header) {
$head .= '<thead><tr>'; $head .= '<thead><tr>';
$head .= '<th colspan="2">' . $header . '</th>'; $head .= '<th colspan="2">' . $header . '</th>';
$head .= '</tr></thead>'; $head .= '</tr></thead>';
}
return "<table>$head<tbody>$output</tbody></table>\n";
} }
return $output ? "<table>$head<tbody>$output</tbody></table>\n" : "<table>$head</table>\n";
} }
/** /**
......
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