Advertisement
bourgetm

Untitled

Jan 29th, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. <?php
  2. global $base_url;
  3. $theme_base = $base_url . '/' . drupal_get_path('theme', $GLOBALS['theme']);
  4. $secure = 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://';
  5. $theme_base = str_replace('http://', $secure, $theme_base);
  6. ?>
  7.  
  8. <?php
  9. /**
  10. * @file
  11. * Template to display a view as a table.
  12. *
  13. * - $title : The title of this group of rows. May be empty.
  14. * - $header: An array of header labels keyed by field id.
  15. * - $header_classes: An array of header classes keyed by field id.
  16. * - $fields: An array of CSS IDs to use for each field id.
  17. * - $classes: A class or classes to apply to the table, based on settings.
  18. * - $row_classes: An array of classes to apply to each row, indexed by row
  19. * number. This matches the index in $rows.
  20. * - $rows: An array of row items. Each row is an array of content.
  21. * $rows are keyed by row number, fields within rows are keyed by field ID.
  22. * - $field_classes: An array of classes to apply to each field, indexed by
  23. * field id, then row number. This matches the index in $rows.
  24. * @ingroup views_templates
  25. */
  26.  
  27. ?>
  28.  
  29.  
  30. <script src="<?php echo $base_url; ?>/sites/all/modules/footable/js/jquery-1.9.1.min.js" type="text/javascript"></script>
  31. <script>
  32. if (!window.jQuery) {
  33. document.write('<script src="<?php echo $theme_base; ?>/js/jquery-1.9.1.min.js"><\/script>');
  34. }
  35. </script>
  36.  
  37. <!-- T.Bourgeois added this on Jan-22-15 for the datatable grid add ons -->
  38.  
  39. <link rel="stylesheet" href="<?php echo $theme_base; ?>/css/footable.metro.css" type="text/css" />
  40. <script src="<?php echo $base_url; ?>/sites/all/modules/footable/js/footable.js"type="text/javascript"></script>
  41. <script src="<?php echo $theme_base; ?>/js/footable.filter.js" type="text/javascript"></script>
  42. <script src="<?php echo $theme_base; ?>/js/footable.paginate.js" type="text/javascript"></script>
  43. <script src="<?php echo $theme_base; ?>/js/bootstrap-tab.js" type="text/javascript"></script>
  44.  
  45.  
  46. <p>Search: <input id="filter" type="text"/></p>
  47. <table class="footable" data-filter="#filter" data-page-size="5" <?php if ($classes): print 'class="'. $classes . '" '; endif; ?><?php print $attributes; ?>>
  48. <?php if (!empty($title)) : ?>
  49. <caption><?php print $title; ?></caption>
  50. <?php endif; ?>
  51. <?php if (!empty($header)) : ?>
  52. <thead>
  53. <tr>
  54. <?php foreach ($header as $field => $label): ?>
  55. <th <?php if (!empty($data_class[$field])): print 'data-class="'. $data_class[$field] . '" '; endif; ?><?php if (!empty($data_hide[$field])): print 'data-hide="'. $data_hide[$field] . '" '; endif; ?><?php if ($header_classes[$field]): print 'class="'. $header_classes[$field] . '" '; endif; ?>>
  56. <?php print $label; ?>
  57. </th>
  58. <?php endforeach; ?>
  59. </tr>
  60. </thead>
  61. <?php endif; ?>
  62. <tbody>
  63. <?php foreach ($rows as $row_count => $row): ?>
  64. <tr <?php if ($row_classes[$row_count]): print 'class="' . implode(' ', $row_classes[$row_count]) .'"'; endif; ?>>
  65. <?php foreach ($row as $field => $content): ?>
  66. <td <?php if ($field_classes[$field][$row_count]): print 'class="'. $field_classes[$field][$row_count] . '" '; endif; ?><?php print drupal_attributes($field_attributes[$field][$row_count]); ?>>
  67. <?php print $content; ?>
  68. </td>
  69. <?php endforeach; ?>
  70. </tr>
  71. <?php endforeach; ?>
  72. </tbody>
  73. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement