You are here

draggableviews-view-draggabletable.tpl.php in DraggableViews 7

This file is a modified version of: views-view-table.tpl.php,v 1.8 2009/01/28 00:43:43 merlinofchaos.

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.
  • $classes: 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.
  • $tabledrag_tableId: The table id that drupal_add_tabledrag needs

File

draggableviews-view-draggabletable.tpl.php
View source
<?php

/**
 * This file is a modified version of: views-view-table.tpl.php,v 1.8 2009/01/28 00:43:43 merlinofchaos.
 *
 * @file 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.
 * - $classes: 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.
 *
 * - $tabledrag_tableId: The table id that drupal_add_tabledrag needs
 */
?>
<table class="<?php

print $classes;
?>" id="<?php

print $tabledrag_table_id;
?>">
  <thead>
    <tr>
      <?php

foreach ($header as $field => $label) {
  ?>
        <th class="views-field views-field-<?php

  print $fields[$field];
  ?>"<?php

  if (!empty($style[$field])) {
    print ' style="' . $style[$field] . '"';
  }
  ?>>
          <?php

  print $label;
  ?>
        </th>
      <?php

}
?>
    </tr>
  </thead>
  <tbody>
    <?php

foreach ($rows as $count => $row) {
  ?>
      <tr class="draggable <?php

  print implode(' ', $row_classes[$count]);
  if (!empty($draggableviews_extended[$count])) {
    print ' draggableviews-extended';
  }
  if (!empty($tabledrag_type[$count])) {
    print ' ' . $tabledrag_type[$count];
  }
  ?>">
        <?php

  foreach ($row as $field => $content) {
    ?>
          <td class="views-field views-field-<?php

    print $fields[$field];
    ?>"<?php

    if (!empty($style[$field])) {
      print ' style="' . $style[$field] . '"';
    }
    ?>>
            <?php

    print $content;
    ?>
          </td>
        <?php

  }
  ?>
      </tr>
    <?php

}
?>
  </tbody>
</table>