<?php include(sfConfig::get('sf_app_template_dir') . '/header.php'); ?>
<?php include(sfConfig::get('sf_app_template_dir') . '/_popup.php');?>
    <div class="body_wrapper_wrapper">
        <table class="body_wrapper" width="100%" cellspacing="0" cellpadding="0" height="100%">
            <tr>
                <td height="100%" align="center">
                    <table class="root_table" width="100%" cellspacing="0" cellpadding="0" height="100%">
                        <?php
                        if($sf_user->isAuthenticated() || (!$sf_user->isAuthenticated() && $sf_request->getPathInfo() == '/')){
                            ?>
                            <tr valign="top">
                                <td class="root_table__top" style="border-bottom: 1px solid #C5CBD6;" align="center" valign="top">
                                    <div class="max_width" style="padding-top: 10px;padding-bottom: 10px;">
                                        <a class="logo" href="<?php echo url_for('@homepage');?>"><img src="/i/logo.svg" width="140" height="50" /></a>
                                        <?php
                                        include_component('main', 'mainMenu', array('template' => 'mainMenu'));
                                        if($sf_user->isAuthenticated()){
                                            ?>

                                            <div class="profile">
                                                <b><?php echo $sf_user->getAccount()->getName(); ?></b><i class="br10"></i>
                                                <a href="<?php echo url_for('@signout');?>">Выйти</a>
                                            </div>
                                        <?php
                                        } else {
                                            ?>
                                            <div class="no_profile">
                                                <a href="#" onclick="popup.open('signin_form');return false;">Войти</a>
                                            </div>
                                            <?php
                                        }
                                        ?>
                                    </div>
                                </td>
                            </tr>
                            <?php
                        }
                        ?>
                        <tr valign="top">
                            <td class="root_table__middle" align="center" valign="top" height="100%">
                                <?php
                                echo $sf_content;
                                ?>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
<?php include(sfConfig::get('sf_app_template_dir') . '/footer.php'); ?>