nodeformcols-configuration.tpl.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * @file
  4. * Template for the configuration table
  5. */
  6. $regions = nodeformcols_form_regions();
  7. ?>
  8. <table id="fields" class="sticky-enabled">
  9. <thead>
  10. <tr>
  11. <th><?php print t('Field'); ?></th>
  12. <th><?php print t('Options'); ?></th>
  13. <th><?php print t('Region'); ?></th>
  14. <th><?php print t('Weight'); ?></th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. <?php $row = 0; ?>
  19. <?php foreach ($regions as $region => $title): ?>
  20. <tr class="region region-<?php print $region?>">
  21. <td colspan="4" class="region"><?php print $title; ?></td>
  22. </tr>
  23. <tr class="region-message region-<?php print $region?>-message <?php print empty($element[$region]) ? 'region-empty' : 'region-populated'; ?>">
  24. <td colspan="4"><em><?php print t('No fields in this region'); ?></em></td>
  25. </tr>
  26. <?php if (!empty($element[$region])): ?>
  27. <?php foreach ($element[$region] as $field => $data): ?>
  28. <?php
  29. if (substr($field, 0, 1) == '#') {
  30. continue;
  31. }
  32. ?>
  33. <tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even'; ?>">
  34. <td><?php print drupal_render($data[$field . '_name']) ?></td>
  35. <td><?php
  36. if (isset($data[$field . '_collapsed'])) {
  37. print drupal_render($data[$field . '_collapsed']);
  38. }
  39. if (isset($data[$field . '_hidden'])) {
  40. print drupal_render($data[$field . '_hidden']);
  41. }
  42. ?></td>
  43. <td><?php print drupal_render($data[$field . '_region']) ?></td>
  44. <td><?php print drupal_render($data[$field . '_weight']) ?></td>
  45. </tr>
  46. <?php $row++; ?>
  47. <?php endforeach; ?>
  48. <?php endif; ?>
  49. <?php endforeach; ?>
  50. </tbody>
  51. </table>