<?php
/**
 * @var $this PartnersSectionController
 * @var $content1 string
 * @var $content2 string
 * @var $partners Partner[]
 * @var $contacts Contact[]
 */
?>
<?php $this->renderPartial('//snippets/headerGallery'); ?>
<!-- header end-->
<div class="wrapper content-wrapper">
    <div class="col-wrapper">
        <div class="col2 aside-no-title">
            <?php
            $items = array();
            foreach ($partners as $item) {
                $items[] = array(
                    'label' => $item->i18n->name,
                    'url' => $this->createUrl('partnersSection/partner', array('link' => $item->link)),
                );
            }
            $sideMenu = array(
                array('url' => $this->createUrl('about/index', array('node_id' => $this->root_node_id)), 'label' => Yii::t('site', 'О компании')),
            );
            foreach ($this->getRootNode()->nodes as $node)
                if (!$node->hidden) {
                    $sideMenuItem = null;
                    switch ($node->data_type) {
                        case('partnersSection'):
                            $sideMenuItem = array(
                                'url' => $this->createUrl('partnersSection/partners', array('node_id' => $node->id)),
                                'label' => $node->i18n->label,
                            );
                            break;
                        case('jobsSection'):
                            $sideMenuItem = array(
                                'url' => $this->createUrl('jobsSection/jobs', array('node_id' => $node->id)),
                                'label' => $node->i18n->label,
                            );
                            break;
                        case('aboutSection'):
                            $sideMenu[] = array(
                                'url' => $this->createUrl('aboutSection/index', array('node_id' => $node->id)),
                                'label' => $node->i18n->label,
                            );
                            break;
                    }
                    if (!empty($sideMenuItem)) {
                        $sideMenuItem['active'] = $node->id == $this->node_id;
                        if ($sideMenuItem['active']) {
                            $sideMenuItem['items'] = $items;
                        }
                        $sideMenu[] = $sideMenuItem;
                    }
                }
            $this->widget('zii.widgets.CMenu', array(
                'items' => $sideMenu,
                'htmlOptions' => array('class' => 'sidebar-nav'),
            ));
            ?>
            <?php $this->renderPartial('//about/_photoFeed', array('galleryId' => $this->getAboutRoot()->photo_gallery_id));?>
        </div>
        <div class="col8">
            <h1><?php echo CHtml::encode($this->pageName)?></h1>

            <div class="text-content">
                <?php echo $content1 ?>
            </div>
            <div class="partnters-list">
                <?php foreach ($partners as $partner): ?>
                <a href="<?php echo CHtml::encode($this->createUrl('partnersSection/partner', array('link' => $partner->link)))?>"
                   class="partnters-item">
                    <span class="partnters-item-img">
                        <?php echo CHtml::image($partner->imageBehavior->getFileUrl('medium'));?>
                    </span>
                    <span class="partnters-item-name"><?php echo CHtml::encode($partner->i18n->name)?></span>
                </a>
                <?php endforeach; ?>
            </div>
            <?php echo $content2;?>
        </div>
        <div class="col2">
            <p class="section-title"><?php echo Yii::t('site','Есть вопросы?');?></p>

            <div class="text-content">
                <?php echo Yii::t('site','Обращайтесь к вашему персональному консультанту (о компании)!');?>
            </div>
            <?php $this->renderPartial('//snippets/sidebarContacts');?>
        </div>
    </div>
</div>
        