advanced-forum.bootstrap.topic-list-view.tpl.php in Advanced Forum Bootstrap 7.3
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.
- $class: 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.
File
styles/bootstrap/advanced-forum.bootstrap.topic-list-view.tpl.phpView source
<?php
/**
* @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.
* - $class: 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.
* @ingroup views_templates
*/
?>
<div id="forum-topic-list">
<?php
if (!empty($title)) {
?>
<caption><?php
print $title;
?></caption>
<?php
}
?>
<table class="forum-table forum-table-topics <?php
print $classes;
?> table table-striped">
<thead>
<tr>
<?php
foreach ($header as $field => $label) {
?>
<th class="views-field views-field-<?php
print $fields[$field];
?>">
<?php
print $label;
?>
</th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
foreach ($rows as $count => $row) {
?>
<tr class="<?php
print implode(' ', $row_classes[$count]);
?>">
<?php
if (empty($shadow[$count])) {
?>
<?php
foreach ($row as $field => $content) {
?>
<?php
/* To add popup from teaser in the title of the td, add: title="<?php print $teasers[$count] ?>"*/
?>
<td class="views-field views-field-<?php
print $fields[$field];
?>">
<?php
/* Extra label for stickies. */
?>
<?php
if ($field == 'title' && !empty($sticky[$count])) {
?>
<span class="sticky-label"><?php
print t('Sticky:');
?></span>
<?php
}
?>
<?php
print $content;
?>
</td>
<?php
}
?>
<?php
}
else {
?>
<?php
/* For shadow posts, we print only the icon and themed notice. */
?>
<td class="views-field views-field-<?php
print $fields['topic_icon'];
?>">
<?php
print $row['topic_icon'];
?>
</td>
<td class="views-field views-field-<?php
print $fields['title'];
?>" colspan="<?php
print count($header) - 1;
?>">
<?php
print $shadow[$count];
?>
</td>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
</div>