| 1 |
<?php
|
| 2 |
// $Id: draggableviews-view-draggabletable.tpl.php,v 1.1 2008/07/15 21:07:45 sevi Exp $
|
| 3 |
/**
|
| 4 |
* @file views-view-draggabletable.tpl.php
|
| 5 |
* Template to display a view as a draggable table.
|
| 6 |
*
|
| 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 |
* keyed by field ID.
|
| 12 |
*
|
| 13 |
* - $tabledrag: An array of tabledrag settings
|
| 14 |
* - $tabledrag_tableId: The table id that drupal_add_tabledrag needs
|
| 15 |
* @ingroup views_templates
|
| 16 |
*/
|
| 17 |
|
| 18 |
//add tabledrag
|
| 19 |
if (count($tabledrag) > 0) {
|
| 20 |
foreach ($tabledrag as $drag) {
|
| 21 |
drupal_add_tabledrag($tabledrag_table_id, $drag['action'], $drag['relationship'], $drag['group'], $drag['subgroup'], $drag['source'], $drag['hidden'], $drag['limit']);
|
| 22 |
}
|
| 23 |
}
|
| 24 |
?>
|
| 25 |
<table class="<?php print $class; ?>" id="<?php print $tabledrag_table_id; ?>">
|
| 26 |
<thead>
|
| 27 |
<tr>
|
| 28 |
<?php foreach ($header as $field => $label): ?>
|
| 29 |
<th class="views-field views-field-<?php print $fields[$field]; ?>">
|
| 30 |
<?php print $label; ?>
|
| 31 |
</th>
|
| 32 |
<?php endforeach ?>
|
| 33 |
</tr>
|
| 34 |
</thead>
|
| 35 |
<tbody>
|
| 36 |
<?php foreach ($rows as $count => $row): ?>
|
| 37 |
<tr class="draggable <?php print ($count % 2 == 1) ? 'even' : 'odd';?><? if($tabledrag_type[$count]) print ' '.$tabledrag_type[$count]; ?>">
|
| 38 |
<?php foreach ($row as $field => $content): ?>
|
| 39 |
<td class="views-field views-field-<?php print $fields[$field]; ?>"><?php
|
| 40 |
print $content;
|
| 41 |
?></td>
|
| 42 |
<?php endforeach; ?>
|
| 43 |
</tr>
|
| 44 |
<?php endforeach; ?>
|
| 45 |
</tbody>
|
| 46 |
</table>
|