-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminimal_theme-php_72_count-2951412-9.patch
84 lines (78 loc) · 2.7 KB
/
adminimal_theme-php_72_count-2951412-9.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff --git a/template.php b/template.php
index 205293f..fa63c50 100644
--- a/template.php
+++ b/template.php
@@ -369,7 +369,7 @@ function adminimal_table($variables) {
$empty = $variables['empty'];
// Add sticky headers, if applicable.
- if (count($header) && $sticky) {
+ if (!empty($header) && $sticky) {
drupal_add_js('misc/tableheader.js');
// Add 'sticky-enabled' class to the table to identify it for JS.
// This is needed to target tables constructed by this function.
@@ -384,7 +384,7 @@ function adminimal_table($variables) {
}
// Format the table columns:
- if (count($colgroups)) {
+ if (!empty($colgroups)) {
foreach ($colgroups as $number => $colgroup) {
$attributes = array();
@@ -419,14 +419,16 @@ function adminimal_table($variables) {
}
// Add the 'empty' row message if available.
- if (!count($rows) && $empty) {
+ if (empty($rows) && $empty) {
$header_count = 0;
- foreach ($header as $header_cell) {
- if (is_array($header_cell)) {
- $header_count += isset($header_cell['colspan']) ? $header_cell['colspan'] : 1;
- }
- else {
- ++$header_count;
+ if (!empty($header)) {
+ foreach ($header as $header_cell) {
+ if (is_array($header_cell)) {
+ $header_count += isset($header_cell['colspan']) ? $header_cell['colspan'] : 1;
+ }
+ else {
+ ++$header_count;
+ }
}
}
$rows[] = array(array(
@@ -437,24 +439,24 @@ function adminimal_table($variables) {
}
// Format the table header:
- if (count($header)) {
+ if (!empty($header)) {
$ts = tablesort_init($header);
// HTML requires that the thead tag has tr tags in it followed by tbody
// tags. Using ternary operator to check and see if we have any rows.
- $output .= (count($rows) ? ' <thead><tr>' : ' <tr>');
+ $output .= (!empty($rows) ? ' <thead><tr>' : ' <tr>');
foreach ($header as $cell) {
$cell = tablesort_header($cell, $header, $ts);
$output .= _theme_table_cell($cell, TRUE);
}
// Using ternary operator to close the tags based on whether or not there are rows
- $output .= (count($rows) ? " </tr></thead>\n" : "</tr>\n");
+ $output .= (!empty($rows) ? " </tr></thead>\n" : "</tr>\n");
}
else {
$ts = array();
}
// Format the table rows:
- if (count($rows)) {
+ if (!empty($rows)) {
$output .= "<tbody>\n";
$flip = array(
'even' => 'odd',
@@ -477,7 +479,7 @@ function adminimal_table($variables) {
$attributes = array();
$no_striping = FALSE;
}
- if (count($cells)) {
+ if (!empty($cells)) {
// Add odd/even class
if (!$no_striping) {
$class = $flip[$class];