| 1 |
<?php
|
| 2 |
// $Id: views-calc-table.tpl.php,v 1.4 2009/04/03 13:55:36 karens Exp $
|
| 3 |
/**
|
| 4 |
* @file views-view-table.tpl.php
|
| 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 |
* - $fields: An array of CSS IDs to use for each field id.
|
| 10 |
* - $class: A class or classes to apply to the table, based on settings.
|
| 11 |
* - $rows: An array of row items. Each row is an array of content
|
| 12 |
* - $totals: An array of calculated totals. Each row contains the total for one calculation.
|
| 13 |
* keyed by field ID.
|
| 14 |
* @ingroup views_templates
|
| 15 |
*/
|
| 16 |
if (empty($rows) && empty($totals)) {
|
| 17 |
return;
|
| 18 |
}
|
| 19 |
?>
|
| 20 |
<table class="<?php print $class; ?>">
|
| 21 |
<?php if (!empty($title)) : ?>
|
| 22 |
<caption><?php print $title; ?></caption>
|
| 23 |
<?php endif; ?>
|
| 24 |
<thead>
|
| 25 |
<tr>
|
| 26 |
<?php foreach ($header as $field => $label): ?>
|
| 27 |
<th class="views-field views-field-<?php print $fields[$field]; ?> <?php print $options['info'][$field]['justification'] ?>">
|
| 28 |
<?php print $label; ?>
|
| 29 |
</th>
|
| 30 |
<?php endforeach; ?>
|
| 31 |
</tr>
|
| 32 |
</thead>
|
| 33 |
<tbody>
|
| 34 |
<?php foreach ($rows as $count => $row): ?>
|
| 35 |
<tr class="<?php print ($count % 2 == 0) ? 'even' : 'odd';?>">
|
| 36 |
<?php foreach ($row as $field => $content): ?>
|
| 37 |
<td class="views-field views-field-<?php print $fields[$field]; ?> <?php print $options['info'][$field]['justification'] ?>">
|
| 38 |
<?php print $content; ?>
|
| 39 |
</td>
|
| 40 |
<?php endforeach; ?>
|
| 41 |
</tr>
|
| 42 |
<?php endforeach; ?>
|
| 43 |
</tbody>
|
| 44 |
<tfoot>
|
| 45 |
<?php foreach ($sub_totals as $type => $row): ?>
|
| 46 |
<tr class="view-subfooter-number">
|
| 47 |
<?php foreach ($row as $field => $content): ?>
|
| 48 |
<td class="view-subfooter views-field views-field-<?php print $fields[$field]; ?> <?php print $options['info'][$field]['justification'] ?>">
|
| 49 |
<?php print $content; ?>
|
| 50 |
</td>
|
| 51 |
<?php endforeach; ?>
|
| 52 |
</tr>
|
| 53 |
<?php endforeach; ?>
|
| 54 |
<?php foreach ($totals as $type => $row): ?>
|
| 55 |
<tr class="view-footer-number">
|
| 56 |
<?php foreach ($row as $field => $content): ?>
|
| 57 |
<td class="view-footer views-field views-field-<?php print $fields[$field]; ?> <?php print $options['info'][$field]['justification'] ?>">
|
| 58 |
<?php print $content; ?>
|
| 59 |
</td>
|
| 60 |
<?php endforeach; ?>
|
| 61 |
</tr>
|
| 62 |
<?php endforeach; ?>
|
| 63 |
</tfoot>
|
| 64 |
|
| 65 |
</table>
|