Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $base_url;
- $theme_base = $base_url . '/' . drupal_get_path('theme', $GLOBALS['theme']);
- $secure = 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://';
- $theme_base = str_replace('http://', $secure, $theme_base);
- ?>
- <?php
- /**
- * @file
- * 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.
- * - $classes: 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
- */
- ?>
- <script src="<?php echo $base_url; ?>/sites/all/modules/footable/js/jquery-1.9.1.min.js" type="text/javascript"></script>
- <script>
- if (!window.jQuery) {
- document.write('<script src="<?php echo $theme_base; ?>/js/jquery-1.9.1.min.js"><\/script>');
- }
- </script>
- <!-- T.Bourgeois added this on Jan-22-15 for the datatable grid add ons -->
- <link rel="stylesheet" href="<?php echo $theme_base; ?>/css/footable.metro.css" type="text/css" />
- <script src="<?php echo $base_url; ?>/sites/all/modules/footable/js/footable.js"type="text/javascript"></script>
- <script src="<?php echo $theme_base; ?>/js/footable.filter.js" type="text/javascript"></script>
- <script src="<?php echo $theme_base; ?>/js/footable.paginate.js" type="text/javascript"></script>
- <script src="<?php echo $theme_base; ?>/js/bootstrap-tab.js" type="text/javascript"></script>
- <p>Search: <input id="filter" type="text"/></p>
- <table class="footable" data-filter="#filter" data-page-size="5" <?php if ($classes): print 'class="'. $classes . '" '; endif; ?><?php print $attributes; ?>>
- <?php if (!empty($title)) : ?>
- <caption><?php print $title; ?></caption>
- <?php endif; ?>
- <?php if (!empty($header)) : ?>
- <thead>
- <tr>
- <?php foreach ($header as $field => $label): ?>
- <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; ?>>
- <?php print $label; ?>
- </th>
- <?php endforeach; ?>
- </tr>
- </thead>
- <?php endif; ?>
- <tbody>
- <?php foreach ($rows as $row_count => $row): ?>
- <tr <?php if ($row_classes[$row_count]): print 'class="' . implode(' ', $row_classes[$row_count]) .'"'; endif; ?>>
- <?php foreach ($row as $field => $content): ?>
- <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]); ?>>
- <?php print $content; ?>
- </td>
- <?php endforeach; ?>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement