Projet

Général

Profil

Révision 937bad71

Ajouté par Assos Assos il y a presque 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/themes/bootstrap/templates/system/table.func.php
81 81
  $responsive = $variables['responsive'];
82 82

  
83 83
  // Add sticky headers, if applicable.
84
  if (count($header) && $sticky) {
84
  if (is_array($header) && count($header) && $sticky) {
85 85
    drupal_add_js('misc/tableheader.js');
86 86
    // Add 'sticky-enabled' class to the table to identify it for JS.
87 87
    // This is needed to target tables constructed by this function.
......
101 101
  }
102 102

  
103 103
  // Format the table columns:
104
  if (count($colgroups)) {
104
  if (!empty($colgroups)) {
105 105
    foreach ($colgroups as $number => $colgroup) {
106 106
      $attributes = array();
107 107

  
......
136 136
  }
137 137

  
138 138
  // Add the 'empty' row message if available.
139
  if (!count($rows) && $empty) {
139
  if (empty($rows) && !empty($empty)) {
140 140
    $header_count = 0;
141 141
    foreach ($header as $header_cell) {
142 142
      if (is_array($header_cell)) {
......
156 156
  }
157 157

  
158 158
  // Format the table header:
159
  if (count($header)) {
159
  if (!empty($header)) {
160 160
    $ts = tablesort_init($header);
161 161
    // HTML requires that the thead tag has tr tags in it followed by tbody
162 162
    // tags. Using ternary operator to check and see if we have any rows.
......
174 174
  }
175 175

  
176 176
  // Format the table rows:
177
  if (count($rows)) {
177
  if (!empty($rows)) {
178 178
    $output .= "<tbody>\n";
179 179
    foreach ($rows as $row) {
180 180
      // Check if we're dealing with a simple or complex row.
......
205 205
  }
206 206

  
207 207
  // Format the table footer:
208
  if (count($footer)) {
208
  if (!empty($footer)) {
209 209
    $output .= "<tfoot>\n";
210 210
    foreach ($footer as $row) {
211 211
      // Check if we're dealing with a simple or complex row.

Formats disponibles : Unified diff