<?php function review_render($review) {
    echo '<div class="reviews_item" style="position: relative; width: 100%;" ' . ($review['file'] ? 'onclick="review.showFile(\'/u/i/' . Page::replaceImageSize($review['file'], 'XL') . '\'    , $(this));" style="cursor: pointer;"' : '') . '>';
    if ($review['file']) {
        $filename = Page::replaceImageSize($review['file'], 'M');
        $file = sfConfig::get('sf_upload_dir') . '/i/' . $filename;
        if (file_exists($file)) {
            echo '<img width="100%"  class="reviews_item__file" src="/u/i/' . $filename . '" />';
            echo '<i class="br10"></i>';
        }
    }
    echo '<div class="reviews_item__text">' . ($review['file'] && strlen($review['body']) > 335 ? substr($review['body'], 0, 335).'...' : $review['body'])  . '</div>';
    echo '<div class="reviews_item__text_for_popup">' . $review['body'] . '</div>';
    echo '<div class="reviews_item__author">' . $review['name'] . '</div>';
    echo '</div>';
    echo '<i class="br10"></i>';
    return false;
} ?>

<table class="to_div" cellpadding="0" cellspacing="0" width="100%">
    <tbody align="left" valign="top">
    <td width="32%">
        <?php
        if (count($reviews[0]) > 0) {
            foreach ($reviews[0] as $review) {
                review_render($review);
            }
        }
        ?>
    </td>
    <td width="2%"></td>
    <td width="32%">
        <?php
        if (count($reviews[1]) > 0) {
            foreach ($reviews[1] as $review) {
                review_render($review);
            }
        }
        ?>
    </td>
    <td width="2%"></td>
    <td width="32%">
        <?php
        if (count($reviews[0]) > 0) {
            foreach ($reviews[2] as $review) {
                review_render($review);
            }
        }
        ?>
    </td>
    </tbody>
</table>
<?php
if ($die)
    die();