Location: PHPKode > projects > Stickleback > stickleback-1.10.0/stickleback/plugins/sbgui/guirender/sbgui_DataTable.render.php
<?php

/**
 *
 * Copyright (c) 2007 Yahoo! Inc.  All rights reserved.
 * The copyrights embodied in the content of this file are licensed under the BSD
 * open source license
 *
**/

$headers = $sbgui->getAllHeaders( $renderevent );
$extcols = $sbgui->columnList( $renderevent );
$header = $sbgui->getPreHeader();
$footer = $sbgui->getPostFooter();
$heading = $sbgui->getHeading();
$caption = $sbgui->getCaption();
$count = $sbgui->colCount( $renderevent );
?>

<div class="sbgui-data-table mod">
    <?php
    if ( ! is_null( $heading ) ) {
        $heading = new sbgui_HeadingViewlet( array("text" => $heading ) );
        print $heading->render( $sbgui, $renderevent );
    }
    ?>

    <?php if ( ! is_null( $header ) ) { ?>
    <div class="hd">
        <?php
        // need to honor ViewletData for backwards compatibility
        if ( $header instanceof sbgui_ViewletData ) {
            print $sbgui->runViewletData( $renderevent, $header );
        } else {
            print $header->render( $sbgui, $renderevent );
        }
    ?>
    </div>
    <?php } ?>

    <table class="bd">
    <?php
    if ( ! is_null( $caption ) ) {
        print "<caption>$caption</caption>";
    }
    ?>

    <thead>
        <tr>
            <?php
            foreach ( $headers as $cellheader ) {
                print "<th scope=\"col\">$cellheader</th>";
            }
            ?>
        </tr>
    </thead>

    <tbody>
    <?php
    $num=0;
    foreach ( $sbgui as $row ) {
        $num++;
        $class = $num % 2 == 0 ? "even" : "odd";
        print "<tr class=\"{$class}\">\n";
        foreach ( $row as  $col ) {
    ?>
    <td><?php
    // need to honor ViewletData for backwards compatibility
    if ( $col instanceof sbgui_ViewletData ) {
        print $sbgui->runViewletData( $renderevent, $col );
    } else {
        print $col->render( $sbgui, $renderevent );
    }
    ?></td>
    <?php
        }
        foreach ( $extcols as $extcol ) {
            print "<td>\n";
            $extcol->handleDisplay( $renderevent );
            print "</td>\n";
        }
        print "</tr>\n";
    }
    ?>
    </tbody>
    </table>

    <?php if ( ! is_null( $footer ) ) { ?>
    <div class="ft">
        <?php
        // need to honor ViewletData for backwards compatibility
        if ( $footer instanceof sbgui_ViewletData ) {
            print $sbgui->runViewletData( $renderevent, $footer );
        } else {
            print $footer->render( $sbgui, $renderevent );
        }
    ?>
    </div>
    <?php } ?>
</div>
Return current item: Stickleback