<?php
$translation = $cat->getTranslation();
slot('title', $translation[$culture]['title']);
include_component('main','breadcrumbs', array('cat' => $cat));
echo '<h1 class="content_title">' . $translation[$culture]['title'] . '</h1>';
?>
<div class="catalog_wrap with_filters">
    <?php
    if (isset($products)) {
        ?>
        <table class="to_div" cellspacing="0" cellpadding="0" width="100%">
            <tbody valign="top" align="left">
            <tr>
                <td width="100%" class="catalog_refresh">
                    <div class="catalog_category_childs_wrap">
                    <?php if (count($products) > 0) {
                        foreach ($products as $product) {
                            include_partial("product/product", array("product" => $product));
                        }
                    } ?>
                    </div>
                    <?php include_partial('catalog/pagination', array('count' => count($products_all), 'in_page_count' => $in_page_count)); ?>
                </td>
                <td width="1">
                    <?php
                    include_component('catalog', 'filter', array('cat' => $cat, 'product_ids' => $product_ids));
                    ?>
                </td>
            </tr>
            </tbody>
        </table>
        <?php
    } elseif (isset($cats)) {
        if (count($cats) > 0) {
            echo '<div class="catalog_category_childs_wrap">';
            foreach ($cats as $cat) {
                ?>
                <div class="catalog_category_child_item">
                    <a href="<?php echo url_for("@catalog_show?alias=" . $cat['alias']); ?>" class="anb">
                        <img src="/i/n.gif"
                             style="background-image: url(/u/i/<?php echo Page::replaceImageSize($cat['photo'], 'S'); ?>);"
                             alt="">
                        <span class="black_link"><?php echo $cat['Translation'][$culture]['title']; ?></span>
                    </a>
                </div>
                <?php
            }
            echo '</div>';
        }
    }
    ?>
</div>
