summaryrefslogtreecommitdiff
path: root/modules/field_ui/field_ui-display-overview-table.tpl.php
blob: c9c39593e0d3152a2e61d79b9581d3284f0b34e6 (plain)
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
<?php
// $Id$

/**
 * @file
 * Default theme implementation to configure field display settings.
 *
 * Available variables:
 * - $rows: The field display settings form broken down into rendered rows for
 *   printing as a table. The array is separated in two entries, 'visible' and
 *   'hidden'.
 * - $id: The HTML id for the table.
 *
 * @see field_ui_display_overview_form()
 * @see template_preprocess_field_ui_display_overview_table()
 */
?>
<?php if ($rows): ?>
  <table id="field-display-overview" class="field-display-overview sticky-enabled">
    <thead>
      <tr>
        <th><?php print t('Field'); ?></th>
        <th><?php print t('Weight'); ?></th>
        <th><?php print t('Label'); ?></th>
        <th><?php print t('Format'); ?></th>
      </tr>
    </thead>
    <tbody>
      <tr class="region-message region-visible-message <?php print empty($rows['visible']) ? 'region-empty' : 'region-populated'; ?>">
        <td colspan="4"><em><?php print t('No field is displayed'); ?></em></td>
      </tr>
      <?php
      $count = 0;
      foreach ($rows['visible'] as $row): ?>
        <tr class="<?php print $count % 2 == 0 ? 'odd' : 'even'; ?> <?php print $row->class ?>">
          <td><span class="<?php print $row->label_class; ?>"><?php print $row->human_name; ?></span></td>
          <td><?php print $row->weight . $row->hidden_name; ?></td>
          <td><?php if (isset($row->label)) print $row->label; ?></td>
          <td><?php print $row->type; ?></td>
        </tr>
        <?php $count++;
      endforeach; ?>
      <tr class="region-title region-title-hidden">
        <td colspan="4"><?php print t('Hidden'); ?></td>
      </tr>
      <tr class="region-message region-hidden-message <?php print empty($rows['hidden']) ? 'region-empty' : 'region-populated'; ?>">
        <td colspan="4"><em><?php print t('No field is hidden'); ?></em></td>
      </tr>
      <?php foreach ($rows['hidden'] as $row): ?>
        <tr class="<?php print $count % 2 == 0 ? 'odd' : 'even'; ?> <?php print $row->class ?>">
          <td><span class="<?php print $row->label_class; ?>"><?php print $row->human_name; ?></span></td>
          <td><?php print $row->weight . $row->hidden_name; ?></td>
          <td><?php if (isset($row->label)) print $row->label; ?></td>
          <td><?php print $row->type; ?></td>
        </tr>
        <?php $count++;
      endforeach; ?>
    </tbody>
  </table>
<?php endif; ?>