Projet

Général

Profil

Paste
Télécharger (2,04 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / views / theme / views-view-table.tpl.php @ 5d12d676

1
<?php
2

    
3
/**
4
 * @file
5
 * Template to display a view as a table.
6
 *
7
 * - $title : The title of this group of rows.  May be empty.
8
 * - $header: An array of header labels keyed by field id.
9
 * - $caption: The caption for this table. May be empty.
10
 * - $header_classes: An array of header classes keyed by field id.
11
 * - $fields: An array of CSS IDs to use for each field id.
12
 * - $classes: A class or classes to apply to the table, based on settings.
13
 * - $row_classes: An array of classes to apply to each row, indexed by row
14
 *   number. This matches the index in $rows.
15
 * - $rows: An array of row items. Each row is an array of content.
16
 *   $rows are keyed by row number, fields within rows are keyed by field ID.
17
 * - $field_classes: An array of classes to apply to each field, indexed by
18
 *   field id, then row number. This matches the index in $rows.
19
 *
20
 * @ingroup views_templates
21
 */
22
?>
23
<table <?php if ($classes): ?> class="<?php print $classes; ?>"<?php endif ?><?php print $attributes; ?>>
24
   <?php if (!empty($title) || !empty($caption)): ?>
25
     <caption><?php print $caption . $title; ?></caption>
26
  <?php endif; ?>
27
  <?php if (!empty($header)) : ?>
28
    <thead>
29
      <tr>
30
        <?php foreach ($header as $field => $label): ?>
31
          <th <?php if ($header_classes[$field]): ?> class="<?php print $header_classes[$field]; ?>"<?php endif; ?> scope="col">
32
            <?php print $label; ?>
33
          </th>
34
        <?php endforeach; ?>
35
      </tr>
36
    </thead>
37
  <?php endif; ?>
38
  <tbody>
39
    <?php foreach ($rows as $row_count => $row): ?>
40
      <tr <?php if ($row_classes[$row_count]): ?> class="<?php print implode(' ', $row_classes[$row_count]); ?>"<?php endif; ?>>
41
        <?php foreach ($row as $field => $content): ?>
42
          <td <?php if ($field_classes[$field][$row_count]): ?> class="<?php print $field_classes[$field][$row_count]; ?>"<?php endif; ?><?php print drupal_attributes($field_attributes[$field][$row_count]); ?>>
43
            <?php print $content; ?>
44
          </td>
45
        <?php endforeach; ?>
46
      </tr>
47
    <?php endforeach; ?>
48
  </tbody>
49
</table>