views-field-calc-table.tpl.php

  1. cis7 profiles/cis/modules/sandbox/views_field_calc/views-field-calc-table.tpl.php
  2. cis7 sites/all/modules/local_sandboxes/views_field_calc/views-field-calc-table.tpl.php

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.
  • $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.
  • $rows: An array of row items. Each row is an array of content
  • $totals: An array of calculated totals. Each row contains the total for one calculation. keyed by field ID.
2 string references to the theme hook from views-field-calc-table.tpl.php

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

views_field_calc_views_plugins in sites/all/modules/local_sandboxes/views_field_calc/views_field_calc.views.inc
Implements hook_views_plugins().
views_field_calc_views_plugins in profiles/cis/modules/sandbox/views_field_calc/views_field_calc.views.inc
Implements hook_views_plugins().

File

sites/all/modules/local_sandboxes/views_field_calc/views-field-calc-table.tpl.php
View source
  1. <?php
  2. /**
  3. * @file views-view-table.tpl.php
  4. * Template to display a view as a table.
  5. *
  6. * - $title : The title of this group of rows. May be empty.
  7. * - $header: An array of header labels keyed by field id.
  8. * - $fields: An array of CSS IDs to use for each field id.
  9. * - $class: A class or classes to apply to the table, based on settings.
  10. * - $rows: An array of row items. Each row is an array of content
  11. * - $totals: An array of calculated totals. Each row contains the total for one calculation.
  12. * keyed by field ID.
  13. * @ingroup views_templates
  14. */
  15. if (empty($rows) && empty($totals)) {
  16. return;
  17. }
  18. ?>
  19. <table class="<?php print $class; ?>">
  20. <?php if (!empty($title)) : ?>
  21. <caption><?php print $title; ?></caption>
  22. <?php endif; ?>
  23. <thead>
  24. <tr>
  25. <?php foreach ($header as $field => $label): ?>
  26. <th class="views-field views-field-<?php print $fields[$field]; ?> <?php print $options['info'][$field]['align'] ?>">
  27. <?php print $label; ?>
  28. </th>
  29. <?php endforeach; ?>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <?php foreach ($rows as $count => $row): ?>
  34. <tr class="<?php print ($count % 2 == 0) ? 'even' : 'odd';?>">
  35. <?php foreach ($row as $field => $content): ?>
  36. <td class="views-field views-field-<?php print $fields[$field]; ?> <?php print $options['info'][$field]['align'] ?>">
  37. <?php print $content; ?>
  38. </td>
  39. <?php endforeach; ?>
  40. </tr>
  41. <?php endforeach; ?>
  42. </tbody>
  43. <tfoot>
  44. <tr class="view-subfooter-ftotal">
  45. <?php foreach($total as $field => $content) :?>
  46. <td class="view-subfooter views-field views-field-<?php print $fields[$field]; ?> <?php print $options['info'][$field]['align'] ?>">
  47. <?php print $content; ?>
  48. </td>
  49. <?php endforeach; ?>
  50. </tr>
  51. </tfoot>
  52. </table>

Related topics