Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // $Id: views-view-table.tpl.php,v 1.8.6.3 2010/12/10 08:19:15 dereine Exp $
- /**
- * @file views-view-table.tpl.php
- * Template to display a view as a table.
- *
- * - $title : The title of this group of rows. May be empty.
- * - $header: An array of header labels keyed by field id.
- * - $header_classes: An array of header classes keyed by field id.
- * - $fields: An array of CSS IDs to use for each field id.
- * - $class: A class or classes to apply to the table, based on settings.
- * - $row_classes: An array of classes to apply to each row, indexed by row
- * number. This matches the index in $rows.
- * - $rows: An array of row items. Each row is an array of content.
- * $rows are keyed by row number, fields within rows are keyed by field ID.
- * - $field_classes: An array of classes to apply to each field, indexed by
- * field id, then row number. This matches the index in $rows.
- * @ingroup views_templates
- */
- ?>
- <table class="<?php print $classes; ?>"<?php print $attributes; ?>>
- <?php if (!empty($title)) : ?>
- <caption><?php print $title; ?></caption>
- <?php endif; ?>
- <?php
- echo '<pre>';
- print_r($rows);
- echo '</pre>';
- $grades = array(
- '1' => 'entity_id_6',
- '2' => 'entity_id_10',
- '3' => 'entity_id_11',
- '4' => 'entity_id_12',
- '5' => 'entity_id_13',
- '6' => 'entity_id_14',
- '7' => 'entity_id_15',
- '8' => 'entity_id_16',
- '9' => 'entity_id_17',
- '10' => 'entity_id_7',
- '11' => 'entity_id_8',
- '12' => 'entity_id_9',
- '13' => 'entity_id_18',
- );
- $backwards_grades = array_reverse($grades);
- ?>
- <thead>
- <tr>
- <?php foreach ($header as $field => $label): ?>
- <th class="<?php print $header_classes[$field]; ?>">
- <?php
- print_r($label);
- ?>
- </th>
- <?php endforeach; ?>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($rows as $count => $row): ?>
- <tr class="<?php print implode(' ', $row_classes[$count]); ?>">
- <?php foreach ($row as $field => $content): ?>
- <td class="<?php print $field_classes[$field][$count]; ?>">
- <?php
- print $field;
- print $content;
- ?>
- </td>
- <?php endforeach; ?>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement