You are here

views-view-table--apply-for-role-admin--apply-for-role-admin.tpl.php in Apply for role 7

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.

File

templates/views-view-table--apply-for-role-admin--apply-for-role-admin.tpl.php
View source
<?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
 */
?>
<table <?php

if ($classes) {
  print 'class="' . $classes . '" ';
}
print $attributes;
?>>
  <?php

if (!empty($title)) {
  ?>
    <caption><?php

  print $title;
  ?></caption>
  <?php

}
?>
  <?php

if (!empty($header)) {
  ?>
    <thead>
      <tr>
        <?php

  foreach ($header as $field => $label) {
    ?>
          <? if ($field != 'message'): ?>
            <th <?php

    if ($header_classes[$field]) {
      print 'class="' . $header_classes[$field] . '" ';
    }
    ?>>
              <?php

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

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

}
?>
  <tbody>
    <?php

foreach ($rows as $row_count => $row) {
  ?>
      <tr <?php

  if ($row_classes[$row_count]) {
    print 'class="' . implode(' ', $row_classes[$row_count]) . '"';
  }
  ?>>
        <?php

  foreach ($row as $field => $content) {
    ?>
          <? if ($field != 'message'): ?>
            <td <?php

    if ($field_classes[$field][$row_count]) {
      print 'class="' . $field_classes[$field][$row_count] . '" ';
    }
    print drupal_attributes($field_attributes[$field][$row_count]);
    ?>>
              <?php

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

  }
  ?>
      </tr>
      <? if (array_key_exists('message', $row)): ?>
        <tr <?php

  if ($row_classes[$row_count]) {
    print 'class="' . implode(' ', $row_classes[$row_count]) . '"';
  }
  ?>>
          <td <?php

  if ($field_classes['message'][$row_count]) {
    print 'colspan ="' . count($row) . '" ' . 'class="' . $field_classes['message'][$row_count] . '" ';
  }
  print drupal_attributes($field_attributes['message'][$row_count]);
  ?>>
            <?php

  print $row['message'];
  ?>
          </td>
        </tr>
      <? endif; ?>
    <?php

}
?>
  </tbody>
</table>